Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions envs/browsergym_env/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -556,11 +556,8 @@ pytest tests/envs/test_browsergym_env.py

```bash
# Install in development mode
cd /path/to/OpenEnv
pip install -e .

# Install BrowserGym
pip install browsergym browsergym-miniwob browsergym-webarena
cd envs/browsergym_env
uv sync

# Run the server locally
cd envs/browsergym_env/server
Expand All @@ -581,8 +578,7 @@ browsergym_env/
├── __init__.py
├── app.py # FastAPI application
├── browsergym_environment.py # Environment implementation
├── Dockerfile # Container specification
└── requirements.txt # Python dependencies
└── Dockerfile # Container specification
```

## References
Expand Down
9 changes: 8 additions & 1 deletion envs/browsergym_env/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
name = "openenv-browsergym_env"
version = "0.1.0"
description = "BrowserGym Environment for OpenEnv - Web automation using Playwright"
requires-python = ">=3.10"
requires-python = ">=3.10,<3.13"
dependencies = [
"openenv-core[core]>=0.2.3",
"browsergym-core==0.14.3",
Expand All @@ -15,6 +15,7 @@ dependencies = [
"playwright==1.44.0",
"greenlet==3.0.3",
"Pillow>=10.0.0",
"chromium",
]

[project.optional-dependencies]
Expand All @@ -33,3 +34,9 @@ package-dir = { "browsergym_env" = ".", "browsergym_env.server" = "server" }

[tool.setuptools.package-data]
browsergym_env = ["**/*.yaml", "**/*.yml", "**/*.md"]

[tool.uv]
# libwebarena==0.0.4 (pulled in by browsergym-webarena>=0.13.1) pins beartype==0.12.0
# on Windows, conflicting with openenv-core's beartype>=0.20.0 requirement.
# Override to allow a compatible version on all platforms.
override-dependencies = ["beartype>=0.20.0"]
23 changes: 16 additions & 7 deletions envs/browsergym_env/server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Use the matching Playwright Python image for browsergym-core 0.14.3.
FROM mcr.microsoft.com/playwright/python:v1.44.0-jammy

# Set working directory
WORKDIR /app/env

# Install only the extra packages this env still needs on top of the Playwright image.
Expand All @@ -12,25 +11,35 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
&& rm -rf /var/lib/apt/lists/*

# Install uv
RUN curl -LsSf https://astral.sh/uv/install.sh | sh && \
mv /root/.local/bin/uv /usr/local/bin/uv && \
mv /root/.local/bin/uvx /usr/local/bin/uvx

# Copy environment files first (for better caching)
# Build context should be envs/browsergym_env/ (not server/ or repo root)
COPY . .

# Make start script executable
RUN chmod +x /app/env/server/start.sh

RUN pip install --no-cache-dir uv
RUN uv pip install --system --no-cache -e .

# Ensure the installed Playwright package has a matching Chromium runtime.
RUN python -m playwright install chromium
# Install Python dependencies using uv sync
RUN --mount=type=cache,target=/root/.cache/uv \
if [ -f uv.lock ]; then \
uv sync --frozen --no-editable; \
else \
uv sync --no-editable; \
fi

# Install MiniWoB++ from a pinned snapshot to avoid flaky Hub-time git clones.
ARG MINIWOB_COMMIT=7fd85d71a4b60325c6585396ec4f48377d049838
RUN mkdir -p /app/miniwob-plusplus && \
curl -L "https://github.com/Farama-Foundation/miniwob-plusplus/archive/${MINIWOB_COMMIT}.tar.gz" \
| tar -xz --strip-components=1 -C /app/miniwob-plusplus

# Set PATH to use the virtual environment
ENV PATH="/app/env/.venv/bin:$PATH"

# Set environment variables
ENV PYTHONUNBUFFERED=1
ENV BROWSERGYM_BENCHMARK=miniwob
Expand Down Expand Up @@ -60,7 +69,7 @@ EXPOSE 8888

# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=10s --retries=3 \
CMD curl -f http://localhost:8000/health || exit 1
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')" || exit 1

# Run the server using the start script
CMD ["/app/env/server/start.sh"]
484 changes: 28 additions & 456 deletions envs/browsergym_env/uv.lock

Large diffs are not rendered by default.

68 changes: 40 additions & 28 deletions envs/calendar_env/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,40 +1,52 @@
# Use Python 3.11 slim image as base
FROM python:3.11-slim
ARG BASE_IMAGE=ghcr.io/meta-pytorch/openenv-base:latest
FROM ${BASE_IMAGE} AS builder

ENV API_PORT=8004

# Set working directory
WORKDIR /app

# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PYTHONPATH=/app
ARG BUILD_MODE=in-repo

COPY . /app/env

WORKDIR /app/env

RUN if ! command -v uv >/dev/null 2>&1; then \
curl -LsSf https://astral.sh/uv/install.sh | sh && \
mv /root/.local/bin/uv /usr/local/bin/uv && \
mv /root/.local/bin/uvx /usr/local/bin/uvx; \
fi

# Install system dependencies
RUN apt-get update && apt-get install -y \
gcc \
&& rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
&& rm -rf /var/lib/apt/lists/*

# Copy requirements first for better caching
COPY requirements.txt .
RUN --mount=type=cache,target=/root/.cache/uv \
if [ -f uv.lock ]; then \
uv sync --frozen --no-install-project --no-editable; \
else \
uv sync --no-install-project --no-editable; \
fi

# Install Python dependencies
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
RUN --mount=type=cache,target=/root/.cache/uv \
if [ -f uv.lock ]; then \
uv sync --frozen --no-editable; \
else \
uv sync --no-editable; \
fi

# Copy application code
COPY . .
FROM ${BASE_IMAGE}

# Place seed database where the server expects it
COPY mcp_databases /app/mcp_databases
WORKDIR /app

COPY --from=builder /app/env/.venv /app/.venv
COPY --from=builder /app/env /app/env

ENV PATH="/app/.venv/bin:$PATH"
ENV PYTHONPATH="/app/env:$PYTHONPATH"
ENV API_PORT=8004

# Expose port 8004
EXPOSE 8004

# Health check
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
CMD python -c "import requests; requests.get('http://localhost:8004/health')" || exit 1
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:8004/health')" || exit 1

# Run the application
CMD ["uvicorn", "server.app:app", "--host", "0.0.0.0", "--port", "8004"]
CMD ["sh", "-c", "cd /app/env && uvicorn server.app:app --host 0.0.0.0 --port 8004"]
19 changes: 0 additions & 19 deletions envs/calendar_env/requirements.txt

This file was deleted.

4 changes: 4 additions & 0 deletions envs/carla_env/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ dependencies = [
"pydantic>=2.0.0",
"uvicorn>=0.24.0",
"requests>=2.31.0",
"websockets>=13.0",
"numpy>=1.26.0",
"shapely>=2.0.0",
"networkx>=3.0",
# CARLA Python API is installed directly in Dockerfiles
# via: pip install carla-ue5-api==0.10.0
]
Expand Down
26 changes: 16 additions & 10 deletions envs/carla_env/server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -84,19 +84,25 @@ ENV PYTHONPATH="${CARLA_ROOT}/PythonAPI/carla:${PYTHONPATH}"

WORKDIR /app

# Upgrade pip and install cffi explicitly (fixes _cffi_backend error)
# Upgrade pip, install cffi explicitly (fixes _cffi_backend error), and install uv
RUN pip install --upgrade pip \
&& pip install --no-cache-dir cffi cryptography

# Install OpenEnv core from GitHub
RUN pip install --no-cache-dir git+https://github.com/meta-pytorch/OpenEnv.git

# Copy and install environment dependencies
COPY server/requirements.txt /tmp/requirements.txt
RUN pip install --no-cache-dir -r /tmp/requirements.txt && rm /tmp/requirements.txt
&& pip install --no-cache-dir cffi cryptography uv

# Install environment dependencies via uv
RUN --mount=type=cache,target=/root/.cache/uv \
uv pip install --system \
"openenv-core[core]>=0.2.2" \
"fastapi>=0.115.0" \
"uvicorn>=0.24.0" \
"pydantic>=2.0.0" \
"requests>=2.31.0" \
"websockets>=13.0" \
"numpy>=1.26.0" \
"shapely>=2.0.0" \
"networkx>=3.0"

# Install CARLA Python client (UE5 API, compatible with CARLA 0.9.x and 0.10.x)
RUN pip install --no-cache-dir carla-ue5-api==0.10.0
RUN uv pip install --system carla-ue5-api==0.10.0

# Copy CARLA environment code
COPY . /app/carla_env/
Expand Down
42 changes: 26 additions & 16 deletions envs/carla_env/server/Dockerfile.real
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,39 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
git \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /app
# Install uv
RUN curl -LsSf https://astral.sh/uv/install.sh | sh && \
mv /root/.local/bin/uv /usr/local/bin/uv && \
mv /root/.local/bin/uvx /usr/local/bin/uvx

# Install OpenEnv core from GitHub
RUN pip install --no-cache-dir git+https://github.com/meta-pytorch/OpenEnv.git
WORKDIR /app/env

# Copy and install environment dependencies
COPY server/requirements.txt /tmp/requirements.txt
RUN pip install --no-cache-dir -r /tmp/requirements.txt && rm /tmp/requirements.txt
COPY . .

# Install CARLA Python client (0.10.0 with UE5, compatible with CARLA 0.10.x servers)
# Uses carla-ue5-api package from PyPI (MIT license, import carla still works)
RUN pip install --no-cache-dir carla-ue5-api==0.10.0
RUN --mount=type=cache,target=/root/.cache/uv \
if [ -f uv.lock ]; then \
uv sync --frozen --no-install-project --no-editable; \
else \
uv sync --no-install-project --no-editable; \
fi

RUN --mount=type=cache,target=/root/.cache/uv \
if [ -f uv.lock ]; then \
uv sync --frozen --no-editable; \
else \
uv sync --no-editable; \
fi

# Copy CARLA environment code
COPY . /app/carla_env/
# Install CARLA Python client (0.10.0 with UE5, compatible with CARLA 0.10.x servers)
RUN --mount=type=cache,target=/root/.cache/uv \
uv pip install --python .venv/bin/python carla-ue5-api==0.10.0

# Create non-root user
RUN useradd -m -u 1000 -s /bin/bash carla \
&& chown -R carla:carla /app

# Set Python path
ENV PYTHONPATH=/app:$PYTHONPATH
ENV PATH="/app/env/.venv/bin:$PATH"
ENV PYTHONPATH="/app/env:$PYTHONPATH"

# Environment variables for REAL mode
ENV CARLA_MODE=real
Expand All @@ -53,11 +64,10 @@ ENV CARLA_PORT=2000

# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \
CMD curl -f http://localhost:8000/health || exit 1
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')" || exit 1

EXPOSE 8000

USER carla

# Run server (expects external CARLA server at CARLA_HOST:CARLA_PORT)
CMD ["uvicorn", "carla_env.server.app:app", "--host", "0.0.0.0", "--port", "8000"]
CMD ["sh", "-c", "cd /app/env && uvicorn server.app:app --host 0.0.0.0 --port 8000"]
14 changes: 0 additions & 14 deletions envs/carla_env/server/requirements.txt

This file was deleted.

1 change: 1 addition & 0 deletions envs/finqa_env/uv.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
find-links = ["wheels/"]
6 changes: 1 addition & 5 deletions envs/grid_world_env/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
name = "grid_world_env"
version = "0.1.0"
description = "A simple Grid World environment for OpenEnv"
requires-python = ">=3.12"
requires-python = ">=3.10"
authors = [
{name = "Yuv Raj Pant", email = "yuvrajpant5@gmail.com"},
]
Expand All @@ -29,7 +29,3 @@ server = "grid_world_env.server.app:main"
include-package-data = true
packages = ["grid_world_env", "grid_world_env.server"]
package-dir = { "grid_world_env" = ".", "grid_world_env.server" = "server" }

# CRITICAL: This tells uv to look for openenv two folders up
[tool.uv.sources]
openenv = { path = "../../", editable = true }
Loading