Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files- Dockerfile +8 -16
- README.md +6 -2
Dockerfile
CHANGED
|
@@ -7,13 +7,9 @@
|
|
| 7 |
# Dockerfile for Doom Environment
|
| 8 |
# This image provides ViZDoom for visual RL research with OpenEnv
|
| 9 |
#
|
| 10 |
-
# This Dockerfile works
|
| 11 |
-
# -
|
| 12 |
-
# -
|
| 13 |
-
# - HuggingFace Spaces
|
| 14 |
-
#
|
| 15 |
-
# Build from project root:
|
| 16 |
-
# docker build -t doom-env:latest -f src/envs/doom_env/server/Dockerfile .
|
| 17 |
#
|
| 18 |
# Run with web interface:
|
| 19 |
# docker run -p 8000:8000 -e ENABLE_WEB_INTERFACE=true doom-env:latest
|
|
@@ -26,7 +22,7 @@ LABEL description="Doom RL Environment with ViZDoom and OpenEnv"
|
|
| 26 |
LABEL org.opencontainers.image.source="https://github.com/meta-pytorch/OpenEnv"
|
| 27 |
|
| 28 |
# Set working directory
|
| 29 |
-
WORKDIR /app
|
| 30 |
|
| 31 |
# Install system dependencies
|
| 32 |
# - curl: for healthcheck
|
|
@@ -55,18 +51,14 @@ RUN apt-get update && \
|
|
| 55 |
rm -rf /var/lib/apt/lists/*
|
| 56 |
|
| 57 |
# Set environment variables
|
| 58 |
-
ENV PYTHONPATH=/app/src
|
| 59 |
ENV PYTHONUNBUFFERED=1
|
| 60 |
|
| 61 |
-
# Copy
|
| 62 |
-
COPY
|
| 63 |
-
|
| 64 |
-
# Copy entire doom_env directory
|
| 65 |
-
COPY src/envs/doom_env/ /app/src/envs/doom_env/
|
| 66 |
|
| 67 |
# Install doom_env and all its dependencies from pyproject.toml
|
| 68 |
# This includes: openenv-core, fastapi, uvicorn, pydantic, requests, vizdoom, numpy
|
| 69 |
-
RUN pip install --no-cache-dir -e
|
| 70 |
|
| 71 |
# Doom-specific environment variables (can be overridden at runtime)
|
| 72 |
ENV DOOM_SCENARIO=basic
|
|
@@ -87,4 +79,4 @@ HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
|
| 87 |
# Run the FastAPI server
|
| 88 |
# Web interface will be available at /web if ENABLE_WEB_INTERFACE=true
|
| 89 |
# API documentation available at /docs
|
| 90 |
-
CMD ["uvicorn", "
|
|
|
|
| 7 |
# Dockerfile for Doom Environment
|
| 8 |
# This image provides ViZDoom for visual RL research with OpenEnv
|
| 9 |
#
|
| 10 |
+
# This Dockerfile works for both local builds and HuggingFace Spaces deployment:
|
| 11 |
+
# - Local build from project root: docker build -t doom-env:latest -f src/envs/doom_env/server/Dockerfile src/envs/doom_env
|
| 12 |
+
# - HuggingFace: Automatically deployed via `openenv push`
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
#
|
| 14 |
# Run with web interface:
|
| 15 |
# docker run -p 8000:8000 -e ENABLE_WEB_INTERFACE=true doom-env:latest
|
|
|
|
| 22 |
LABEL org.opencontainers.image.source="https://github.com/meta-pytorch/OpenEnv"
|
| 23 |
|
| 24 |
# Set working directory
|
| 25 |
+
WORKDIR /app/env
|
| 26 |
|
| 27 |
# Install system dependencies
|
| 28 |
# - curl: for healthcheck
|
|
|
|
| 51 |
rm -rf /var/lib/apt/lists/*
|
| 52 |
|
| 53 |
# Set environment variables
|
|
|
|
| 54 |
ENV PYTHONUNBUFFERED=1
|
| 55 |
|
| 56 |
+
# Copy environment files
|
| 57 |
+
COPY . .
|
|
|
|
|
|
|
|
|
|
| 58 |
|
| 59 |
# Install doom_env and all its dependencies from pyproject.toml
|
| 60 |
# This includes: openenv-core, fastapi, uvicorn, pydantic, requests, vizdoom, numpy
|
| 61 |
+
RUN pip install --no-cache-dir -e .
|
| 62 |
|
| 63 |
# Doom-specific environment variables (can be overridden at runtime)
|
| 64 |
ENV DOOM_SCENARIO=basic
|
|
|
|
| 79 |
# Run the FastAPI server
|
| 80 |
# Web interface will be available at /web if ENABLE_WEB_INTERFACE=true
|
| 81 |
# API documentation available at /docs
|
| 82 |
+
CMD ["uvicorn", "doom_env.server.app:app", "--host", "0.0.0.0", "--port", "8000"]
|
README.md
CHANGED
|
@@ -163,8 +163,12 @@ The web interface provides:
|
|
| 163 |
The Doom environment Docker image can be built in standalone mode using only public base images. This makes it suitable for CI/CD, GitHub, and HuggingFace deployments.
|
| 164 |
|
| 165 |
```bash
|
| 166 |
-
# Build from project root
|
| 167 |
-
docker build -t doom-env:latest -f src/envs/doom_env/server/Dockerfile
|
|
|
|
|
|
|
|
|
|
|
|
|
| 168 |
```
|
| 169 |
|
| 170 |
**What gets installed:**
|
|
|
|
| 163 |
The Doom environment Docker image can be built in standalone mode using only public base images. This makes it suitable for CI/CD, GitHub, and HuggingFace deployments.
|
| 164 |
|
| 165 |
```bash
|
| 166 |
+
# Build from project root
|
| 167 |
+
docker build -t doom-env:latest -f src/envs/doom_env/server/Dockerfile src/envs/doom_env
|
| 168 |
+
|
| 169 |
+
# Or build from the doom_env directory
|
| 170 |
+
cd src/envs/doom_env
|
| 171 |
+
docker build -t doom-env:latest -f server/Dockerfile .
|
| 172 |
```
|
| 173 |
|
| 174 |
**What gets installed:**
|