Snapshotting Worflow
Snapshotting is a technique provided by tc to capture the Topology definition along with all the sub versions of its nodes and entities. It is not to be confused with a manifest of versions. We can freeze a sandbox, snapshot it, store the snapshot in S3 or filesystem and render the snapshot of a Topology in any sandbox and profile.
Following is the structure of a snapshot:
[{ "changed": true, "changelog": ["PR-1123 ..."], "dir": "./path/to/topology", "git_version": "", "kind": "routed", "namespace": "topo-1", "prev_version": "", "sandbox": "stable", "tc_version": "", "updated_at": "", "updated_by": "", "version": "0.1.1", "topology": Topology}]-
Freeze
Terminal window tc freeze -s stable -e qaFreeze is a software-enforced freeze. Test! Test! Test! after freeze.
-
Snapshot
Terminal window tc snapshot -s stable -e qa --saveThis saves the snapshot of manifests, changelog and topology definitions to s3.
-
Unfreeze
Terminal window tc unfreeze -s stable -e qaThis allows Continuous deploys to continue.
-
Promote
To promote a snapshot, we first go back and pick the one that has been certified and tested in QA. For example:
Terminal window tc snapshot --listqa/stable/2025-10-02qa/stable/2025-10-01qa/stable/2025-09-30qa/stable/2025-09-29qa/stable/2025-09-18To deploy a snapshot (say qa/stable/2025-10-02), we do:
Terminal window tc ci-deploy --env prod --sandbox stable --snapshot qa/stable/2025-10-02Behind the scenes, ci-deploy triggers a pipeline using the snapshot:
Terminal window tc snapshot --show qa/stable/2025-10-02 -f pipeline --target-env dev --target-sandbox stable
Managing Snapshots
Section titled “Managing Snapshots”To list snapshots:
tc snapshot --list
qa/stable/2025-10-02qa/stable/2025-10-01qa/stable/2025-09-30qa/stable/2025-09-29qa/stable/2025-09-18To view a snapshot
tc snapshot --show qa/stable/2025-10-02To view the pipeline generated for a snapshot
tc snapshot --show qa/stable/2025-10-02 -f pipeline --target-env dev --target-sandbox stableSnapshotter API Service
Section titled “Snapshotter API Service”At times, we may need to run the snapshotter commands with a checkout of your code. We can run it in a microvm. Example
TC_ASSET_BUCKET=my-bucket tc create -s yoda -e dev=> microvm-url
curl -X POST microvm-url -d '{"command": "snapshot", "env": "qa", "sandbox": "stable"}'