Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Write temporary files from Google Cloud Function

Can I write to the container's local filesystem from a Google Cloud Function? AWS Lambda allows writing to /tmp:

Q: What if I need scratch space on disk for my AWS Lambda function?
Each Lambda function receives 500MB of non-persistent disk space in its own /tmp directory.

Is there something equivalent in GCF?

like image 663
Trevor Dixon Avatar asked Mar 10 '17 13:03

Trevor Dixon


1 Answers

Yes, /tmp is an in-memory mount. From https://cloud.google.com/functions/docs/concepts/exec#file_system:

File system

The only writeable part of the filesystem is the /tmp directory, which you can use to store temporary files in a function instance. This is a local disk mount point known as a "tmpfs" volume in which data written to the volume is stored in memory. Note that it will consume memory resources provisioned for the function.

like image 128
Trevor Dixon Avatar answered Sep 30 '22 06:09

Trevor Dixon