nemo_gym.agent_utils.process_supervisor
nemo_gym.agent_utils.process_supervisor
Standalone Linux process supervisor to upload beside a sandboxed harness.
Uses only the standard library; Gym need not be installed in the task sandbox. The receipt confirms termination independently of the harness result. On forced stop, newly adopted children are also drained, including tools in other sessions. Detached services adopted before stopping remain for verification. Natural exit only drains the harness group: orphaned services and unfinished detached tools cannot be distinguished without cooperation from the harness.
Module Contents
Classes
Functions
Data
API
Bases: typing.TypedDict
Outcome after bounded harness termination.
cleanup_confirmed means no live harness-group members remain. Forced
stops also drain newly adopted children. Previously adopted detached services
remain until the owner closes the sandbox; this is not a sandbox-empty check.
Read this single-threaded subreaper’s current children.
Drain the group and, on forced stop, newly adopted tools within one budget.
Stop the harness and forced-stop tools; preserve earlier detached services.
Reserve TERM grace, direct-process reaping, and process-group reaping.
The extra 30 seconds cover startup, polling, and receipt I/O beyond those bounded cleanup phases. Keep their count shared with the controller budget.
Run COMMAND and atomically write its cleanup receipt outside the task workdir.