Skip to main content

rampgate-docker

Docker executor, exit classification and event watcher for rampgate.

Part of the rampgate monorepo.

from rampgate_docker import ContainerSpec, ContainerUsageMapper, DockerEventWatcher, DockerExecutor
from rampgate_nvml import NvmlProbe, pid_to_container_id

executor = DockerExecutor(lambda job, start: ContainerSpec("my-trainer:1", gpus="all"))
watcher = DockerEventWatcher(executor.client, clock, stop_reason=executor.stop_reason)
mapper = ContainerUsageMapper(executor.client, pid_to_container_id)
watcher.start()
while True:
    now = clock()
    for event in watcher.drain():                   # JobStarted / JobExited
        engine.apply(event)
    observed, processes = probe.sample(now)
    for event in [*observed, *mapper.map(processes, now)]:
        engine.observe(event)
    decision = engine.tick(now)
    executor.apply(decision.actions, {j: rt.job for j, rt in engine.state.jobs.items()})
  • DockerExecutor: Start removes containers of older attempts of the job, then creates and starts a container labelled rampgate.job_id / rampgate.attempt, with RAMPGATE_JOB_ID, RAMPGATE_ATTEMPT and RAMPGATE_RESUME in its environment. Stop runs container.stop(timeout=grace_s) on a worker thread.
  • classify_exit: OOMKilled, an OOM message in the log tail (CUDA out of memory, torch.OutOfMemoryError, …; configurable), or 137 under memory pressure → OOM; 0 → SUCCESS; 143/137 after a requested stop → PREEMPTED/CANCELLED; anything else → FAILURE. A script should exit 143 (not 0) when it stops on SIGTERM; 0 means the job finished.
  • DockerEventWatcher: follows Docker's event stream on a thread; drain() hands the events to the Engine's thread.
  • ContainerUsageMapper: probe process samples (e.g. from rampgate-nvml) → JobObserved per job, attempt and device. Usage outside managed containers is left to rampgate's foreign-usage accounting.

Metadata

Release files for rampgate-docker 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rampgate-docker 0.1.0
File Size Uploaded Provenance Actions
rampgate_docker-0.1.0.tar.gz 17.4 kB With provenance Details for rampgate_docker-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rampgate-docker 0.1.0
File Interpreter ABI Platform Actions
rampgate_docker-0.1.0-py3-none-any.whl Python 3 none any Details for rampgate_docker-0.1.0-py3-none-any.whl

Total release size: 32.6 kB

Release files / rampgate_docker-0.1.0.tar.gz

Download URL rampgate_docker-0.1.0.tar.gz
Size 17.4 kB
Tags Source
SHA-256 checksum
How to use checksums
85bf23a2d62c5f39fdad14c0e5e0d488089728c7375bdc992fe3ea17e4f1ea7a
BLAKE2b-256 checksum
How to use checksums
afaa90a60d2799870353c8d4d5dc0fb169d7f12cc710bac148af443a317698b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Release files / rampgate_docker-0.1.0-py3-none-any.whl

Download URL rampgate_docker-0.1.0-py3-none-any.whl
Size 15.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4ea697e1d6fb97bc4e7c144991c80f2b533b92a83d2b44cb62192e5aa55747e9
BLAKE2b-256 checksum
How to use checksums
26eb552cf3809bdf9a7d6ddd355bf57b7fc7eb702b48d1769cf8e6fce40b1467
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Security for rampgate-docker 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for rampgate_docker-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page