Overview
This recipe deploys a PyTorch 2.1 and CUDA 12.1 workspace with Jupyter Notebook, prepared for SpotWarp. It is intended for long-running GPU jobs that save checkpoints and can resume after a container instance is replaced. SpotWarp has two parts:- SaladCloud container: Runs your workload and stores code and checkpoints under
/workspace. - External client: Runs on your workstation or server, copies
/workspaceto local storage, monitors the container group, and restores a backup to a replacement instance. It can then run your workload’s resume command.
Prerequisites
To deploy the recipe, you need a SaladCloud account and either a SpotWarp license key or the defaultSALAD-TRIAL value
for the 14-day evaluation. No license key is needed for the evaluation; an empty key also enables it.
See SpotWarp for SaladCloud for client setup and pricing. Salad users can use code
SALAD for 50% off their first three months of a SpotWarp subscription. SaladCloud compute charges are separate.
To use the external backup and recovery client, you also need:
- A SaladCloud API key and your organization, project, and container group names.
- An SSH public key registered in SaladCloud, with its matching private key on the client machine. Follow SSH & Terminal Access.
- A workstation or server that remains online and stores the backups.
- A workload that writes restartable checkpoints under
/workspace.
SALAD-TRIAL value to the container.
Quick Start
- Open the SaladCloud Portal.
- Select the SpotWarp Checkpoint Backup and Restore recipe.
- Enter a Container Group Name. Leave SpotWarp License Key as
SALAD-TRIALfor the 14-day evaluation, or enter your SpotWarp license key. - Leave SpotWarp Server URL at
https://gpu-action.comunless SpotWarp provides a different endpoint. - Keep the default one replica for initial Jupyter setup, or use the warm-standby workflow described below.
- Deploy and wait for the instance to be running and ready.
- Open the instance logs and find
Generated session JUPYTER_TOKEN:. Use that token to sign in to Jupyter.
Recipe Defaults
The recipe uses the image’s default entrypoint, which prepares
/workspace/checkpoints and starts Jupyter. No startup
command override is needed.
The form sets these container environment variables:
Access Jupyter
Open the container group’s access domain with/tree appended:
JUPYTER_TOKEN: the container generates it at
startup. A restarted or replacement instance gets a new token.
Container Gateway authentication is disabled so the browser can establish Jupyter’s WebSocket connections. Browser
WebSocket clients cannot add the custom Salad-Api-Key header. See
WebSockets.
Replica Modes
The recipe supports both modes. The default replica count and the external client’s default standby preference are separate settings.- One replica: The recipe default, recommended for initial setup and Jupyter through the shared access domain. Start
the client with
--no-standbyto prevent it from adding a second replica. Recovery waits for SaladCloud to allocate a replacement instance. - Two replicas: SpotWarp’s default warm-standby mode. The client maintains an active instance and a standby for recovery, scaling the group to two replicas. Both replicas are billed normally. Each has its own workspace; the client still needs to restore a backup when recovering a job.
--no-standby leaves the existing replica count unchanged. When returning from warm standby to a single replica, also
set the replica count to one in the Portal.
Configure The External Client
Install SpotWarp on the machine that will hold the backups using the SpotWarp client setup guide for SaladCloud, then run:SALAD-TRIAL for the 14-day evaluation, or provide the same SpotWarp license key used for the container. Then
provide your SaladCloud API key, organization and project names, the exact container group name, a local backup
directory, and your standby preference. Configuration is stored in ~/.spotwarp/config.json on that machine.
The client uses ~/.ssh/id_ed25519 by default. If your private key has a different name, add
--ssh-key /path/to/private-key to the start command. The .pub file belongs in your SaladCloud account; the client
uses the matching private key.
In our testing, SpotWarp 3.5.2 required an SFTP-based transfer workaround with SaladCloud’s managed SSH endpoint. Its
default
rsync path and legacy SCP transfers failed. Check client compatibility with SpotWarp before relying on
backups; a healthy client status alone does not verify that files were copied.One Replica
Replaceyour-container-group-name with your deployment name and the resume command with your actual workload command:
train.py; upload your workload before starting it.
Warm Standby
Enable warm standby during client setup and start without--no-standby:
--container so the client targets this deployment rather than all container groups in the project. The
second replica incurs normal SaladCloud charges.
Monitoring And Backups
./backups/<container-group-name>/ by default, or under the directory configured during setup or with --backup-dir.
Use an absolute backup path to avoid depending on the directory where you launch the client.
The client’s rsync implementation skips files modified in the last ten seconds. This does not guarantee checkpoint
consistency, and the SFTP-based workaround does not provide that same exclusion. Let checkpoint writes finish and verify
the resulting backup before testing recovery. Transfer time depends on checkpoint size and the client machine’s network
connection.
Test A Deployment
Check the Jupyter readiness endpoint using your container group’s access domain:Deployment Notes
- The client disables SSH host-key checking for replacement instances and periodically sends its license key, the number
of protected instances, and the failover count to
gpu-action.com. No workspace files, file names, or SaladCloud API keys are sent togpu-action.com. Review this behavior against your security and privacy requirements. - Local container files are ephemeral. Keep restartable checkpoints under
/workspaceand retain backups outside the instance. - The recipe uses a mutable image tag. Re-test after upstream image updates.
- The external client must remain running for monitoring, backup, and recovery. Stopping it does not stop the SaladCloud container group or its billing.
- Recovery timing varies with replica availability, backup size, and network throughput. Warm standby reduces the wait for a replacement, but does not eliminate restore time.