nemo_gym.sandbox.providers.local.provider

View as Markdown

Module Contents

Classes

NameDescription
LocalProviderRuns commands on the host. No isolation: use a container provider for untrusted code.

Data

LOGGER

REAP_TIMEOUT_S

SANDBOX_RUNTIME_RETURN_CODE

API

class nemo_gym.sandbox.providers.local.provider.LocalProvider(
workspace_root: str | None = None,
shell: str = '/bin/bash',
default_timeout_s: float = 180.0,
concurrency: int = 8
)

Runs commands on the host. No isolation: use a container provider for untrusted code.

_semaphore
_semaphores
dict[int, Semaphore] = {}
_workspace_root
name
= 'local'
nemo_gym.sandbox.providers.local.provider.LocalProvider.aclose() -> None
async
nemo_gym.sandbox.providers.local.provider.LocalProvider.close(
) -> None
async
nemo_gym.sandbox.providers.local.provider.LocalProvider.create(
async

A caller-supplied workdir is theirs to keep. One we allocate is ours to delete.

nemo_gym.sandbox.providers.local.provider.LocalProvider.download_file(
source_path: str,
target_path: pathlib.Path
) -> None
async
nemo_gym.sandbox.providers.local.provider.LocalProvider.exec(
command: str,
cwd: str | None = None,
env: dict[str, str] | None = None,
timeout_s: int | float | None = None,
user: str | int | None = None
async

Own session, so a timeout kills the whole process tree.

nemo_gym.sandbox.providers.local.provider.LocalProvider.status(
async
nemo_gym.sandbox.providers.local.provider.LocalProvider.upload_file(
source_path: pathlib.Path,
target_path: str
) -> None
async
nemo_gym.sandbox.providers.local.provider.LOGGER = logging.getLogger(__name__)
nemo_gym.sandbox.providers.local.provider.REAP_TIMEOUT_S = 5.0
nemo_gym.sandbox.providers.local.provider.SANDBOX_RUNTIME_RETURN_CODE = 125