training dockerfile
Browse files- Dockerfile +9 -17
Dockerfile
CHANGED
|
@@ -1,32 +1,24 @@
|
|
| 1 |
-
#
|
| 2 |
-
#
|
| 3 |
|
| 4 |
FROM python:3.10-slim
|
| 5 |
|
| 6 |
-
LABEL org.opencontainers.image.title="OpenGrid"
|
| 7 |
-
LABEL org.opencontainers.image.description="
|
| 8 |
-
LABEL openenv="true"
|
| 9 |
|
| 10 |
-
# Create non-root user required by HF Spaces
|
| 11 |
RUN useradd -m -u 1000 user
|
| 12 |
USER user
|
| 13 |
ENV PATH="/home/user/.local/bin:$PATH"
|
| 14 |
|
| 15 |
WORKDIR /app
|
| 16 |
|
| 17 |
-
# Install dependencies
|
| 18 |
-
COPY --chown=user requirements.txt .
|
| 19 |
-
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 20 |
|
| 21 |
# Copy application code
|
| 22 |
COPY --chown=user . /app
|
| 23 |
|
| 24 |
-
#
|
| 25 |
EXPOSE 7860
|
| 26 |
-
|
| 27 |
-
# Healthcheck
|
| 28 |
-
HEALTHCHECK --interval=30s --timeout=5s --start-period=15s \
|
| 29 |
-
CMD python -c "import httpx; httpx.get('http://localhost:7860/health').raise_for_status()" || exit 1
|
| 30 |
-
|
| 31 |
-
# Run the server
|
| 32 |
-
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 1 |
+
# OpenGrid GRPO Training Space — Runs on A10G GPU
|
| 2 |
+
# After training completes, serves results on port 7860
|
| 3 |
|
| 4 |
FROM python:3.10-slim
|
| 5 |
|
| 6 |
+
LABEL org.opencontainers.image.title="OpenGrid GRPO Training"
|
| 7 |
+
LABEL org.opencontainers.image.description="GRPO training for power grid multi-agent controller"
|
|
|
|
| 8 |
|
|
|
|
| 9 |
RUN useradd -m -u 1000 user
|
| 10 |
USER user
|
| 11 |
ENV PATH="/home/user/.local/bin:$PATH"
|
| 12 |
|
| 13 |
WORKDIR /app
|
| 14 |
|
| 15 |
+
# Install training dependencies
|
| 16 |
+
COPY --chown=user requirements-training.txt .
|
| 17 |
+
RUN pip install --no-cache-dir --upgrade -r requirements-training.txt
|
| 18 |
|
| 19 |
# Copy application code
|
| 20 |
COPY --chown=user . /app
|
| 21 |
|
| 22 |
+
# Training entrypoint: runs GRPO then serves results
|
| 23 |
EXPOSE 7860
|
| 24 |
+
CMD ["python", "run_training.py"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|