nemo_gym.orchestration.executors.kubernetes_script
nemo_gym.orchestration.executors.kubernetes_script
Renders the Kubernetes Job manifest for one benchmark.
v1 scope: single node, one Job per benchmark, one pod. Model/ray services become native sidecar
containers (initContainers with restartPolicy: Always, k8s >= 1.29) so kubelet enforces
start-before-driver ordering and readiness via probes, instead of the hand-rolled bash health-check
loop slurm_script.py needs on Slurm. The driver is the pod’s single regular container.
Module Contents
Functions
Data
API
Env a command benchmark gets in place of gym eval run arguments — mirrors
slurm_script.py’s _command_env, kept local to avoid coupling the two executor modules.
Kubernetes object/container names are RFC 1123 labels: lowercase alnum and ’-’ only, <=63
chars, must start/end alphanumeric. Gym service and benchmark names allow ’.’, ’_’ (e.g.
vllm_model, tau2.airline), which are valid there but rejected by the k8s API server, so
every name that becomes a k8s name goes through this first.
Preamble lines that write the resolved config / job manifest onto the mounted PVC.
Stands in for Connection.write_text (Slurm) / a ConfigMap (rejected — see kubernetes.py):
the k8s Job name is chosen before submission, so both files’ content is fully known up front
and can be embedded directly in the driver container’s own startup command.
Scale a Kubernetes memory quantity (“32Gi”) by an integer factor (“64Gi” for factor=2).