Artifact (kind: artifact)
A pinnable, named reference to something external strata doesn’t fetch or deploy itself — a
container image today, possibly other identifiers later. Referenced by identity from anywhere in
the solution: an ${artifact:NAME.FIELD} token in any field strata resolves at deploy, a
store: artifact variable (to hand a Terraform root a variable), or a module service’s artifact
field (see module).
Schema
spec.image_name— the full path the runtime pulls, registry host included (e.g.ghcr.io/example/scheduler-api; no host means Docker Hub) — identity, never overridden by aversionpinspec.image_tag— what to deploy, in one of three shapes (see Tag and digest); optional, omit it when aversionpin always supplies it. Overridden bykind: version’sspec.pins.artifacts[name]when set; with neither, the tag is blankspec.registry— free-text registry (host, and a feed or project path if it has one), documentation only — not a remote reference (strata never fetches an image; the runtime pulls it at deploy time). It is not added to the image reference. When the two name different registries,strata validategives information (artifact_registry_mismatch, never a warning, so--strictpasses):where
image_nameis pulled as written (a Compose service), it must hold the full reference, registry included; animage_namewith no host is pulled from Docker Hub;where a consumer adds its own registry, a host-less path is right: a Terraform root that imports the image into a per-deployment registry, or a chart with its own
image.registry
spec.integration— names an existingintegrationthat holds the registry’s credentials.strata deploy imagesreports it per image (INTEGRATION,data.images[].integration), so a pipeline that copies the image knows which credentials to use. Strata resolves nothing from it and never logs in: supply the credentials to whatever pulls or copies the image (your pipeline, the runtime)spec.properties/spec.configuration/spec.custom— free-form/passthrough data, never merged and never read by strata. Reach a literal field from another document’s string with${value:artifact.<name>.spec.configuration.<key>}.spec.image_nameandspec.image_tagcannot be read that way (value_reference_pinnable_field): use the${artifact:NAME.FIELD}token below
Example
apiVersion: strata.huybrechts.xyz/v2
kind: artifact
meta:
name: scheduler-api
spec:
image_name: cdn-feeds.acme.com/example/scheduler-api
image_tag: "1.4.2"
registry: cdn-feeds.acme.com
Tag and digest
spec.image_tag, and a pin under pins.artifacts, take one of three shapes:
Value |
Image reference |
|---|---|
|
|
|
|
|
|
A tag is letters, digits,
_,.and-, at most 128 characters, not starting with.or-. A digest is an algorithm,:and at least 32 lowercase hex characters.Anything else fails: an artifact’s
image_tagwhen the document loads, a pin instrata validate(artifact_tag_invalid), andstrata version set NAME artifacts TARGET VALUEbefore it writes the file.Pin both together. One string moves the tag and the digest at once, so they cannot drift apart.
strata deploy imagesshows the digest in aDIGESTcolumn (data.images[].image_digest);image_tagthere is the tag part only.image_tag_policyjudges the tag part, andrequire_digestfails an image with no digest (workspace).
The ${artifact:NAME.FIELD} token
Read an artifact directly, with no variable to declare:
Token |
Value |
|---|---|
|
|
|
the whole value after the deployment’s |
|
the image reference built from both, as in the table above, or just |
|
the tag part of |
|
the digest part ( |
# A Helm module: the chart's own keys, the pinned values
spec:
configuration:
image:
repository: "${artifact:scheduler-api.image_name}"
tag: "${artifact:scheduler-api.image_tag}"
For a Helm module this is how an artifact becomes the image that runs: strata writes no image into a chart’s values, so a service’s
artifactalone is only declared (strata validatewarns,artifact_not_delivered). Use the chart’s own keys, as above (the module’s or a service’sconfiguration); a token in a service’senvironmentonly sets an environment variable, sostrata validateanddeploy imagesboth call the artifact not delivered. For a Compose module the service’sartifactis enough.It resolves at deploy, in every field a
${var:}token resolves in: a Terraform payload or backend, Helm values, a Compose file, a script’s arguments.--pin NAMEondeploy runpicks the version, as for every other pin.${artifact:NAME.image_tag}on an artifact with noimage_tagand no pin for the deployment is an error (unavailable_artifact_token), never an empty tag. So isimage_tag_nameorimage_digestwhen the value has no such part: a chart that takesimage.digestneeds the pin to carry one. An unknown artifact or field isunknown_artifact_token.strata validatejudges both per deployment, anddeploy runstops on them before the step’s tool runs.An environment store’s own
valuecannot use it: a store value is resolved before a deployment is chosen.Write
$${artifact:...}for a literal.
A store: artifact variable
To hand the value to a Terraform root as a variable (strata.variables and TF_VAR_<key>), or to
override it per environment, declare a variable. field is required: image_name, image_tag (with
any version pin applied; "" when there is no tag), image_ref, image_tag_name or
image_digest (each "" when the value has no such part):
variables:
- key: SCHEDULER_API_IMAGE_TAG
store: artifact
value: scheduler-api
field: image_tag
The pinned tag is also what a build writes to strata.variables.
A declared variable only counts as using the artifact when the deployment can receive it: a ${var:KEY}
token in a document it reaches, or an execution step that gets every variable (Terraform, which reads
strata.variables and TF_VAR_<key>; a script without script.values; an output.template that reads it).
A variable nothing receives does not make deploy images or image_tag_policy list the artifact.
An artifact that no deployment uses in any of these ways is reported by strata validate
(artifact_unused):
a warning (
--strictfails on it) when no document names it at all: nostore: artifactvariable, no module serviceartifact, no${artifact:}token and nopins.artifactsentry. That is a leftover or a mistyped name, andstrata version updatedoes not offer a pin for it;information when a document names it but no deployment reaches that document yet: an image staged before its first deployment, for example a
store: artifactvariable in an environment no deployment lists yet.strata version updateoffers its pin as usual.
Every way of reaching an artifact counts as using it: strata deploy images lists the artifact with each use in
via (variable:KEY, service:MODULE/SERVICE, or token:KIND/NAME for the document holding an
${artifact:} token), and so the SBOM, the image gates and image_tag_policy judge it.
To see which images a deployment runs, with the tag after the pin and where it came from, run
strata deploy images DEPLOYMENT [--pin NAME] -o json. It reads the solution only (no build, no
store, no secret), so a pipeline can use it to copy the images to a registry before deploy run. The
same list feeds the SBOM and the audit manifest.
Notes
Deliberately not built on
SourceModeldespite the surface similarity to its chart mode — a remote’sfetchdescribes who materializes bytes on disk, and strata never fetches a container image (the registry pulls it at deploy time, not strata at build time).No chart mode: a chart pin already targets a real
moduledocument’s ownspec.source.chart_version— fully served by the existing mechanism, not a gap this kind covers.