> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.nvidia.com/nemo/gym/v0.5.0/nemo-gym/nemo_gym/tasks/harbor/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.tasks.harbor Read Harbor task folders and hub references into NeMo Gym materialized tasks. Harbor is the input format; Gym owns execution. A task is a folder holding `task.toml`, `instruction.md`, `environment/` and `tests/`. A dataset is a folder of task folders. `harbor:<dataset>[@<version>]` names a dataset in the Harbor registry, which this package fetches into Gym's shared datasets folder. ## Submodules * **[`nemo_gym.tasks.harbor.cli`](/nemo/gym/nemo-gym/nemo_gym/tasks/harbor/cli)** * **[`nemo_gym.tasks.harbor.digest`](/nemo/gym/nemo-gym/nemo_gym/tasks/harbor/digest)** * **[`nemo_gym.tasks.harbor.dockerfile`](/nemo/gym/nemo-gym/nemo_gym/tasks/harbor/dockerfile)** * **[`nemo_gym.tasks.harbor.hub`](/nemo/gym/nemo-gym/nemo_gym/tasks/harbor/hub)** * **[`nemo_gym.tasks.harbor.materialize`](/nemo/gym/nemo-gym/nemo_gym/tasks/harbor/materialize)** * **[`nemo_gym.tasks.harbor.models`](/nemo/gym/nemo-gym/nemo_gym/tasks/harbor/models)** * **[`nemo_gym.tasks.harbor.task`](/nemo/gym/nemo-gym/nemo_gym/tasks/harbor/task)** ## Package Contents ### Classes | Name | Description | | -------------------------------------------------------------------- | ------------------------------- | | [`HarborTask`](#nemo_gym-tasks-harbor-task-HarborTask) | A task folder read into memory. | | [`HarborTaskConfig`](#nemo_gym-tasks-harbor-models-HarborTaskConfig) | One `task.toml`. | ### Functions | Name | Description | | -------------------------------------------------------------- | ----------------------------------------------------------------------------------- | | [`content_hash`](#nemo_gym-tasks-harbor-digest-content_hash) | Digest the task folder at `path`. | | [`discover_tasks`](#nemo_gym-tasks-harbor-task-discover_tasks) | A folder with `task.toml` is one task; otherwise its direct children are the tasks. | | [`load_task`](#nemo_gym-tasks-harbor-task-load_task) | Read `path` as one task. Raises `HarborTaskError` when it is not one. | ### Data [`DIGEST_KEY`](#nemo_gym-tasks-harbor-digest-DIGEST_KEY) ### API ```python class nemo_gym.tasks.harbor.HarborTask( path: pathlib.Path, task_id: str, config: nemo_gym.tasks.harbor.models.HarborTaskConfig, instruction: str, digest: str, image: str | None, workdir: str | None, env: dict[str, str], user: str | None ) ``` Dataclass A task folder read into memory. `task_id` is the folder name: `[task].name` is an `org/name` label that is not unique across a dataset. `image` is the prebuilt image when the task declares one, else the base image of a base-image-only Dockerfile, else `None` (a build is required). Without a prebuilt image, `workdir`, `env` and `user` merge `task.toml` with what the Dockerfile recorded; `task.toml` wins. With a prebuilt image, the Dockerfile contributes no settings. **`config`** `HarborTaskConfig` --- **`digest`** `str` --- **`env`** `dict[str, str]` --- **`has_solution`** `bool` --- **`image`** `str | None` --- **`instruction`** `str` --- **`needs_sandbox`** `bool` A task runs in a sandbox exactly when it declares an image or a Dockerfile. --- **`path`** `Path` --- **`task_id`** `str` --- **`user`** `str | None` --- **`workdir`** `str | None` --- ```python class nemo_gym.tasks.harbor.HarborTaskConfig() ``` **Bases:** [HarborSettings](#nemo_gym-tasks-harbor-models-HarborSettings) One `task.toml`. **`agent`** `HarborAgent = Field(default_factory=HarborAgent)` --- **`artifacts`** `list[Any] = Field(default_factory=list)` --- **`deprecated_keys`** `frozenset[str]` --- **`environment`** `HarborEnvironment = Field(default_factory=HarborEnvironment)` --- **`is_shared_verifier`** `bool` Harbor runs the verifier in the agent's container unless a separate one is declared. --- **`metadata`** `dict[str, Any] = Field(default_factory=dict)` --- **`schema_version`** `str = '1.4'` --- **`solution`** `HarborSolution = Field(default_factory=HarborSolution)` --- **`source`** `str | None = None` --- **`task`** `dict[str, Any] = Field(default_factory=dict)` --- **`verifier`** `HarborVerifier = Field(default_factory=HarborVerifier)` --- ```python nemo_gym.tasks.harbor.HarborTaskConfig.read_deprecated_fields( data: typing.Any ) -> typing.Any ``` classmethod ```python nemo_gym.tasks.harbor.content_hash( path: pathlib.Path ) -> str ``` Digest the task folder at `path`. ```python nemo_gym.tasks.harbor.discover_tasks( root: pathlib.Path, skipped: dict[str, nemo_gym.tasks.harbor.task.HarborTaskError] | None = None ) -> list[nemo_gym.tasks.harbor.task.HarborTask] ``` A folder with `task.toml` is one task; otherwise its direct children are the tasks. With `skipped`, a child that fails to load is recorded there under its folder name and the others still load; without it the first failure raises. A root that is itself a task always raises. ```python nemo_gym.tasks.harbor.load_task( path: pathlib.Path ) -> nemo_gym.tasks.harbor.task.HarborTask ``` Read `path` as one task. Raises `HarborTaskError` when it is not one. ```python nemo_gym.tasks.harbor.digest.DIGEST_KEY = '_ng_digest' ``` ## Docs - [nemo_gym.tasks.harbor.cli](https://docs.nvidia.com/nemo/gym/v0.5.0/nemo-gym/nemo_gym/tasks/harbor/cli.md) - [nemo_gym.tasks.harbor.digest](https://docs.nvidia.com/nemo/gym/v0.5.0/nemo-gym/nemo_gym/tasks/harbor/digest.md) - [nemo_gym.tasks.harbor.dockerfile](https://docs.nvidia.com/nemo/gym/v0.5.0/nemo-gym/nemo_gym/tasks/harbor/dockerfile.md) - [nemo_gym.tasks.harbor.hub](https://docs.nvidia.com/nemo/gym/v0.5.0/nemo-gym/nemo_gym/tasks/harbor/hub.md) - [nemo_gym.tasks.harbor.materialize](https://docs.nvidia.com/nemo/gym/v0.5.0/nemo-gym/nemo_gym/tasks/harbor/materialize.md) - [nemo_gym.tasks.harbor.models](https://docs.nvidia.com/nemo/gym/v0.5.0/nemo-gym/nemo_gym/tasks/harbor/models.md) - [nemo_gym.tasks.harbor.task](https://docs.nvidia.com/nemo/gym/v0.5.0/nemo-gym/nemo_gym/tasks/harbor/task.md)