WarpBuild Snapshot Runner: /tmp State Not Persisting
WarpBuild snapshot runners are fast, but /tmp does not survive a reboot. Here is what persists, what does not, and how to snapshot safely.
WarpBuild snapshot runners capture a VM snapshot during a workflow and reboot from it for faster later runs. According to WarpBuild's snapshot docs, one documented limitation trips people up: the /tmp directory is cleaned on reboots and will not persist state. This page covers that gotcha and the documented credential-cleanup guidance. Confirm specifics in WarpBuild's snapshot docs.
What does not persist
Per WarpBuild's snapshot docs, the /tmp directory is cleaned on reboots, so anything written there before saving a snapshot will not be present after a snapshot boot. If your setup wrote caches, downloads, or build artifacts to /tmp expecting them to carry over, they will be gone.
How to persist what you need
Store anything you need to survive a snapshot boot outside /tmp, for example under the workspace or a home-directory path that the snapshot captures. When you boot from a snapshot with snapshot.key=<alias>, WarpBuild sets the WARPBUILD_SNAPSHOT_KEY environment variable to the alias, which you can check to branch behavior between a fresh boot and a snapshot boot. Verify the exact captured paths in WarpBuild's snapshot docs.
Clean credentials before snapshotting
WarpBuild's snapshot docs emphasize removing credentials before saving a snapshot so secrets are not baked into the image. They recommend commands such as rm -rf $HOME/.ssh $HOME/.aws to remove credential files and git clean -ffdx to remove untracked files. Run this cleanup before the snapshot-save step so the saved image is safe to reuse.
Snapshot-save options
The snapshot-save action takes a required alias, plus optional fail-on-error (default true, so the action fails if snapshot creation errors) and wait-timeout-minutes (default 30, the maximum time to wait for the snapshot to be created). If your snapshots are large and creation is slow, raising wait-timeout-minutes can prevent a premature failure. Confirm current defaults in WarpBuild's snapshot docs.