nemo_gym.data.tasks.harbor.build_options
nemo_gym.data.tasks.harbor.build_options
The builds table of the run configuration.
BuildOptions carries whether builds are enabled, which tool to use, the repository to push to and the platform to build for. It is read from a Hydra config mapping and, before the run config exists, from the command line overrides and env.yaml by a side-effect-free Hydra parse. The module depends on the build tool list, the repository variable and the platform parser only.
Module Contents
Classes
Functions
Data
API
How prepare treats Dockerfiles outside pull and overlay mode: the builds: configuration block.
tool builds them (buildah, podman or docker; default: the first one on PATH that fits, see
nemo_gym.data.tasks.harbor.image_build.detect_tool). repository is the registry path built
images are pushed under (default: the NEMO_GYM_BUILD_REPOSITORY variable; unset keeps them local
in the Docker daemon). platform is passed to the tool (default linux/amd64). With enabled
false nothing is built, and the tasks that need a build are skipped with the loader’s message. With
force, a task’s Dockerfile is built even when the task declares [environment].docker_image, as
Harbor’s --force-build does, and the task then runs the built image.
The builds: block of a merged configuration dict, applied over the defaults.
config is the merged global configuration (env.yaml, --config files and
++builds.<setting>=<value> overrides) or any dict shaped like it; a missing block keeps
every default. Unknown settings, values of the wrong type and a platform the records could not tell
from the baseline (an amd64 micro-architecture level above it, see _check_platform) are refused.
The key node (dotted) of the configuration the command names, resolved; a scalar as it is, None when
absent. Only that node’s own interpolations are evaluated, so a provider block’s credentials are not needed
to read a sibling key; a node that is configured but does not resolve (builds: ${missing_profile}) is
reported as a configuration error rather than read as absent. Merged as _merged_cli_config does.
Refuse a platform setting platform_pair refuses, where it enters.
An amd64 micro-architecture level above the baseline (linux/amd64/v3) is another platform to docker, but
the records keep an image’s os and architecture only, so a sidecar built for it (of a task whose main is
prebuilt, with no base image to record first) would be pushed and recorded as linux/amd64 and reused by a
later baseline run. ImageBuilder repeats the check for a BuildOptions made in code.
The configuration the command line names, merged but unresolved, before the run config exists.
The sources the user controls, in the global config’s order: config_files, then the files the
+config_paths tokens name (from --config and the asset selectors), then env.yaml, then the
+/++ overrides. Nothing is resolved here, so a provider block’s credentials are not needed to
read a sibling key. The full global config is still parsed once, at dispatch, with the run config added.
The builds: block of the configuration the command line names (see _block_from_overrides).