Registry adapter runtime¶
A node reads from and writes to your registry on behalf of builds, releases and
closures, and every one of those operations names a registry host, a repository
and a tag or digest. The registry adapter applies one set of rules to those
references, so a pull, a push and a blob transfer are all held to your
registry's endpoint and repository root and to the host policy the contract
carries. The adapter's provider set is oci: the node speaks the OCI
distribution API. This page covers the reference rules for pull and publish,
the check the node makes on a finished push, and the blob requests it sends.
What the node does in your registry¶
flowchart TB
subgraph REG["YOUR REGISTRY, endpoint"]
direction LR
subgraph ROOT["repository_root"]
direction TB
PKG[("packages/package/releases/version<br/>package archives")]
DC[("xck/dependency-components/digest<br/>dependency components")]
IMG[("Build repositories<br/>model and project images")]
end
SRC[("Other hosts<br/>base and tool images")]
end
subgraph NODE["NODE"]
direction LR
BLD["Build<br/>push, then publish check"]
CB["Component builder<br/>blob upload"]
MAT["Closure materialization<br/>blob fetch"]
BPL["Build<br/>pull targets"]
end
BLD ==>|"image push"| IMG
CB ==>|"HEAD, POST, PUT"| DC
MAT -->|"GET by digest"| PKG
MAT -->|"GET by digest"| DC
BPL -.->|"host policy"| SRC
Every write lands under repository_root, and a closure reads only from under
it. A build's input images may come from other hosts, subject to the
contract's allowed and denied hosts. Package archives reach packages/
through the publish workflow; see
Artifact registry and blob references.
Pull targets¶
For each pull target the adapter parses the reference, reconciles it with any
resolved_digest_ref, applies the host policy, and applies the tag policy. The
steps and their refusals are on
Artifact pull and resolution.
Publish references¶
When a build finishes, the node checks the image it pushed against the build's publish contract before it reports a publication. The adapter first checks the two references:
- The contract's
source_image_refparses and carries a tag. - The builder's
image_refparses, together with itsimage_digest. - Neither host is on the denied list, and both are on the allowed list when one is given.
- Both hosts equal the tenant artifact runtime's
endpoint. - The output repository equals
repository_rootor sits below it.
The node then checks the publication itself:
- The source and output name the same host and repository.
- The source tag, and the output tag when there is one, are in the contract's
immutable_tags, and the two tags are equal. - The builder reported an image digest.
- A moving alias the builder promoted is accepted only when the contract's
promotion policy sets
promote_alias_after_immutable_success.
A publication that passes is recorded as
build.artifact_publish_runtime_evidence.v1 in the build's result under
artifact_publish_evidence:
{
"contract_version": "build.artifact_publish_runtime_evidence.v1",
"publish_contract_version": "build.artifact_publish_contract.v1",
"policy_version": "build.artifact_publish_contract.v1",
"status": "succeeded",
"repository": "acme-prod/xratu/models/ranker",
"image_repository_ref": "registry.example.com/acme-prod/xratu/models/ranker",
"source_image_ref": "registry.example.com/acme-prod/xratu/models/ranker:v1.4.0",
"published_ref": "registry.example.com/acme-prod/xratu/models/ranker:v1.4.0",
"published_digest": "sha256:9c3e...",
"pushed_immutable_tags": ["v1.4.0"],
"promoted_alias_tags": [],
"publish_attempts": 1,
"latency_ms": 0,
"failure_reason_code": "",
"reason_codes": []
}
published_digest is the value the control plane pins for the release.
promoted_alias_tags lists only aliases the policy allowed.
When a publication is refused¶
Every refusal carries code INVALID_ARGUMENT and a message that starts with
the reason:
| Reason | Condition |
|---|---|
invalid_publish_contract |
The contract is missing, has another version, lacks source image references, or has no immutable_tags |
invalid_execution_result |
The builder's result has another version, or lacks image_ref or a sha256: image_digest |
tenant_artifact_runtime_invalid |
The contract's tenant artifact runtime lacks endpoint or repository_root |
publish_source_invalid |
The source reference does not parse or has no tag |
publish_output_invalid |
The output reference does not parse, or its repository is outside repository_root |
publish_registry_forbidden |
A host is denied, outside the allowed list, or other than the tenant endpoint |
source_image_mismatch |
The output names a different host or repository from the source |
immutable_tag_mismatch |
A tag is outside immutable_tags, or the output tag differs from the source tag |
digest_verification_failed |
No image digest was reported |
alias_promotion_blocked |
An alias was promoted and the policy does not allow promotion |
For the contract's fixed rules on digests and aliases, see Publish and pull contracts.
Blob requests¶
Closure materialization and the dependency component builder move blobs directly, with authorization headers issued for the node's build workload by your cloud provider. Each request has a 20-second limit.
Fetch. One request, by digest:
Upload. A dependency component is stored in its own repository,
<repository_root>/xck/dependency-components/<component digest hex>, with
media type application/vnd.xratu.xck.dependency-component.v1+tar:
HEAD https://<endpoint>/v2/<repository>/blobs/<blob_digest> 200 means already stored
POST https://<endpoint>/v2/<repository>/blobs/uploads/ expects 202 and a Location
PUT <Location>?digest=<blob_digest> expects 201
A blob already present is left as it is, so uploading the same component twice writes it once. The upload returns the component's immutable reference:
Any other status fails the request with runtime_artifact_registry_io_failed
and the status in the message:
registry blob fetch failed with status 401
registry upload creation failed with status 403: b'...'
registry upload finalization failed with status 400: b'...'
A 401 or 403 points at the node's registry permissions; see Tenant artifact runtime.