Skip to main content
Import the thunder package to create a sandbox and run commands in it.

Sandbox.create

Creates a new sandbox with the requested compute and storage resources.
integer
required
Number of CPU cores to allocate.
integer
required
Amount of memory to allocate.
integer
required
Amount of storage to allocate.
Returns a Sandbox object immediately. Call wait_until_running() before executing commands.

Sandbox.wait_until_running

Waits until the sandbox is ready to accept commands.

Sandbox.exec

Starts a command in the sandbox. Pass the executable as the first positional argument and each command-line argument separately.
string
required
Executable to run in the sandbox.
string
Command-line arguments passed to the executable.
Returns a process object. Read its standard output with process.stdout.read() and wait for it to finish with process.wait().

Process.stdout.read

Reads the command’s standard output.

Process.wait

Waits for the command to finish.

Sandbox.terminate

Terminates the sandbox and releases its resources.
Terminate a sandbox when you no longer need it.