> This page is for version 0.5.0.
> For other versions, use one of these documentation indexes:
> - Main (default): https://docs.nvidia.com/nemo/gym/main/llms.txt
> - 0.7.0: https://docs.nvidia.com/nemo/gym/v0.7.0/llms.txt
> - 0.6.0: https://docs.nvidia.com/nemo/gym/v0.6.0/llms.txt
> - 0.5.1: https://docs.nvidia.com/nemo/gym/v0.5.1/llms.txt
> - 0.5.0: https://docs.nvidia.com/nemo/gym/v0.5.0/llms.txt
> - 0.4.0: https://docs.nvidia.com/nemo/gym/v0.4.0/llms.txt
> - 0.3.0: https://docs.nvidia.com/nemo/gym/v0.3.0/llms.txt
> - 0.2.1: https://docs.nvidia.com/nemo/gym/v0.2.1/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nemo/gym/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nemo/gym/_mcp/server.

# 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

| Name                                                                     | Description                                                                                      |
| ------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ |
| [`BuildOptions`](#nemo_gym-data-tasks-harbor-build_options-BuildOptions) | How prepare treats Dockerfiles outside pull and overlay mode: the `builds:` configuration block. |

### Functions

| Name                                                                                                     | Description                                                                                              |
| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
| [`_block_from_overrides`](#nemo_gym-data-tasks-harbor-build_options-_block_from_overrides)               | The `key` node (dotted) of the configuration the command names, resolved; a scalar as it is, `None` when |
| [`_build_setting`](#nemo_gym-data-tasks-harbor-build_options-_build_setting)                             | -                                                                                                        |
| [`_check_platform`](#nemo_gym-data-tasks-harbor-build_options-_check_platform)                           | Refuse a `platform` setting `platform_pair` refuses, where it enters.                                    |
| [`_merged_cli_config`](#nemo_gym-data-tasks-harbor-build_options-_merged_cli_config)                     | The configuration the command line names, merged but unresolved, before the run config exists.           |
| [`build_options_from_overrides`](#nemo_gym-data-tasks-harbor-build_options-build_options_from_overrides) | The `builds:` block of the configuration the command line names (see `_block_from_overrides`).           |

### Data

[`BUILDS_KEY`](#nemo_gym-data-tasks-harbor-build_options-BUILDS_KEY)

[`BUILD_SETTINGS`](#nemo_gym-data-tasks-harbor-build_options-BUILD_SETTINGS)

[`HYDRA_QUIET_OVERRIDES`](#nemo_gym-data-tasks-harbor-build_options-HYDRA_QUIET_OVERRIDES)

### API

```python
class nemo_gym.data.tasks.harbor.build_options.BuildOptions(
    enabled: bool = True,
    tool: str | None = None,
    repository: str | None = None,
    platform: str | None = None,
    force: bool = False
)
```

Dataclass

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.

**`enabled`** `bool = True`

---

**`force`** `bool = False`

---

**`platform`** `str | None = None`

---

**`repository`** `str | None = None`

---

**`tool`** `str | None = None`

---

```python
nemo_gym.data.tasks.harbor.build_options.BuildOptions.from_config(
    config: collections.abc.Mapping[str, typing.Any] | None
) -> nemo_gym.data.tasks.harbor.build_options.BuildOptions
```

classmethod

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.

```python
nemo_gym.data.tasks.harbor.build_options._block_from_overrides(
    overrides: list[str],
    key: str,
    config_files: collections.abc.Sequence[pathlib.Path] = ()
) -> typing.Any
```

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.

```python
nemo_gym.data.tasks.harbor.build_options._build_setting(
    block: collections.abc.Mapping[str, typing.Any],
    name: str
) -> str | None
```

```python
nemo_gym.data.tasks.harbor.build_options._check_platform(
    block: collections.abc.Mapping[str, typing.Any]
) -> None
```

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.

```python
nemo_gym.data.tasks.harbor.build_options._merged_cli_config(
    overrides: list[str],
    config_files: collections.abc.Sequence[pathlib.Path] = ()
) -> typing.Any
```

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.

```python
nemo_gym.data.tasks.harbor.build_options.build_options_from_overrides(
    overrides: list[str]
) -> nemo_gym.data.tasks.harbor.build_options.BuildOptions
```

The `builds:` block of the configuration the command line names (see `_block_from_overrides`).

```python
nemo_gym.data.tasks.harbor.build_options.BUILDS_KEY = 'builds'
```

```python
nemo_gym.data.tasks.harbor.build_options.BUILD_SETTINGS = ('tool', 'repository', 'platform', 'enabled', 'force')
```

```python
nemo_gym.data.tasks.harbor.build_options.HYDRA_QUIET_OVERRIDES = ('hydra.run.dir=.', 'hydra.output_subdir=null', 'hydra/job_logging=none', 'hydra...
```