Snapshots & Environment Lifecycles
Snapshots & Snapshot Retention
A snapshot is a copy of a virtual machine at a specific moment in time. Snapshots help to load environments and configurations so that you can skip running steps that have not changed or that have successfully executed on previous commits.
Algorithm for Deleting Snapshots
Listed below is a summary of how we delete snapshots. It’s important to review this to learn the states of snapshots at different times.
- webapp.io splits important snapshots into VIP, Important, and Not Important (VIP as the top tier).
- Prioritized snapshots per paying customer as determined by tier and how recent the snapshots are
- Newer than 10 minutes
- Newer than a week old and the latest snapshot for an instruction
- Newer than a week old and contains the EXPOSE WEBSITE instruction for an open pull request.
Order Snapshot Importance (VIP, Important, Not Important)
Listed below is the process on how webapp.io will carry out deleting the prioritized snapshots.
- Delete the oldest not important
- Delete the oldest important
- Delete the oldest VIP
Environments (Layerfiles with EXPOSE WEBSITE, Layerfiles that expose a debug terminal, etc.) have three lifecycle levels:
- Deleted, which means you can’t start them without rebuilding (rebuilding deletes everything, like your temporary database, registered user, and state in the environment).
- Stopped, which means you see a spinner as they start
- Running, which means it’s currently running
Running to Stopped
The Running lifecycle to Stopped lifecycle happens for a few reasons:
- After 3 minutes of inactivity if there are builds queued
- After 60 minutes in general (this can be changed by our admin team if requested)
A stopped state indicates that your snapshot is still available but has been stopped due to the reasons above.
If you have deployed a VM with webapp.io hosting your VM will stop based on the same reasoning above. However your VM snapshot will not be deleted - giving your end-users a fast cold-start experience.
Stopped to Deleted
The Stopped lifectyle to Deleted lifecycle happens for two reasons:
- Something crashes (rare)
- Snapshot is deleted (see Snapshots & Snapshot Retention)