nemo_gym.sandbox.providers.utils

View as Markdown

Helpers shared by the built-in sandbox providers.

These were previously duplicated verbatim across the enroot, apptainer, and opensandbox providers. They live here so there is a single implementation.

Module Contents

Functions

NameDescription
coerce_configAccept either a config dataclass instance or a plain mapping (Hydra YAML).
path_under_mountIf path is inside the mount, return its path relative to the mount; else None.

API

nemo_gym.sandbox.providers.utils.coerce_config(
value: typing.Any,
config_cls: type[typing.Any]
) -> typing.Any

Accept either a config dataclass instance or a plain mapping (Hydra YAML).

nemo_gym.sandbox.providers.utils.path_under_mount(
mount_point: str,
path: str
) -> str | None

If path is inside the mount, return its path relative to the mount; else None.