Skip to navigation

nemo_gym.tasks.harbor.scaffold

View as Markdown

gym dataset init: a dataset folder in exactly the shape the loader accepts.

One task, ready to validate and run. Everything written here is read back by the loader in a test, so the scaffold cannot drift from what gym eval run and gym dataset validate expect.

Module Contents

Functions

NameDescription
init_datasetWrite <root>/<name without org>/ with dataset.toml and one task folder; refuses to overwrite.
split_dataset_nameorg/name as Harbor 0.22.0 requires it; a bare name gets DEFAULT_ORG.

Data

DATASET_TOML

DEFAULT_IMAGE

DEFAULT_ORG

INSTRUCTION_MD

SOLVE_SH

TASK_TOML

TEST_SH

_NAME_SEGMENT

API

nemo_gym.tasks.harbor.scaffold.init_dataset(
root: pathlib.Path,
name: str,
image: str = DEFAULT_IMAGE,
task: str = 'hello'
) -> pathlib.Path

Write <root>/<name without org>/ with dataset.toml and one task folder; refuses to overwrite.

name is org/name or a bare name, which is written as local/<name> so that Harbor accepts the manifest. The folder is the name without the org, as harbor task init does for a task.

nemo_gym.tasks.harbor.scaffold.split_dataset_name(
name: str
) -> tuple[str, str]

org/name as Harbor 0.22.0 requires it; a bare name gets DEFAULT_ORG.

Raises ValueError for a name Harbor’s manifest would reject, so nothing is written for it.

nemo_gym.tasks.harbor.scaffold.DATASET_TOML = '# Harbor\'s dataset file. The [dataset] table is Harbor\'s; the [gym] table is ...
nemo_gym.tasks.harbor.scaffold.DEFAULT_IMAGE = 'python:3.12-slim'
nemo_gym.tasks.harbor.scaffold.DEFAULT_ORG = 'local'
nemo_gym.tasks.harbor.scaffold.INSTRUCTION_MD = 'Create a file called `hello.txt` in the working directory containing the single...
nemo_gym.tasks.harbor.scaffold.SOLVE_SH = '#!/bin/bash\n# The reference solution `gym dataset validate` runs; it must scor...
nemo_gym.tasks.harbor.scaffold.TASK_TOML = 'schema_version = "1.4"\n\n[task]\nname = "{org}/{task}"\n\n[environment]\ndocke...
nemo_gym.tasks.harbor.scaffold.TEST_SH = '#!/bin/bash\n# Harbor\'s verifier contract: write the reward to /logs/verifier/...
nemo_gym.tasks.harbor.scaffold._NAME_SEGMENT = re.compile('^[a-zA-Z0-9][a-zA-Z0-9._-]*$')