File size: 1,761 Bytes
206c61c
 
 
 
 
 
 
 
e1f4a4f
 
 
206c61c
 
 
ba8dc78
206c61c
 
 
 
 
 
 
ba8dc78
 
 
 
 
 
 
 
 
206c61c
 
 
 
 
a113eab
 
 
cd20d20
206c61c
 
 
 
 
cd20d20
 
c97e1f0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
FROM python:3.11-slim

ENV PYTHONUNBUFFERED=1 \
    PIP_DISABLE_PIP_VERSION_CHECK=1 \
    PIP_NO_CACHE_DIR=1 \
    GUNICORN_WORKERS=2 \
    GUNICORN_TIMEOUT=180 \
    PORT=7860 \
    BENCHMARK_UI_STORAGE=/data \
    DATA_ROOT=/data \
    BENCHMARK_HF_REPO=lainwired/jaxaht-benchmark-leaderboard

RUN apt-get update && apt-get install -y --no-install-recommends \
    curl ca-certificates build-essential git \
    nodejs npm \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /app

COPY benchmark_ui/requirements.txt /app/benchmark_ui/requirements.txt
RUN pip install -r /app/benchmark_ui/requirements.txt

# Build the frontend in-container so HF Space deploys don't depend on a
# pre-built dist/ committed to git (dist/ is gitignored).
COPY benchmark_ui/frontend/package*.json /app/benchmark_ui/frontend/
RUN cd /app/benchmark_ui/frontend && npm ci
COPY benchmark_ui/frontend /app/benchmark_ui/frontend
RUN cd /app/benchmark_ui/frontend && npm run build

COPY benchmark_ui/backend /app/benchmark_ui/backend
COPY benchmark_ui/__init__.py /app/benchmark_ui/__init__.py
COPY agents/ /app/agents/
COPY common/ /app/common/
COPY envs/ /app/envs/
COPY evaluation/ /app/evaluation/
COPY marl/ /app/marl/
COPY ego_agent_training/ /app/ego_agent_training/
COPY open_ended_training/ /app/open_ended_training/
COPY teammate_generation/ /app/teammate_generation/
COPY download_eval_data.py /app/download_eval_data.py

RUN mkdir -p /data && chmod 777 /data

EXPOSE 7860

# pull BC + OBL weights from jaxaht/eval-teammates at startup, then run gunicorn.
# weights aren't in the Space image to stay under the 1GB quota.
CMD ["sh", "-c", "cd /app && python download_eval_data.py || true && exec gunicorn -w 1 -b 0.0.0.0:7860 --timeout 180 'benchmark_ui.backend.app:create_app()'"]