Skip to content

Commit f27d74d

Browse files
committed
Reverted overcooked demo changes (didn't seem to be working)
1 parent c85fc4a commit f27d74d

File tree

14 files changed

+63
-2213
lines changed

14 files changed

+63
-2213
lines changed

pyproject.toml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,9 @@ version = "2.0.0"
88
description = "Cooperative multi-agent environment based on Overcooked"
99
readme = "README.md"
1010
requires-python = ">=3.10,<3.11"
11-
license = {file = "LICENSE"}
12-
authors = [
13-
{name = "Micah Carroll", email = "mdc@berkeley.edu"}
14-
]
15-
urls = {homepage = "https://github.com/HumanCompatibleAI/overcooked_ai"}
11+
license = { file = "LICENSE" }
12+
authors = [{ name = "Micah Carroll", email = "mdc@berkeley.edu" }]
13+
urls = { homepage = "https://github.com/HumanCompatibleAI/overcooked_ai" }
1614
keywords = ["Overcooked", "AI", "Reinforcement Learning"]
1715
dependencies = [
1816
"dill",
@@ -34,15 +32,16 @@ harl = [
3432
"lz4",
3533
"tensorflow[and-cuda]==2.19.0",
3634
"wandb",
35+
"gym",
3736
]
3837

3938
[project.scripts]
4039
overcooked-demo-up = "overcooked_demo:start_server"
4140
overcooked-demo-move = "overcooked_demo:move_agent"
4241

4342
[tool.setuptools]
44-
package-dir = {"" = "src"}
45-
packages = {find = {where = ["src"]}}
43+
package-dir = { "" = "src" }
44+
packages = { find = { where = ["src"] } }
4645

4746
[tool.setuptools.package-data]
4847
"overcooked_ai_py" = [
@@ -60,4 +59,4 @@ packages = {find = {where = ["src"]}}
6059
"ppo/trained_example/*/.is_checkpoint",
6160
"ppo/trained_example/*/.tune_metadata",
6261
"ppo/trained_example/*/checkpoint-500",
63-
]
62+
]

src/overcooked_demo/README.md

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ A web application where humans can play Overcooked with trained AI agents.
77

88
* [Installation](#installation)
99
* [Usage](#usage)
10-
* [Docker Deployment](#docker-deployment)
11-
* [Local Run with uv](#local-run-with-uv)
12-
* [Command Line](#command-line)
1310
* [Dependencies](#dependencies)
1411
* [Using Pre-trained Agents](#using-pre-trained-agents)
1512
* [Updating](#updating)
@@ -20,14 +17,8 @@ A web application where humans can play Overcooked with trained AI agents.
2017

2118
Building the server image requires [Docker](https://docs.docker.com/get-docker/)
2219

23-
For local development with uv, you'll need:
24-
- Python 3.7 or later
25-
- [uv](https://github.com/astral-sh/uv) - Install with `pip install uv`
26-
2720
## Usage
2821

29-
### Docker Deployment
30-
3122
The server can be deployed locally using the driver script included in the repo. To run the production server, use the command
3223
```bash
3324
./up.sh production
@@ -45,23 +36,6 @@ In order to kill the production server, run
4536
./down.sh
4637
```
4738

48-
### Local Run with uv
49-
50-
To run the server locally using uv without Docker, use:
51-
52-
```bash
53-
./up.sh local
54-
```
55-
56-
This will:
57-
1. Create a virtual environment in the server directory if it doesn't exist
58-
2. Install all dependencies using uv
59-
3. Start the server on port 5000
60-
61-
After running this command, navigate to http://localhost:5000
62-
63-
### Command Line
64-
6539
You can also start the server via the command line. After installing the `overcooked_ai` via pip, you can start the server by typing
6640

6741
```

src/overcooked_demo/docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
version : '3.7'
2+
13
services:
24
app:
35
build:

src/overcooked_demo/server/Dockerfile

Lines changed: 14 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,43 @@
1-
FROM python:3.9-slim
1+
FROM python:3.7-buster
22

33
ARG BUILD_ENV
44
ARG OVERCOOKED_BRANCH
55
ARG GRAPHICS
66

77
WORKDIR /app
88

9-
# Install uv
10-
RUN pip install uv
9+
# Install non-chai dependencies
10+
COPY ./requirements.txt ./requirements.txt
11+
RUN pip install -r requirements.txt
1112

12-
# Create a virtual environment for uv
13-
RUN uv venv
14-
15-
# Copy the pyproject.toml for installation
16-
COPY ./pyproject.toml ./pyproject.toml
17-
COPY ./dev_helper.py ./dev_helper.py
18-
19-
# Install necessary packages for build
20-
RUN apt-get update && apt-get install -y git build-essential
13+
# Install eventlet production server if production build
14+
RUN if [ "$BUILD_ENV" = "production" ] ; then pip install eventlet ; fi
2115

22-
# Copy local overcooked_ai directory instead of git cloning
23-
COPY ./overcooked_ai /overcooked_ai
16+
# Clone chai code
17+
RUN git clone --recursive https://github.com/HumanCompatibleAI/overcooked_ai.git --branch $OVERCOOKED_BRANCH --single-branch /overcooked_ai
2418

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

28-
# Install server dependencies
29-
RUN . .venv/bin/activate && uv pip install -e .
30-
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-
34-
# Install the cloned overcooked_ai in development mode
35-
RUN . .venv/bin/activate && uv pip install -e /overcooked_ai
36-
37-
# Install eventlet production server if production build
38-
RUN if [ "$BUILD_ENV" = "production" ] ; then . .venv/bin/activate && uv pip install "eventlet>=0.39.0" ; fi
22+
# Install chai dependencies
23+
RUN pip install -e '/overcooked_ai[harl]'
3924

40-
# Install needed packages
41-
RUN apt-get update && apt-get install -y \
42-
libgl1-mesa-dev \
43-
libglib2.0-0 \
44-
libsm6 \
45-
libxext6 \
46-
libxrender-dev \
47-
&& rm -rf /var/lib/apt/lists/*
25+
RUN apt-get -y update
26+
RUN apt-get install -y libgl1-mesa-dev
4827

4928
# Copy over remaining files
5029
COPY ./static ./static
5130
COPY ./*.py ./
5231
COPY ./graphics/$GRAPHICS ./static/js/graphics.js
5332
COPY ./config.json ./config.json
54-
COPY ./init.sh ./init.sh
5533

56-
# Make init script executable
57-
RUN chmod +x ./init.sh
5834

59-
# Create data directories
60-
RUN mkdir -p /app/data/agents
6135

6236
# Set environment variables that will be used by app.py
6337
ENV HOST 0.0.0.0
6438
ENV PORT 5000
6539
ENV CONF_PATH config.json
6640

67-
# Expose port and run the app, using init.sh as entrypoint
41+
# Do the thing
6842
EXPOSE 5000
69-
ENTRYPOINT ["./init.sh"]
70-
CMD ["uv", "run", "app.py"]
43+
CMD ["python", "-u", "app.py"]

src/overcooked_demo/server/README.md

Lines changed: 0 additions & 48 deletions
This file was deleted.

src/overcooked_demo/server/app.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@
3434
###########
3535

3636
# Read in global config
37-
script_dir = os.path.dirname(os.path.abspath(__file__))
38-
CONF_PATH = os.getenv("CONF_PATH", os.path.join(script_dir, "config.json"))
37+
CONF_PATH = os.getenv("CONF_PATH", "config.json")
3938
with open(CONF_PATH, "r") as f:
4039
CONFIG = json.load(f)
4140

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,37 @@
11
{
2-
"logfile" : "overcooked_app.log",
3-
"layouts" : ["cramped_room", "asymmetric_advantages", "coordination_ring", "forced_coordination", "counter_circuit"],
4-
"layout_globals" : {
5-
"NUM_PLAYERS": 2,
6-
"PROP_FEATS_ENCODING": false,
7-
"REW_SHAPING_PARAMS": null,
8-
"max_num_ingredients": 3,
9-
"onion_value": 21,
10-
"tomato_value": 13,
11-
"onion_time": 10,
12-
"tomato_time": 7
13-
},
14-
"MAX_GAME_LENGTH" : 900,
15-
"AGENT_DIR" : "/app/data/agents",
2+
"logfile" : "app.log",
3+
"layouts" : ["cramped_room","counter_circuit_o_1order", "cramped_room_tomato", "asymmetric_advantages", "coordination_ring", "forced_coordination", "counter_circuit", "cramped_corridor", "marshmallow_experiment", "long_cook_time", "forced_coordination_tomato", "asymmetric_advantages_tomato", "marshmallow_experiment_coordination", "pipeline", "you_shall_not_pass", "tutorial_3"],
164
"MAX_GAMES" : 10,
5+
"MAX_GAME_LENGTH" : 120,
6+
"AGENT_DIR" : "./static/assets/agents",
177
"MAX_FPS" : 30,
188
"predefined" : {
19-
"layout_name": "cramped_room"
9+
"experimentParams" : {
10+
"layouts" : ["counter_circuit", "cramped_room"],
11+
"gameTime" : 5,
12+
"playerZero" : "human",
13+
"playerOne" : "human",
14+
"randomized" : true,
15+
"dataCollection": "on"
16+
},
17+
"lobbyWaitTime" : 300000
2018
},
2119
"tutorial" : {
22-
"layout_name": "tutorial"
20+
"tutorialParams" : {
21+
"layouts" : ["tutorial_3", "tutorial_2", "tutorial_1", "tutorial_0"],
22+
"playerZero" : "human",
23+
"playerOne" : "TutorialAI",
24+
"phaseTwoScore" : 34
25+
},
26+
"tomato_value" : 13,
27+
"onion_value" : 21
28+
},
29+
"layout_globals" : {
30+
"onion_value" : 21,
31+
"tomato_value" : 13,
32+
"onion_time" : 15,
33+
"tomato_time" : 7,
34+
"order_bonus" : 2,
35+
"max_num_ingredients" : 3
2336
}
2437
}

src/overcooked_demo/server/dev_helper.py

Lines changed: 0 additions & 29 deletions
This file was deleted.

src/overcooked_demo/server/init.sh

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/overcooked_demo/server/pyproject.toml

Lines changed: 0 additions & 42 deletions
This file was deleted.

src/overcooked_demo/server/requirements.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,16 @@ click==8.0
33
dnspython==1.16.0
44
dill==0.3.2
55
Flask==2.1.0
6-
Flask-SocketIO==5.3.0
6+
Flask-SocketIO==4.3.0
77
greenlet==0.4.16
88
itsdangerous==2.0
99
Jinja2==3.1.0
1010
MarkupSafe==2.0
1111
monotonic==1.5
12-
python-engineio==4.3.4
13-
python-socketio==5.7.2
12+
python-engineio==3.13.0
13+
python-socketio==4.6.0
1414
six==1.15.0
1515
Werkzeug==2.0.3
1616
tensorflow==2.0.3
1717
requests==2.23.0
1818
protobuf==3.19
19-
ray[rllib]==1.13.0

0 commit comments

Comments
 (0)