Serve runtime deploy¶
A serve assignment has to change the cluster and then tell the control plane,
in a form it can check, what the cluster now looks like and which release route
the change was made under. The project.serve.v1 route does that in three
steps: it reads the assignment's contracts, actuates the runtime, and observes
what is running, and then it reports one outcome carrying the deploy evidence,
the observation and the release route's generation and hash. This page covers
each step, the report, and the two ways a serve assignment fails.
From assignment to report¶
flowchart TB
subgraph TASK["control_plane_task"]
direction LR
RDC[("runtime_deploy_contract")]
REC[("runtime_evidence_contract")]
RRC[("release_route_contract<br/>route_generation, route_hash")]
end
PR["Read the contracts<br/>build the execution report base"]
ACT{{"Actuate<br/>apply, check or delete"}}
OBS{{"Observe<br/>what is running"}}
OK["Report succeeded<br/>ack, progress, complete"]
F1["Report failed<br/>PROJECT_SERVE_RUNTIME_ACTUATION_FAILED"]
F2["Report failed<br/>PROJECT_SERVE_RUNTIME_OBSERVER_FAILED"]
CP{{"Control plane<br/>checks route generation and hash"}}
TASK --> PR --> ACT
ACT -->|"deploy evidence"| OBS
ACT -.->|"error"| F1
OBS -->|"runtime evidence"| OK
OBS -.->|"error"| F2
OK --> CP
F1 --> CP
F2 --> CP
Actuation runs before observation, and each has its own failure code, so a failed report says whether changing the cluster or confirming the change failed. Every report, successful or failed, carries the release route fences.
The execution report¶
The route starts every report from the same base:
assignment_kind project.serve.v1
assignment_ref from the task
dataplane_registration_uuid this node's registration
lease_owner_dataplane_registration_uuid this node's registration
trace_id, idempotency_key from the assignment
release_route_generation release_route_contract.route_generation
release_route_hash release_route_contract.route_hash
and adds runtime_deploy, the deploy evidence, and runtime_evidence, the
observation. The control plane accepts a report only when its route generation
and hash match the project's current release route; a report made under a
route that has since changed is refused with
PROJECT_RELEASE_ROUTE_GENERATION_MISMATCH or
PROJECT_RELEASE_ROUTE_HASH_MISMATCH. See
Versioned release routes and bindings.
Actuation¶
The runtime deploy contract is applied for the assignment's phase and returns
project.runtime_deploy_evidence.v1. The phases and their evidence are on
Deployment reconciliation, and the objects on
Runtime actuation.
Observation¶
The observer reads runtime_evidence_contract and reports what is running in
one of two modes, named by the contract's observer_mode:
observer_mode |
What the node reports |
|---|---|
kubernetes_native |
Reads the Deployment, the Service and the pods behind the Deployment's selector, and reports the running image digest from the first ready pod |
contract_only |
Reports the contract's values without reading the cluster |
In kubernetes_native mode, a running image digest that differs from the
contract's engine_image_digest fails the observation, and so does a missing
digest when the contract names one. The observation records:
observer_mode, namespace, deployment_ref, service_ref, endpoint
running_image_digest, running_image_ref
pod_ref pod://<namespace>/<pod>
readiness_state starting, ready or stopped
observed_at_epoch_ms
readiness_state is stopped for serve_stop, ready for a readiness check
with a ready pod and at least one available replica, and starting otherwise.
In contract_only mode a readiness check reports ready from the contract
alone, so read observer_mode before relying on readiness_state.
The reports¶
On success the node reports:
ack status acked
progress status running
complete status succeeded, execution_report with runtime_deploy and runtime_evidence
event assignment.succeeded
log project serving control assignment completed
When a serve assignment fails¶
| Code | Condition | Log message |
|---|---|---|
PROJECT_SERVE_RUNTIME_ACTUATION_FAILED |
The contract was refused, or applying, checking or deleting the objects failed | project runtime actuation failed |
PROJECT_SERVE_RUNTIME_OBSERVER_FAILED |
The actuation succeeded and the observation failed | project serving runtime observer failed |
A failed report carries status failed, the code and the error message in
error, an assignment.failed event, and the execution report with the
failure: runtime_deploy_error or observation_error, the deploy evidence
(with status failed and the reason when actuation failed), and a runtime
observation built from the contract so the report still names the deployment.
The error message is the actuator's or observer's own, such as the
namespace precondition message on
Runtime actuation.