Skip to content

Add Docker workflows for GPU training, serving and offline deployment - #25

Open
KraHsu wants to merge 14 commits into
mainfrom
docker/open-source-support
Open

Add Docker workflows for GPU training, serving and offline deployment#25
KraHsu wants to merge 14 commits into
mainfrom
docker/open-source-support

Conversation

@KraHsu

@KraHsu KraHsu commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

OpenWAM currently requires a manually prepared Python/CUDA environment. This adds a pinned CUDA 12.8, Python 3.12 and PyTorch 2.7.1 image for serving, training and source development, plus offline delivery to GPU hosts without internet access.

Changes

  • Add Compose services for serving, training, development and GPU checks, with loopback serving by default and optional host networking. Make and Compose share image selection through .env, environment variables and Compose overrides.
  • Run as the selected host UID/GID with a persistent writable home and caches. Development overlays preserve source edits, outputs and linked Git worktrees; optional CUDA compatibility libraries work consistently in the main process, docker exec and after container restarts.
  • Export images with their frozen configuration, standalone importer and checksums. Bare repository names select only :latest; digest and image-ID selections receive content-derived delivery tags that survive offline loading. Weights and datasets are transferred separately.
  • Add Docker build/CPU CI, real container regression tests, a task-oriented Docker guide, troubleshooting instructions and acceptance records.

Validation

  • Rebuilt the final implementation as openwam:digest-compat-fixes.
  • make docker-check: dependency, serve CLI and Ruff checks passed; 1,972 CPU tests passed, 12 skipped and 21 deselected.
  • make docker-integration-check PYTHON=python3: 11 tests passed, including digest export/load after shutting down the source registry, Compose creation from the delivered bundle, worktree Git operations, arbitrary runtime IDs and CUDA library selection across run, exec and restart.
  • Additional checks passed for the older bundled importer, disabled CUDA compatibility with a missing compatibility directory, actionlint and Bash syntax.
  • Remote validation for the pushed head: Docker build and tests.

Earlier H100 acceptance covers released-checkpoint inference and four-GPU training/recovery through steps 1–20. That GPU run predates the final runtime/export fixes; current-head GPU training, multi-node/RDMA and optional Cosmos GPU behavior have not been revalidated.

Provide a locked CUDA 12.8 image, runtime UID mapping, persistent caches and outputs, GPU smoke checks, and serving/training/development/worktree configurations. Preserve training signal delivery and configured inference endpoints.
Resolve Make image selection through the effective Compose configuration and export versioned bundles with image-bound configuration and integrity checks. Document complete online/offline workflows and cover image overrides, mounts, worktrees, runtime identities and bundle delivery.
Build and load the linux/amd64 image in GitHub Actions, validate Compose profiles, run container CPU checks and exercise Docker integration workflows. Include Docker tooling in the standard lint job.
Record the offline H100 inference and training/resume acceptance, subsequent runtime and Compose checks, and the validation limits for each tested image revision.
Docker inspect defaults an untagged repository to latest, while Docker save
archives every tag in that repository. Resolve the default tag before saving
and record the same explicit reference in the bundle manifest and environment.
Preserve explicit tags, digests and image ID inputs, including registry ports.

Extend the real offline round-trip test with two distinct images in one local
repository and inspect the saved tar to ensure only the selected tag is present.
Cover reference forms in the CLI tests and document the default tag behavior.

Validation: the new integration regression fails before the fix (2 images
instead of 1). The rebuilt image passes make docker-check and
make docker-integration-check: 1970 CPU tests and 9 Docker integration tests.
Bind digest and image-ID exports to a content-derived local tag, preserve the source reference, and refuse conflicting delivery tags. Verify a real digest pull, export, offline load, and Compose creation using a temporary loopback registry; cover stable tags and collisions in CLI tests.
Put a private per-container compatibility directory on the image's library
search path. The non-root bootstrap atomically selects the opt-in CUDA
libraries there, so the entrypoint, docker exec, and restarted processes use
the same loader configuration. Leave the directory inactive by default and
report missing compatibility libraries before starting the requested command.

Document recreation after changing the setting. The real regression checks
enabled and disabled modes, arbitrary UID/GID, exec, restart, and missing
libraries; it fails against the previous image at the exec comparison.

Validation: the rebuilt CUDA image passes make docker-check and
make docker-integration-check (1972 CPU tests and 11 integration tests),
including the separate digest bundle fix and offline Compose creation.
Group Compose overlays, Make targets, build exclusions and tests under docker/. Consolidate four guides into usage and revision-scoped validation documents. Preserve the root Compose entrypoint and schema 2 offline compatibility while adopting the schema 3 bundle layout.

Clarify upgrade and GPU-shell training workflows, reject malformed manifests cleanly, isolate test configuration and keep help available with legacy image settings. Validation includes 49 current tool tests and 12 Docker integration checks; the preceding review image passed 1,984 CPU tests.
Replace the standalone lock script with make docker-lock, preserving dependency versions and selecting the effective Compose image. Update documentation and cover image selection and upgrade arguments in the existing integration test.
Keep the tested GPU revision, key results, resource measurements and limitations alongside the later CPU review results. Remove repeated iteration logs and reproduction instructions already covered by the usage guide.

@d-finite d-finite left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review summary

I reviewed PR #25 from an isolated worktree and checked the Docker, Compose, offline bundle, CI, runtime-user, and documentation changes.

Validation

  • Full non-GPU suite in the isolated environment: 2029 passed, 12 skipped, 22 deselected.
  • Docker tool tests: 49 passed.
  • Ruff, Python compilation, and Bash syntax checks passed.
  • The failed run 34624371754 was traced to tests/dataloader/test_exclusion_io.py: the lock-contender subprocess imported the full OpenWAM dataloader stack and did not create its ready marker within the five-second startup window. The Docker image build itself succeeded and 1,989 other tests passed.
  • Commit eb087aa fixes that race by loading only exclusion_io.py in the contender and using a 30-second, failure-diagnostic wait. The targeted regression test and Ruff pass locally; the latest standard GitHub tests are green.

Non-blocking findings

  1. Offline bundle verification can accept stale extra Compose files. docker/offline.py verifies the manifest-listed files but does not reject unexpected files such as an old compose.override.yaml or .env. Running docker compose up in a reused bundle directory can therefore apply configuration outside the verified bundle. The guide warns users to use a fresh directory, but the importer could enforce this more safely by rejecting unexpected Compose overrides or requiring an explicit compose file.

  2. The Debian packages in docker/Dockerfile are not version-pinned. CUDA and Python dependencies are pinned, but apt-get install python3 ... resolves current repository versions. Rebuilding the same source later can therefore produce a different system layer. A Debian snapshot or recorded package versions would improve reproducibility.

Recommendation

I found no blocking execution defect in the PR after the eb087aa test fix. The Docker layout and task-oriented guide are clear and maintainable. The two items above are follow-up improvements rather than merge blockers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants