-
Notifications
You must be signed in to change notification settings - Fork 116
Description
Hi! I noticed there is currently a build error, here is a suggested fix.
Failure reason (from the logs)
- The pip install step fails while preparing metadata for chess (a dependency of textarena). The error is:
"ERROR: Can not executesetup.pysince setuptools is not available in the build environment." - In short: the build environment is missing setuptools (and wheel). pip is trying to build a source distribution that runs setup.py and fails because setuptools isn't installed in the isolated build environment.
Fix (short)
- Ensure pip, setuptools and wheel are installed/upgraded in the image before running pip install for your project dependencies. Add a step that upgrades pip/setuptools/wheel prior to any pip install -r ... or prior to the uv pip install step in the builder image.
Concrete code changes to apply
- Update the base/builder Dockerfile (so uv/pyproject installs run with setuptools available) and any env-specific Dockerfiles that run pip install -r requirements.txt.
Example patch suggestions:
- src/core/containers/images/Dockerfile (builder stage)
- Current file: https://github.com/meta-pytorch/OpenEnv/blob/28b6c8153d4729bbc5c61bd8483e2914e888d26d/src/core/containers/images/Dockerfile
- Replace the single uv install line with an upgrade-first approach:
Before
RUN --mount=type=cache,target=/root/.cache/uv
uv pip install --system -r pyproject.toml
After
RUN --mount=type=cache,target=/root/.cache/uv
# Ensure pip, setuptools and wheel exist in the build environment
uv pip install --system --upgrade pip setuptools wheel &&
uv pip install --system -r pyproject.toml
- src/envs/atari_env/server/Dockerfile
- Current file: https://github.com/meta-pytorch/OpenEnv/blob/28b6c8153d4729bbc5c61bd8483e2914e888d26d/src/envs/atari_env/server/Dockerfile
- Replace the pip install line to upgrade build tools first.
Before
COPY src/envs/atari_env/server/requirements.txt /tmp/requirements.txt
RUN pip install --no-cache-dir -r /tmp/requirements.txt && rm /tmp/requirements.txt
After
COPY src/envs/atari_env/server/requirements.txt /tmp/requirements.txt
RUN pip install --no-cache-dir --upgrade pip setuptools wheel &&
pip install --no-cache-dir -r /tmp/requirements.txt && rm /tmp/requirements.txt
- src/envs/browsergym_env/server/Dockerfile
- Current file: https://github.com/meta-pytorch/OpenEnv/blob/28b6c8153d4729bbc5c61bd8483e2914e888d26d/src/envs/browsergym_env/server/Dockerfile
- Update the browsergym requirements install the same way:
Before
COPY src/envs/browsergym_env/server/requirements.txt /tmp/browsergym_requirements.txt
RUN pip install --no-cache-dir -r /tmp/browsergym_requirements.txt &&
rm /tmp/browsergym_requirements.txt
After
COPY src/envs/browsergym_env/server/requirements.txt /tmp/browsergym_requirements.txt
RUN pip install --no-cache-dir --upgrade pip setuptools wheel &&
pip install --no-cache-dir -r /tmp/browsergym_requirements.txt &&
rm /tmp/browsergym_requirements.txt
Notes and alternatives
- Upgrading pip/setuptools/wheel first is the lowest friction fix and addresses the "setup.py requires setuptools" failure.
- If you prefer not to modify images, you can also:
- Add a top-level RUN pip install --upgrade pip setuptools wheel in the Dockerfile right before any pip install command that triggers the error.
- Pin textarena (or its transitive dependency chess) to a version that provides a binary wheel for the target platform, avoiding source builds.
- Add a pyproject/build-system dependency for any in-repo packages that require build-time setuptools (if applicable).
- If packages require compilation, you may also need apt build dependencies (build-essential, python3-dev, etc.). The current failure is specifically missing setuptools so start with the steps above.
How to validate locally / in CI
-
Rebuild the failing image locally to confirm:
docker build -f src/core/containers/images/Dockerfile -t openenv-base:fix .
docker build -f src/envs/atari_env/server/Dockerfile -t atari-env:fix . -
Re-run the GitHub Actions workflow after pushing the Dockerfile changes.
Suggested commit message
- "docker: ensure pip/setuptools/wheel are installed before installing dependencies to fix build isolation errors"
References (files edited)
- src/core/containers/images/Dockerfile (ref: 28b6c81)
https://github.com/meta-pytorch/OpenEnv/blob/28b6c8153d4729bbc5c61bd8483e2914e888d26d/src/core/containers/images/Dockerfile - src/envs/atari_env/server/Dockerfile (ref: 28b6c81)
https://github.com/meta-pytorch/OpenEnv/blob/28b6c8153d4729bbc5c61bd8483e2914e888d26d/src/envs/atari_env/server/Dockerfile - src/envs/browsergym_env/server/Dockerfile (ref: 28b6c81)
https://github.com/meta-pytorch/OpenEnv/blob/28b6c8153d4729bbc5c61bd8483e2914e888d26d/src/envs/browsergym_env/server/Dockerfile
This change should resolve the metadata-generation-failed / setuptools missing error seen in the logs.