Snapshots
Snapshots are pre-configured templates containing all dependencies, tools, environment settings and resource requirements for your Synodes Sandbox. Synodes supports creating Snapshots from all standard Docker or OCI compatible images.
Creating Snapshots
When spinning up a Sandbox, Synodes uses a Snapshot based on a simple image with some useful utilities pre-installed, such as python, node, pip as well as some common pip packages. More information below.
It is possible to override this behavior and create custom Snapshots by visiting the Dashboard, clicking on Snapshots and on Create Snapshot.
For the Snapshot image, you may enter the name and tag of any publicly accessible image from Docker Hub such as alpine:3.21.3 and debian:12.10 or from another public container registry - e.g. my-public-registry.com/custom-alpine:3.21.
The entrypoint field is optional and if the image hasn’t got a long-running entrypoint, Synodes will ensure sure that the resulting container won’t exit immediately upon creation by automatically running sleep infinity.
Once the Snapshot is pulled, validated and has an Active state, it is ready to be used. Define the CreateSandboxFromSnapshotParams object to specify the custom Snapshot to use:
sandbox = synodes.create(CreateSandboxFromSnapshotParams( snapshot="my-snapshot-name",))const sandbox = await synodes.create({ snapshot: "my-snapshot-name",})Full example:
from synodes import Synodes, CreateSandboxFromSnapshotParams
synodes = Synodes()
sandbox = synodes.create(CreateSandboxFromSnapshotParams(snapshot="my-snapshot-name",))
response = sandbox.process.code_run('print("Sum of 3 and 4 is " + str(3 + 4))')if response.exit_code != 0:print(f"Error running code: {response.exit_code} {response.result}")else:print(response.result)
sandbox.delete()import { Synodes } from '@synodesio/sdk'
async function main() { // Initialize the Synodes client const synodes = new Synodes()
try { // Create the Sandbox instance const sandbox = await synodes.create({ snapshot: "my-snapshot-name", }) // Run the code securely inside the Sandbox const response = await sandbox.process.codeRun( 'print("Sum of 3 and 4 is " + str(3 + 4))', ) if (response.exitCode !== 0) { console.error('Error running code:', response.exitCode, response.result) } else { console.log(response.result) } } catch (error) { console.error('Sandbox flow error:', error) } finally { // Clean up the Sandbox await sandbox.delete() }}
main()Snapshot Resources
Snapshots contain the resource requirements for Synodes Sandboxes. By default, Synodes Sandboxes come with 1 vCPU, 1GB RAM, and 3GiB disk.
Need more power? Use the Resources class to define exactly what you need: CPU, memory, and disk space are all customizable.
Check your available resources and limits in the dashboard.
from synodes import ( Synodes, CreateSnapshotParams, Image, Resources, CreateSandboxFromSnapshotParams,)
synodes = Synodes()
# Create a Snapshot with custom resources
synodes.snapshot.create( CreateSnapshotParams( name="my-snapshot", image=Image.debian_slim("3.12"), resources=Resources( cpu=2, memory=4, disk=8, ), ), on_logs=print,)
# Create a Sandbox with custom Snapshot
sandbox = synodes.create( CreateSandboxFromSnapshotParams( snapshot="my-snapshot", ))import { Synodes, Image } from "@synodesio/sdk";
async function main() { const synodes = new Synodes();
// Create a Snapshot with custom resources await synodes.snapshot.create( { name: "my-snapshot", image: Image.debianSlim("3.13"), resources: { cpu: 2, memory: 4, disk: 8, }, }, { onLogs: console.log } );
// Create a Sandbox with custom Snapshot const sandbox = await synodes.create({ snapshot: "my-snapshot", });}
main();Images from Private Registries
To create a Snapshot from an image that is not publicly available, you need to start by adding the image’s private Container Registry:
- Go to the Registries page in the Dashboard
- Click the
Add Registrybutton. - Input the Registry’s name and URL, username, password, project, and submit
- Once the Container Registry is created, you may go back to the Snapshots page
- When creating the Snapshot, make sure to input the entire private image name, including the registry location and project name -
my-private-registry.com/<my-project>/custom-alpine:3.21
The next step is the same; simply set the CreateSandboxFromSnapshotParams field to use the custom Snapshot and no more authentication is needed.
Using a Local Image
In order to avoid having to manually set up a private container registry and push your image there, the Synodes CLI allows you to create a Snapshot from your local image or from a local Dockerfile and use it in your Sandboxes.
After running docker images and ensuring the image and tag you want to use is available use the synodes snapshot push command to create a Snapshot and push it to Synodes, e.g.:
synodes snapshot push custom-alpine:3.21 -n my-snapshot-nameFor more information, see the CLI documentation.
If you haven’t built the desired image yet, and have a Dockerfile ready, you can use the Declarative Builder in our SDK - read more about it here.
Alternatively, to do it through the CLI, use the --dockerfile flag under create to pass the path to the Dockerfile you want to use and Synodes will build the Snapshot for you:
synodes snapshot create trying-synodes:0.0.1 --dockerfile ./Dockerfile --context ./requirements.txtBuilding image from /Users/idagelic/DockerfileStep 1/5 : FROM alpine:latest
...
⡿ Waiting for the Snapshot to be validated ...
...
✓ Use 'harbor-transient.internal.synodes.io/synodes/trying-synodes:0.0.1' to create a new sandbox using this SnapshotDeleting Snapshots
Deleting your custom Snapshots is a straightforward process. Simply go to the Snapshots page and click on the Delete button that shows up when clicking the three dots at the end of a row of the Snapshot you want deleted.
Default Snapshot
The default Snapshot used by Synodes is based on an image that contains python, node and their respective LSP’s, as well as these pre-installed pip packages:
beautifulsoup4(v4.13.3)django(v5.1.7)flask(v3.1.0)keras(v3.9.0)matplotlib(v3.10.1)numpy(v2.2.3)openai(v1.65.4)opencv-python(v4.11.0.86)pandas(v2.2.3)pillow(v11.1.0)pydantic-ai(v0.0.35)requests(v2.32.3)scikit-learn(v1.6.1)scipy(v1.15.2)seaborn(v0.13.2)SQLAlchemy(v2.0.38)transformers(v4.49.0)anthropic(v0.49.0)synodes_sdk(v0.11.1)huggingface(v0.0.1)instructor(v1.7.3)langchain(v0.3.20)llama-index(v0.12.22)ollama(v0.4.7)