Skip to content

Commit ba04790

Browse files
committed
Update to work with uv
1 parent 5397468 commit ba04790

File tree

5 files changed

+24
-7
lines changed

5 files changed

+24
-7
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,4 +172,7 @@ node_modules/
172172
**/__pycache__/
173173
#manually correcting for demo
174174
!**/static/**/*.png
175-
!src/overcooked_demo/server/static/lib
175+
!src/overcooked_demo/server/static/lib
176+
177+
# Ignore copied overcooked_ai directory in server
178+
src/overcooked_demo/server/overcooked_ai/

src/overcooked_demo/server/Dockerfile

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,21 @@ RUN uv venv
1616
COPY ./pyproject.toml ./pyproject.toml
1717
COPY ./dev_helper.py ./dev_helper.py
1818

19-
# Clone chai code for the human_aware_rl module
20-
RUN apt-get update && apt-get install -y git
21-
RUN git clone --recursive https://github.com/HumanCompatibleAI/overcooked_ai.git --branch $OVERCOOKED_BRANCH --single-branch /overcooked_ai
19+
# Install necessary packages for build
20+
RUN apt-get update && apt-get install -y git build-essential
21+
22+
# Copy local overcooked_ai directory instead of git cloning
23+
COPY ./overcooked_ai /overcooked_ai
2224

2325
# Dummy data_dir so things don't break
2426
RUN echo "import os; DATA_DIR=os.path.abspath('.')" >> /overcooked_ai/src/human_aware_rl/data_dir.py
2527

2628
# Install server dependencies
2729
RUN . .venv/bin/activate && uv pip install -e .
2830

31+
# Install a specific version of Ray that's compatible with the overcooked_ai codebase
32+
RUN . .venv/bin/activate && uv pip install "ray[rllib]>=2.5.0"
33+
2934
# Install the cloned overcooked_ai in development mode
3035
RUN . .venv/bin/activate && uv pip install -e /overcooked_ai
3136

@@ -35,6 +40,10 @@ RUN if [ "$BUILD_ENV" = "production" ] ; then . .venv/bin/activate && uv pip ins
3540
# Install needed packages
3641
RUN apt-get update && apt-get install -y \
3742
libgl1-mesa-dev \
43+
libglib2.0-0 \
44+
libsm6 \
45+
libxext6 \
46+
libxrender-dev \
3847
&& rm -rf /var/lib/apt/lists/*
3948

4049
# Copy over remaining files
@@ -50,4 +59,5 @@ ENV CONF_PATH config.json
5059

5160
# Expose port and run the app, using dev_helper to ensure proper Python path
5261
EXPOSE 5000
53-
CMD [".venv/bin/python", "-m", "dev_helper", "app.py"]
62+
# CMD [".venv/bin/python", "-m", "dev_helper", "app.py"]
63+
CMD ["uv", "run", "app.py"]

src/overcooked_demo/server/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"REW_SHAPING_PARAMS": null
88
},
99
"MAX_GAME_LENGTH" : 900,
10-
"AGENT_DIR" : "../../../data/agents",
10+
"AGENT_DIR" : "/app/data/agents",
1111
"MAX_GAMES" : 10,
1212
"MAX_FPS" : 30,
1313
"predefined" : {

src/overcooked_demo/server/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ Werkzeug==2.0.3
1616
tensorflow==2.0.3
1717
requests==2.23.0
1818
protobuf==3.19
19+
ray[rllib]==1.13.0

src/overcooked_demo/up.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,15 @@ if [[ $1 = local* ]]; then
5050
exit 0
5151
fi
5252

53+
mkdir -p server/overcooked_ai
54+
cp -r ../../* server/overcooked_ai/
5355
# Docker mode
5456
if [[ $1 = prod* ]]; then
5557
echo "production"
5658
export BUILD_ENV=production
5759

58-
# Completely re-build all images from scatch without using build cache
60+
# Completely re-build all images from scratch without using build cache
61+
# Copy the overcooked_ai directory from the project root to the server directory
5962
docker compose build --no-cache
6063
docker compose up --force-recreate -d
6164
else

0 commit comments

Comments
 (0)