Skip to main content
Source: demo/volumes/app.py in the repository. Persistent, shared storage. A volume is mounted into every container that lists it; functions write and read plain files, and you move files in and out with the CLI.
Notes
  • Volume(name="demo-data", mount_path="./data") creates the volume on first use. The mount path is relative to the container’s working directory, or absolute, like /data. It has to name a folder: it can’t be empty, ., ./ or /, and it can’t contain ... A function that asks for one of those is turned down when it’s deployed or run, with a message that says which mount path is wrong.
  • A volume is always one of your own workspace’s. A CloudBucket’s name has to be a bucket name, with no / in it.
  • Several functions, or several running containers, can mount the same volume at once.
  • The dashboard shows volumes under Storage, with a file browser and upload.