Skip to content

Standardize Environment Directory Structure #145

@rycerzes

Description

@rycerzes

This proposal aims to standardize directory and dependency management across all environments in OpenEnv, following patterns from prime-environments, while keeping the current client/server + Docker model.

Goal

Establish a consistent, modular structure with pyproject.toml as the single source of truth for dependencies, improving CI/CD and maintainability.

Current Issues

  • Some environments lack a requirements.txt
  • Dependencies are often hardcoded in Dockerfiles
  • Root and environment-level dependencies are mixed
    Example (current):
src/envs/{env_name}_env/
├── __init__.py
├── client.py
├── models.py
├── README.md
└── server/
    ├── app.py
    ├── Dockerfile  # installs deps inline
    ├── requirements.txt  # sometimes missing
    └── {env_name}_environment.py

Proposed

src/envs/{env_name}_env/
├── pyproject.toml           # dependencies here
├── README.md
├── __init__.py
├── client.py
├── models.py
├── outputs/                 # logs/evals (gitignored)
├── server/
│   ├── app.py
│   ├── Dockerfile
│   └── {env_name}_environment.py
└── [optional] utils/, rewards.py, build_docker.sh

Root:

OpenEnv/
├── pyproject.toml
├── uv.lock
└── src/envs/

Key Points

  • Each environment maintains its own pyproject.toml
  • requirements.txt is generated automatically during CI/Docker builds
  • Docker images install from the generated file, not inline
  • Standard outputs/ directory for logs/evals
  • Shared dev deps live in the root pyproject.toml

To be considered

  1. Should requirements.txt generation happen locally or only in CI?
  2. Should a shared openenv-core for common utilities be introduced?
  3. Should this structure be enforced via a template for new environments?

Example Workflow

uv sync --group dev
cd src/envs/atari_env
uv pip install -e .
uv pip compile pyproject.toml -o server/requirements.txt
docker build -t openenv-atari server/

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions