Skip to navigation

nemo_gym.orchestration.executors.git_ref

View as Markdown

Module Contents

Functions

NameDescription
_git-
_ref_exists-
validate_gym_install_refFail the submit early when driver.gym_install.ref cannot be found in repo.

Data

NEMO_GYM_SUBMIT_NO_REF_CHECK_ENV_VAR_NAME

_FULL_SHA

_GIT_ENV

_GIT_TIMEOUT_SECONDS

_HEX

logger

API

nemo_gym.orchestration.executors.git_ref._git(
args: str = (),
cwd: str | None = None
) -> subprocess.CompletedProcess
nemo_gym.orchestration.executors.git_ref._ref_exists(
repo: str,
ref: str
) -> bool
nemo_gym.orchestration.executors.git_ref.validate_gym_install_ref(
) -> None

Fail the submit early when driver.gym_install.ref cannot be found in repo.

A branch or tag is looked up with one git ls-remote, which transfers only ref names. A full commit hash that is not a branch/tag tip is probed with a depth-1, blob-less fetch. Any git failure (unreachable or nonexistent repo, auth, timeout, git missing) also fails the submit; set NEMO_GYM_SUBMIT_NO_REF_CHECK=true to skip the check.

nemo_gym.orchestration.executors.git_ref.NEMO_GYM_SUBMIT_NO_REF_CHECK_ENV_VAR_NAME = 'NEMO_GYM_SUBMIT_NO_REF_CHECK'
nemo_gym.orchestration.executors.git_ref._FULL_SHA = re.compile('[0-9a-f]{40}')
nemo_gym.orchestration.executors.git_ref._GIT_ENV = {None: os.environ, 'GIT_TERMINAL_PROMPT': '0', 'GIT_ASKPASS': 'true'}
nemo_gym.orchestration.executors.git_ref._GIT_TIMEOUT_SECONDS = 10
nemo_gym.orchestration.executors.git_ref._HEX = re.compile('[0-9a-f]{4,40}')
nemo_gym.orchestration.executors.git_ref.logger = logging.getLogger(__name__)