github-actions[bot] commited on
Commit
172946b
·
1 Parent(s): 54172e9

🤖 Deploy openspiel_env environment - 2025-10-21 16:20:10

Browse files
Files changed (3) hide show
  1. Dockerfile +3 -10
  2. README.md +2 -3
  3. src/envs/openspiel_env/server/Dockerfile +10 -12
Dockerfile CHANGED
@@ -43,16 +43,11 @@ RUN pip3 install --no-cache-dir --upgrade -r requirements.txt
43
  # Set Python path for OpenSpiel
44
  ENV PYTHONPATH=/repo:/repo/build/python:
45
 
46
- # Copy OpenEnv core (base image already set WORKDIR=/app)
47
  WORKDIR /app
48
  COPY src/core/ /app/src/core/
49
-
50
- # Copy OpenSpiel environment
51
  COPY src/envs/openspiel_env/ /app/src/envs/openspiel_env/
52
 
53
- # Copy README for web interface documentation
54
- COPY src/envs/openspiel_env/README.md /app/README.md
55
-
56
  # Extend Python path for OpenEnv (base image set PYTHONPATH=/app/src)
57
  # We prepend OpenSpiel paths
58
  ENV PYTHONPATH=/repo:/repo/build/python:/app/src
@@ -62,11 +57,9 @@ ENV OPENSPIEL_GAME=catch
62
  ENV OPENSPIEL_AGENT_PLAYER=0
63
  ENV OPENSPIEL_OPPONENT_POLICY=random
64
 
65
- # Health check (curl is provided by openenv-base)
66
  HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 CMD curl -f http://localhost:8000/health || exit 1
67
 
68
- # Note: EXPOSE 8000 already set by openenv-base
69
-
70
- # Run the FastAPI server (uvicorn installed by openenv-base)
71
  CMD ["uvicorn", "envs.openspiel_env.server.app:app", "--host", "0.0.0.0", "--port", "8000"]
72
  ENV ENABLE_WEB_INTERFACE=true
 
43
  # Set Python path for OpenSpiel
44
  ENV PYTHONPATH=/repo:/repo/build/python:
45
 
46
+ # Copy OpenEnv core
47
  WORKDIR /app
48
  COPY src/core/ /app/src/core/
 
 
49
  COPY src/envs/openspiel_env/ /app/src/envs/openspiel_env/
50
 
 
 
 
51
  # Extend Python path for OpenEnv (base image set PYTHONPATH=/app/src)
52
  # We prepend OpenSpiel paths
53
  ENV PYTHONPATH=/repo:/repo/build/python:/app/src
 
57
  ENV OPENSPIEL_AGENT_PLAYER=0
58
  ENV OPENSPIEL_OPPONENT_POLICY=random
59
 
60
+ # Health check
61
  HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 CMD curl -f http://localhost:8000/health || exit 1
62
 
63
+ # Run the FastAPI server
 
 
64
  CMD ["uvicorn", "envs.openspiel_env.server.app:app", "--host", "0.0.0.0", "--port", "8000"]
65
  ENV ENABLE_WEB_INTERFACE=true
README.md CHANGED
@@ -35,10 +35,9 @@ Provides access to OpenSpiel games for multi-agent reinforcement learning.
35
  Send a POST request to `/step` with:
36
  ```json
37
  {
38
- "action": {
39
- "action_id": 1
40
- }
41
  }
 
42
 
43
  ## API Documentation
44
 
 
35
  Send a POST request to `/step` with:
36
  ```json
37
  {
38
+ "action": 0
 
 
39
  }
40
+ ```
41
 
42
  ## API Documentation
43
 
src/envs/openspiel_env/server/Dockerfile CHANGED
@@ -4,14 +4,10 @@
4
  # This source code is licensed under the BSD-style license found in the
5
  # LICENSE file in the root directory of this source tree.
6
 
7
- # Use the standard openenv base image
8
- # Built from: docker build -t openenv-base:latest -f src/core/containers/images/Dockerfile .
9
- # In GitHub Actions, this is overridden to use the GHCR base image
10
- ARG BASE_IMAGE=openenv-base:latest
11
-
12
  # Multi-stage build for OpenSpiel + OpenEnv
13
  # Stage 1: Build OpenSpiel C++ bindings
14
- FROM python:3.11-slim AS openspiel-builder
 
15
 
16
  # Avoid interactive prompts during build
17
  ENV DEBIAN_FRONTEND=noninteractive
@@ -47,8 +43,10 @@ WORKDIR /repo/build
47
  RUN cmake -DPython3_EXECUTABLE=$(which python3) -DCMAKE_CXX_COMPILER=$(which clang++) ../open_spiel
48
  RUN make -j$(nproc) pyspiel
49
 
50
- # Stage 2: Use the standard openenv base image
51
- FROM ${BASE_IMAGE}
 
 
52
 
53
  # Copy OpenSpiel build artifacts from builder
54
  RUN mkdir -p /repo
@@ -80,11 +78,11 @@ ENV OPENSPIEL_GAME=catch
80
  ENV OPENSPIEL_AGENT_PLAYER=0
81
  ENV OPENSPIEL_OPPONENT_POLICY=random
82
 
83
- # Health check (curl is provided by openenv-base)
84
  HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
85
  CMD curl -f http://localhost:8000/health || exit 1
86
 
87
- # Note: EXPOSE 8000 already set by openenv-base
88
 
89
- # Run the FastAPI server (uvicorn installed by openenv-base)
90
- CMD ["uvicorn", "envs.openspiel_env.server.app:app", "--host", "0.0.0.0", "--port", "8000"]
 
4
  # This source code is licensed under the BSD-style license found in the
5
  # LICENSE file in the root directory of this source tree.
6
 
 
 
 
 
 
7
  # Multi-stage build for OpenSpiel + OpenEnv
8
  # Stage 1: Build OpenSpiel C++ bindings
9
+ # Using Python 3.11 to match envtorch-base
10
+ FROM python:3.11 AS openspiel-builder
11
 
12
  # Avoid interactive prompts during build
13
  ENV DEBIAN_FRONTEND=noninteractive
 
43
  RUN cmake -DPython3_EXECUTABLE=$(which python3) -DCMAKE_CXX_COMPILER=$(which clang++) ../open_spiel
44
  RUN make -j$(nproc) pyspiel
45
 
46
+ # Stage 2: Runtime image using published openenv-base
47
+ # Uses the standardized base image from GitHub Container Registry
48
+ # See: https://github.com/meta-pytorch/OpenEnv/pkgs/container/openenv-base
49
+ FROM ghcr.io/meta-pytorch/openenv-base:latest
50
 
51
  # Copy OpenSpiel build artifacts from builder
52
  RUN mkdir -p /repo
 
78
  ENV OPENSPIEL_AGENT_PLAYER=0
79
  ENV OPENSPIEL_OPPONENT_POLICY=random
80
 
81
+ # Health check (curl is provided by envtorch-base)
82
  HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
83
  CMD curl -f http://localhost:8000/health || exit 1
84
 
85
+ # Note: EXPOSE 8000 already set by envtorch-base
86
 
87
+ # Run the FastAPI server (uvicorn installed by envtorch-base)
88
+ CMD ["uvicorn", "envs.openspiel_env.server.app:app", "--host", "0.0.0.0", "--port", "8000"]