Create a volume
To create a standalone volume, you must provide a uniquename and specify its size in megabytes (MB). You can also specify optional labels. This volume exists independently of any sandbox.
Set up authentication to Blaxel
Set up authentication to Blaxel
The Blaxel SDK authenticates with your workspace using credentials from these sources, in priority order:
- when running on Blaxel, authentication is handled automatically
- variables in your
.envfile (BL_WORKSPACEandBL_API_KEY, or see this page for other authentication options). - environment variables from your machine
- configuration file created locally when you log in through Blaxel CLI (or deploy on Blaxel)
Manage volume templates
Create volumes containing the same set of files every time.
Delete a volume
Delete a volume by calling:-
the class-level
delete()method with the volumenameas argument, or -
by calling the instance-level
delete()method:
List volumes
To list existing volumes:Attach a volume to a sandbox
To use a volume, attach it when you create a sandbox by passing an array of volume configurations to thevolumes property.
Each configuration must include the name of the volume to attach and the mountPath where it will be accessible inside the sandboxβs filesystem. The mount path will override the existing content of a directory.
/app directory within this sandbox will be stored on my-volume and will persist even if this sandbox is deleted.
At this time, you cannot detach a volume from a sandbox.