Skip to content

Conversation

@wukaixingxp
Copy link
Contributor

Summary

This PR adds the Julia Environment (julia_env) to OpenEnv with all required files. The Julia Environment enables RL training with Julia programming tasks, including code execution, test result tracking, and reward calculation. This julia env derived from on this julia branch.

What's New

Core Files Added

  • src/envs/julia_env/README.md - Comprehensive documentation with quick start guide, environment details, and usage examples

  • src/envs/julia_env/openenv.yaml - Environment specification for deployment

  • src/envs/julia_env/pyproject.toml - Package metadata, dependencies, and build configuration

  • src/envs/julia_env/server/requirements.txt - Python dependencies for Docker container

  • src/core/tools/julia_executor.py - Julia code executor with process pooling support

  • 📝 src/core/tools/__init__.py - Exported JuliaExecutor class

  • src/envs/julia_env/server/app.py - Added main() entry point for pyproject.toml

  • src/envs/julia_env/server/Dockerfile - Fixed CMD and added requirements.txt installation

Technical Details

Environment Features

  • Julia Code Execution: Runs Julia 1.10 code in isolated subprocess
  • Test Result Tracking: Parses Julia Test module output (@test statements)
  • Reward Calculation: Calculates rewards based on code compilation and test results
  • Process Pooling: Optional process pool for concurrent execution (64 workers)
  • Request Queuing: Backpressure management with 100-request queue limit

Architecture

  • Server: FastAPI with async execution and request queuing
  • Client: HTTPEnvClient with 180s default timeout for Julia compilation
  • Docker: Multi-stage build with Julia 1.10 via juliaup
  • Deployment: Supports both local Docker and Hugging Face Spaces

Testing

All Docker builds and runtime tests pass successfully:

Build Test

docker build -t openenv-base:latest -f src/core/containers/images/Dockerfile .
docker build -t julia-env:latest -f src/envs/julia_env/server/Dockerfile .

✅ Image builds successfully with Julia 1.10 and all dependencies

Runtime Test

docker run -d -p 8000:8000 --name julia-env julia-env:latest

✅ Container starts with 4 workers and 64-worker Julia process pool

Endpoint Tests

# Health check
curl http://localhost:8000/health

# Execute Julia code
curl -X POST http://localhost:8000/step \
  -H "Content-Type: application/json" \
  -d '{"action":{"core_code":"println(2+2)","test_code":""}}'
# Returns: {"observation":{"stdout":"4\n","exit_code":0},"reward":2}

✅ All endpoints functional, Julia code executes successfully

Impact

  • Documentation: Users can now find julia_env in the OpenEnv ecosystem
  • Compatibility: Fully compatible with torchforge, TRL, and other RL frameworks

Checklist

  • All required files created (README.md, openenv.yaml, pyproject.toml)
  • Docker build tested and passing
  • Container runtime tested and passing
  • Endpoints tested and working
  • Julia code execution verified
  • Documentation complete

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Dec 11, 2025
@wukaixingxp wukaixingxp marked this pull request as ready for review December 11, 2025 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant