|
|
|
|
|
|
|
|
|
|
|
|
|
|
FROM ubuntu:20.04 AS fetch_repo |
|
|
RUN apt update && \ |
|
|
apt install -y git curl && \ |
|
|
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash && \ |
|
|
apt-get install -y git-lfs |
|
|
|
|
|
RUN git clone https://$GITHUB_USERNAME:$GITHUB_TOKEN@github.com/facebookresearch/meta-agents-research-environments.git && \ |
|
|
cd meta-agents-research-environments && \ |
|
|
git lfs install && \ |
|
|
git lfs pull && \ |
|
|
rm -rf ./are/simulation/tests && \ |
|
|
rm -rf ./are/simulation/tutorials |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FROM node:23 AS frontend-builder |
|
|
WORKDIR /app |
|
|
COPY --from=fetch_repo /meta-agents-research-environments/are/simulation/gui/client ./are/simulation/gui/client |
|
|
WORKDIR /app/are/simulation/gui/client |
|
|
|
|
|
RUN npm cache clean --force && rm -f package-lock.json |
|
|
RUN --mount=type=cache,target=/root/.npm NPM_CONFIG_CACHE=/root/.npm npm install |
|
|
RUN npm run build |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FROM node:23 AS react-frontend-builder |
|
|
WORKDIR /app/frontend |
|
|
COPY frontend/package.json ./ |
|
|
|
|
|
RUN npm cache clean --force && rm -f package-lock.json |
|
|
RUN --mount=type=cache,target=/root/.npm NPM_CONFIG_CACHE=/root/.npm npm install |
|
|
COPY frontend/ ./ |
|
|
RUN npm run build |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FROM python:3.10.14-slim |
|
|
|
|
|
|
|
|
RUN useradd -m -u 1000 user |
|
|
|
|
|
|
|
|
ARG SERVER_VERSION=unknown |
|
|
RUN apt-get update && apt-get install -y \ |
|
|
curl \ |
|
|
git \ |
|
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
|
|
|
RUN apt-get update && apt-get install -y \ |
|
|
bash git-lfs wget procps \ |
|
|
vim net-tools \ |
|
|
&& rm -rf /var/lib/apt/lists/* |
|
|
RUN pip install uv |
|
|
|
|
|
|
|
|
COPY --from=fetch_repo /meta-agents-research-environments/are /app/are |
|
|
COPY --from=fetch_repo /meta-agents-research-environments/build_hooks /app/build_hooks |
|
|
COPY --from=fetch_repo /meta-agents-research-environments/pyproject.toml /app/pyproject.toml |
|
|
COPY --from=fetch_repo /meta-agents-research-environments/uv.lock /app/uv.lock |
|
|
COPY --from=fetch_repo /meta-agents-research-environments/requirements* /app/ |
|
|
COPY --from=fetch_repo /meta-agents-research-environments/README.md /app/README.md |
|
|
COPY --from=fetch_repo /meta-agents-research-environments/LICENSE /app/LICENSE |
|
|
WORKDIR /app |
|
|
ARG VIRTUAL_ENV /app/.venv |
|
|
RUN --mount=type=cache,target=/root/.cache/pip uv venv |
|
|
RUN --mount=type=cache,target=/root/.cache/pip uv pip install '.' |
|
|
RUN rm -rf /app/are/gui/client |
|
|
COPY --from=frontend-builder /app/are/simulation/gui/client/build /app/are/simulation/gui/client/build |
|
|
|
|
|
|
|
|
ENV PYTHONUNBUFFERED=1 |
|
|
ENV ARE_SERVER_HOSTNAME=0.0.0.0 |
|
|
ENV ARE_SERVER_VERSION=$SERVER_VERSION |
|
|
ENV HF_HOME=/app/.cache |
|
|
ENV HF_DATASETS_CACHE=/app/.cache |
|
|
|
|
|
ENV SYSTEM=spaces |
|
|
|
|
|
ENV FORWARDED_ALLOW_IPS="*" |
|
|
|
|
|
|
|
|
COPY --from=react-frontend-builder /app/frontend/build /app/frontend/build |
|
|
|
|
|
WORKDIR /app |
|
|
RUN chown 1000 /app |
|
|
EXPOSE 7860 |
|
|
|
|
|
|
|
|
RUN uv pip install -U huggingface_hub "datasets==4.0.0" "gradio[oauth]==5.42.0" gradio_modal "jsonschema>=4.0.0" psutil |
|
|
RUN uv pip install --no-cache-dir flask gunicorn |
|
|
|
|
|
|
|
|
COPY backend/ /app/backend/ |
|
|
COPY app.py /app/app.py |
|
|
COPY run.sh /app/run.sh |
|
|
COPY mcp_demo_prompts.json /app/mcp_demo_prompts.json |
|
|
|
|
|
|
|
|
RUN mkdir -p /app/data && chown 1000:1000 /app/data |
|
|
|
|
|
|
|
|
ENV PORT=7860 FLASK_ENV=production PYTHONUNBUFFERED=1 STORAGE_PATH=/app/data |
|
|
|
|
|
RUN chmod 755 /app/.venv |
|
|
USER 1000 |
|
|
|
|
|
|
|
|
CMD ["bash", "run.sh"] |
|
|
|