Skip to main content
Use one retained setup operation when several tasks need the same dependencies or fixtures. Each task starts on new compute from the saved filesystem image; processes, memory, services, and connections from setup are gone.

Prerequisites

  • Complete Set up access.
  • In a fresh project, run uv init --python 3.12 and uv add "contree-sdk==0.3.6".
  • Use an immutable image UUID already in the project, or allow the example to import docker.io/library/alpine:3.19.

Complete source

Save as reuse.py:
Run uv run python reuse.py. The output ends with A and B. The first line is the immutable checkpoint UUID to record with the setup revision.

State, failure, and retention

The setup explicitly uses disposable=False; its UUID is the branch source. Both readers explicitly use disposable=True, so they return output but no reusable image. SDK 0.3.6 represents that outcome with uuid is None; attempting another run from that result raises DisposableImageRunError locally. If either reader fails, inspect its stdout, stderr, exit code, and first.result.truncated or second.result.truncated, then rerun only that task from checkpoint_uuid. An SDK wait timeout triggers a best-effort cancellation; do not resubmit until the operation outcome is known. Checkpoint images are retained for 180 days; after that, untagged and unreferenced images may be deleted. See Limits, retention, and usage before choosing a long-term storage strategy.

References