Executor runtime and control tasks¶
Model and project images are built in your cluster, from your registry, with
your build service account, and the control plane records only what the build
reports. A node receives a build as a build.model.v1 or build.project.v1
assignment, runs it as a Kaniko job in your build namespace, checks what the
job produced, and reports the result. This page covers the build assignment,
the job the node creates, the checks before and after each attempt, what the
node reports, and how to find a build's job.
For how the control plane creates builds, see Build orchestration.
Where a build runs¶
flowchart TB
subgraph CP["CONTROL PLANE"]
direction LR
BA[("Build assignment<br/>build.control_task.v1")]
BR[("Build record<br/>status, cancellation")]
end
subgraph YI["YOUR INFRASTRUCTURE"]
direction TB
subgraph XD["XRATUD"]
direction TB
G{{"Before each attempt<br/>status, deadline"}}
V{{"After the job<br/>output, publish, provenance"}}
end
subgraph NS["BUILD NAMESPACE"]
direction TB
J["Job kaniko-...<br/>build service account"]
end
REG[("Your registry")]
J ==>|"push"| REG
end
BA -->|"pulled"| G
BR -.->|"read before each attempt"| G
G -->|"kubectl apply, wait"| J
J -->|"logs, last JSON line"| V
V -->|"build report and status"| CP
The job pushes the image, under the build service account the orchestration contract names. The node creates the job, waits for it, reads its result from the job's logs, and checks that result before any report says the build succeeded.
The build assignment¶
The assignment's control_plane_task carries build.control_task.v1 and an
executor contract, build.executor_runtime_contract.v1, with the build's
orchestration:
| Item | Values |
|---|---|
| Executor type | kaniko |
| Executor mode | kubernetes_native |
| Build instance | micro, mini, medium, large, xlarge |
| Orchestration | Namespace, service account, job image, node placement, and the pull and publish contracts |
A build.model.v1 whose lifecycle_route is proxy_api_no_build builds no
image: the model is served through a provider API, and the node reports the
build without creating a job. Instance sizes are described on
Instance and context profiles.
The job¶
The node applies one Kubernetes Job in the orchestration namespace:
| Property | Value |
|---|---|
| Name | kaniko-<operation ref>-<12 hex of its SHA-256>, at most 63 characters |
| Labels | app.kubernetes.io/name=xratu-kaniko-builder, xratu.io/build-id=<build_id>, xratu.io/build-operation-ref=<ref> |
| Annotation | xratu.io/build-request-hash, the SHA-256 of the build request |
backoffLimit |
0 |
restartPolicy |
Never |
| Service account | The build service account from the orchestration, in the same namespace |
The node then waits for the job to complete, reads its logs, and takes the last
line that is a JSON object as the result. The result must carry image_ref, a
sha256: image_digest and sbom_ref.
To find a build's job and read what it printed:
BUILD_NAMESPACE=xratu-build
BUILD_ID=bld_0f3c9a
kubectl -n "$BUILD_NAMESPACE" get jobs -l xratu.io/build-id="$BUILD_ID"
kubectl -n "$BUILD_NAMESPACE" logs job/"$(kubectl -n "$BUILD_NAMESPACE" get jobs \
-l xratu.io/build-id="$BUILD_ID" -o jsonpath='{.items[0].metadata.name}')"
Set BUILD_NAMESPACE to your build namespace and BUILD_ID to the build's id.
Attempts¶
A build gets one retry by default, two attempts in all, one second apart. Before every attempt, the node reads the build's record from the control plane and checks the deadline:
| Condition | Outcome | failure_category |
|---|---|---|
| The build was cancelled | Stops before the job | cancelled |
The build is already succeeded or failed |
Stops before the job | terminal_reconciled |
| The assignment deadline has passed | Stops before the job | deadline_exceeded |
| Fewer than 5 seconds remain | Stops before the job | deadline_exceeded |
| Time remains | Runs the job with the remaining time as its timeout |
A failed attempt is retried when attempts and time remain, unless its error is
one no retry can fix: an unconfigured executor, an empty command, output that
is missing or invalid JSON, output without image_ref, image_digest or
sbom_ref, an unsupported build, or a contract version mismatch. A retried
failure is classified from its message:
registry_transient the message mentions the registry or a push
job_interrupted an interruption, a node drain or an eviction
timeout a timeout
execution_failed anything else, and a build that used every attempt
After the job¶
A job that succeeded is checked before the build is reported as succeeded:
- Pull evidence is recorded from the build's pull contract. See Artifact pull and resolution.
- The builder publish result is resolved from the job's output, and the push is checked against the publish contract. See Registry adapter runtime and Builder publish handshake.
- Signed provenance is verified against the image digest and SBOM when the
build contract requires it. A failure reports
provenance_verification_failed. - For a model build, the composition result is validated against the
composition contract and the image digest. A failure reports
composition_validation_failed.
The node records an execution attestation with the SHA-256 of the build request and of the build's output, so the reported result can be matched to the request that produced it.
What the node reports¶
The node reports the build to the control plane's build record, marking it
running when the first attempt starts and reporting the outcome when it ends,
and completes the assignment through its status channel. A succeeded report
carries image_ref, image_digest and sbom_ref; the control plane pins the
digest. Every report carries the build lifecycle, build.kaniko_lifecycle.v1:
{
"contract_version": "build.kaniko_lifecycle.v1",
"assignment_kind": "build.project.v1",
"workspace_uuid": "4b1e...",
"build_id": "bld_0f3c9a",
"status": "failed",
"failure_category": "registry_transient",
"observed_control_plane_status": "running",
"external_operation_ref": "op-7d21",
"cancel_signal": {"issued": false, "operation_ref": "op-7d21", "detail": ""},
"attempt_count": 2,
"retry_count": 1,
"max_retries": 1,
"retry_backoff_seconds": 1.0,
"deadline_epoch_ms": 1790000000000,
"started_at_epoch": 1789999815.2,
"finished_at_epoch": 1789999999.4,
"duration_ms": 184213,
"last_error": "kaniko kubernetes_native wait failed: ..."
}
Read failure_category first, then last_error, which carries the job's or
kubectl's own message.