Skip to main content

Module revisions

Module revisions 

Source
Expand description

gtc op revisions {stage,warm,drain,archive,list} (A3).

Manages Environment.revisions: Vec<Revision> and the per-deployment current_revisions list on each BundleDeployment. Lifecycle transitions are validated against the spec’s pure is_valid_transition predicate so the operator can’t put a Revision into an impossible state.

Heavy lifting deferred:

  • Bundle-archive staging (resolving .gtbundlepack_list via the distributor-client’s stage_bundle call, digest-verifying the artifact, and writing the pack-list lockfile atomically before the revision becomes Staged) is Phase D work — tracked at https://github.com/greenticai/greentic-deployer/issues/209. Today stage trusts caller-supplied bundle_digest / pack_list / *_ref fields verbatim. A5 delivered the lifecycle storage guard (environment::lifecycle::apply_revision_transition) and the distributor-client’s set_bundle_state atomic-write + transition matrix, but did NOT integrate stage_bundle here.
  • Runner warm/drain hooks (route-table build, in-flight session accounting) are owned by greentic-start; A3 only updates the lifecycle bit and stamps warmed_at. The full warm/drain dance lands when the dispatcher lands.

Structs§

PackListEntryPayload
RevisionStagePayload
RevisionSummary
RevisionTransitionPayload

Functions§

archive
op revisions archive. Transitions the lifecycle to archived and removes the revision from BundleDeployment.current_revisions. Refuses archival of any revision still referenced by a live TrafficSplit — callers must rebalance traffic through gtc op traffic set first.
drain
op revisions drain. ready → draining. The full in-flight drain dance (sessions, WebSocket cleanup, etc.) lives in the runtime; this command records the intent and stamps the lifecycle.
list
op revisions list <env> (filterable by --deployment <id> later).
payload_from_stage_args
Build a RevisionStagePayload from direct CLI args, or None when no positional args were supplied (deferring to --answers / --schema). Mirrors traffic::payload_from_set_args: all clap fields are optional so the answers/schema paths keep working unchanged.
stage
op revisions stage. Creates a Revision at inactive → staged. Bumps the sequence to one past the deployment’s current max.
warm
op revisions warm. staged → warming → ready. The two-step move is collapsed here for A3 because no async warm hooks exist yet; Phase D wires the runner warm API.
warm_with_health_gate
Gate-aware variant of warm (B9 of plans/next-gen-deployment.md).