Add Docker virtual environments for reproducible development#14
Open
supmo668 wants to merge 3 commits into
Open
Add Docker virtual environments for reproducible development#14supmo668 wants to merge 3 commits into
supmo668 wants to merge 3 commits into
Conversation
7ba91ac to
9542a57
Compare
Author
Test ResultsAll validation tests pass. The Docker setup is safe for running alongside existing agent environments.
|
Introduce containerized development environments that ensure consistent setup across machines. This eliminates "works on my machine" issues and simplifies onboarding. What's included: - docker/base.Dockerfile: CUDA 12.4 + PyTorch 2.4 + flash-attn - docker/train.Dockerfile: Full RL training environment - docker/scripts.Dockerfile: Model merging utilities - Dockerfile.eval: Lightweight evaluation runner - docker-compose.yml: Service orchestration with profiles Key design decisions: - Multi-stage builds reduce final image size - Profile-based services (train/eval/env) for flexibility - GPU resources allocated via nvidia runtime - Volume mounts for models/checkpoints (not baked into image)
Provide convenient commands and configuration to streamline the Docker-based development experience. Makefile targets: - docker-build-*: Build individual or all images - docker-train-shell: Interactive training environment - docker-status: Quick health check of containers/images - test-docker: Validate setup without building .env.example: - Template for required environment variables - Includes API keys, ports, model settings .dockerignore: - Excludes checkpoints, caches, and large data - Keeps build context small for faster builds
Comprehensive guide for using the Docker infrastructure, written for both new contributors and experienced users. Contents: - Quick start (build → run → develop) - Image descriptions and when to use each - Common workflows (training, model merging, evaluation) - Environment variable reference - Troubleshooting common issues - CI/CD integration patterns
9542a57 to
514f2bc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR introduces Docker-based development environments to solve the reproducibility problem in AgentGym-RL. Currently, setting up the training environment requires careful manual configuration of CUDA, PyTorch, flash-attention, and various dependencies—a process that's error-prone and time-consuming.
With this change, contributors can get a working environment with:
What's Changed
1. Docker Infrastructure
Three purpose-built images that layer on each other:
agentgym-rl/baseagentgym-rl/trainagentgym-rl/scriptsagentgym/eval2. Service Orchestration
docker-compose.ymlwith profile-based services:3. Developer Tooling
make docker-build,make docker-train-shell)4. Documentation
DOCKER.mdcovers quick start, common workflows, and troubleshooting.Design Decisions
Why separate images? The base image with CUDA/PyTorch is large (~15GB). By layering, we can rebuild train/scripts quickly when only code changes.
Why profiles? Not everyone needs all services.
docker compose --profile train upstarts only what's needed.Why volume mounts for models? Baking large model files into images would make them huge and slow to transfer. Mounts are more flexible.
Testing
Commits
Checklist