Skip to content

Commit a163edc

Browse files
committed
Fix
1 parent ba04790 commit a163edc

6 files changed

Lines changed: 54 additions & 14 deletions

File tree

create_agent.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env python
2+
import pickle
3+
import os
4+
5+
class RandomAI:
6+
def action(self, state):
7+
import numpy as np
8+
return np.random.choice(['up', 'down', 'left', 'right', 'stay', 'interact'])
9+
10+
def reset(self):
11+
pass
12+
13+
if __name__ == "__main__":
14+
# Create agent directory
15+
os.makedirs('/app/data/agents/random_agent/agent', exist_ok=True)
16+
17+
# Save the agent
18+
with open('/app/data/agents/random_agent/agent/agent.pickle', 'wb') as f:
19+
pickle.dump(RandomAI(), f)
20+
21+
print("Agent created successfully!")

src/overcooked_demo/server/Dockerfile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,20 @@ COPY ./static ./static
5151
COPY ./*.py ./
5252
COPY ./graphics/$GRAPHICS ./static/js/graphics.js
5353
COPY ./config.json ./config.json
54+
COPY ./init.sh ./init.sh
55+
56+
# Make init script executable
57+
RUN chmod +x ./init.sh
58+
59+
# Create data directories
60+
RUN mkdir -p /app/data/agents
5461

5562
# Set environment variables that will be used by app.py
5663
ENV HOST 0.0.0.0
5764
ENV PORT 5000
5865
ENV CONF_PATH config.json
5966

60-
# Expose port and run the app, using dev_helper to ensure proper Python path
67+
# Expose port and run the app, using init.sh as entrypoint
6168
EXPOSE 5000
62-
# CMD [".venv/bin/python", "-m", "dev_helper", "app.py"]
69+
ENTRYPOINT ["./init.sh"]
6370
CMD ["uv", "run", "app.py"]

src/overcooked_demo/server/config.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@
44
"layout_globals" : {
55
"NUM_PLAYERS": 2,
66
"PROP_FEATS_ENCODING": false,
7-
"REW_SHAPING_PARAMS": null
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
813
},
914
"MAX_GAME_LENGTH" : 900,
1015
"AGENT_DIR" : "/app/data/agents",

src/overcooked_demo/server/init.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
# Create the agents directory if it doesn't exist
4+
mkdir -p /app/data/agents
5+
6+
# Start the application
7+
exec "$@"

src/overcooked_demo/server/pyproject.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@ dependencies = [
1313
"certifi>=2020.6.20",
1414
"click>=8.0",
1515
"dnspython>=1.16.0",
16-
"Flask>=2.1.0",
17-
"Flask-SocketIO>=4.3.0",
16+
"Flask==2.0.3",
17+
"Flask-SocketIO==4.3.2",
1818
"greenlet>=0.4.16",
19-
"itsdangerous>=2.0",
20-
"Jinja2>=3.1.0",
21-
"MarkupSafe>=2.0",
19+
"itsdangerous==2.0.1",
20+
"Jinja2==3.0.3",
21+
"MarkupSafe==2.0.1",
2222
"monotonic>=1.5",
23-
"python-engineio>=3.13.0",
24-
"python-socketio>=4.6.0",
23+
"python-engineio==3.14.2",
24+
"python-socketio==4.6.1",
2525
"six>=1.15.0",
26-
"Werkzeug>=2.0.3",
26+
"Werkzeug==2.0.3",
2727
"requests>=2.23.0",
2828
"protobuf>=3.19",
2929
"eventlet>=0.39.0",

src/overcooked_demo/server/requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ click==8.0
33
dnspython==1.16.0
44
dill==0.3.2
55
Flask==2.1.0
6-
Flask-SocketIO==4.3.0
6+
Flask-SocketIO==5.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==3.13.0
13-
python-socketio==4.6.0
12+
python-engineio==4.3.4
13+
python-socketio==5.7.2
1414
six==1.15.0
1515
Werkzeug==2.0.3
1616
tensorflow==2.0.3

0 commit comments

Comments
 (0)