Data Extension via —data
Data Extension via —data
Data Extension via —data
Extend AICR’s embedded recipe catalog with your own overlays, components, and criteria values at runtime — no fork, no rebuild. This is how operators add private/proprietary content (internal cloud providers, in-house GPU SKUs, commercial platforms, customer-specific scheduling) on top of the OSS catalog shipped with the binary.
The --data <dir> flag layers an external directory on top of the embedded
catalog. The embedded catalog is precedence-low; your directory is
precedence-high. Adding a file under the right path either supplements (for
catalog content) or overrides (for component files) the embedded equivalent.
The external directory mirrors AICR’s embedded recipes/ tree. Drop only the
paths you need; AICR loads any subset.
The loader walks the tree recursively (filepath.WalkDir), so subdirectories
inside overlays/ are supported and useful for organizing by service / customer
/ team:
registry.yaml is requiredEven if your directory only adds overlays (no new components), AICR requires a
registry.yaml at the root. The minimal stub is:
External components in this file are merged with the embedded registry; on name collision, the external definition wins.
Criteria value validation (service, accelerator, intent, os,
platform) is data-driven: the static OSS list is the fast path, and the
runtime criteria registry picks up any value declared in a loaded overlay’s
spec.criteria. So adding a new value to an overlay automatically makes it
a valid CLI / API input. No code change, no rebuild.
Example overlay for an internal NCP:
Run it:
Without --data, --service ncp-internal is rejected (the value isn’t in
the embedded catalog and the registry hasn’t been seeded). With --data
pointing at the overlay above, the registry registers ncp-internal at
catalog-load time and the CLI admits it.
The same applies to accelerator, intent, os, and platform — any
field on a RecipeMetadata’s spec.criteria.
registry.yaml declares the component’s identity and source:
…or, for a Kustomize-shipped component:
A values.yaml (Helm) or kustomization.yaml (Kustomize) at
components/<name>/ is picked up automatically.
Reference the component from an overlay’s componentRefs: to include it in
recipes that match the overlay’s criteria.
When in doubt, aicr --debug recipe ... --data <dir> logs the resolved source
(embedded / external / merged) for every loaded file.
--criteria-strict (or AICR_CRITERIA_STRICT=1, or
spec.recipe.criteriaStrict: true in --config) rejects any criteria value
not in the embedded OSS catalog, ignoring --data contributions entirely.
This is intended for CI gates in the OSS repo so the upstream catalog
cannot accidentally start depending on internal-only values during
development. Integrator workflows that legitimately need --data-supplied
values should leave it off.
make qualify in the OSS repo runs unit tests with AICR_CRITERIA_STRICT=1
exported automatically.
Use aicr --debug to inspect external-data discovery and per-file source
resolution:
Sample output (truncated):
Tab-completion for --service / --accelerator / --os / --intent /
--platform reflects values from the registry at the moment the help text is
rendered. Run with --data early in the command line to populate it before
shell completion kicks in.
Treat your --data directory like any other artifact: tag it (git tag, OCI
tag, semver) and pin which AICR binary version it was tested against. The
overlay schema is the AICR YAML schema; bumping AICR may add new optional
fields but rarely changes existing ones, so backward compatibility is the
default — but check the AICR release notes when you upgrade the binary.
Typical organization patterns:
--data catalog with
per-team subdirectories (overlays/team-a/, overlays/team-b/).aicr itself doesn’t care about source, only that the path
contains a registry.yaml and the expected sub-tree.--data, --criteria-strict, --debug flag definitions--data)