soonvalley04 commited on
Commit
33403df
Β·
verified Β·
1 Parent(s): 1345691

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +28 -42
Dockerfile CHANGED
@@ -1,49 +1,35 @@
1
- # ── OpenEnv: Split-Brain Collapse β€” GPU Training Space ────────────────────────
2
- # This Dockerfile runs the GRPO curriculum training script.
3
- # Deploy as a separate HF Space with GPU hardware (A10G Small recommended).
4
- #
5
- # Env variables to set in Space Secrets:
6
- # HF_TOKEN β€” your HF write token (to push adapter + plots)
7
- # HF_USERNAME β€” your HF username (default: soonvalley04)
8
- # ──────────────────────────────────────────────────────────────────────────────
9
 
10
- FROM python:3.10-slim
11
 
12
  WORKDIR /app
13
 
14
- # System dependencies
15
- RUN apt-get update && apt-get install -y --no-install-recommends \
16
- git curl gcc g++ build-essential \
17
- && apt-get clean && rm -rf /var/lib/apt/lists/*
18
-
19
- # Install PyTorch from the official CUDA 12.1 wheel index (safest for HF Spaces A10G)
20
- # We do not pin versions so pip can cleanly resolve PyTorch 2.6.0 + Torchvision 0.21.0
21
- # Note: Use cu128 or cu130 as cu121 is outdated for Torch 2.10+
22
- RUN pip install --no-cache-dir --upgrade pip && \
23
- pip install --no-cache-dir \
24
- "torch==2.10.0" \
25
- "torchvision==0.25.0" \
26
- "torchaudio==2.10.0" \
27
- --index-url https://download.pytorch.org/whl/cu128
28
-
29
- # ── 2. Install Unsloth + Training Stack (Correct Dependencies) ──────────────
30
- RUN pip install --no-cache-dir \
31
- "unsloth @ git+https://github.com/unslothai/unsloth.git" \
32
- "unsloth_zoo" \
33
- "trl" \
34
- "datasets" \
35
- "matplotlib" \
36
- "pydantic" \
37
- "networkx" \
38
- "python-dotenv" \
39
- "huggingface_hub" \
40
- "openai" \
41
- "bitsandbytes" \
42
- "xformers" \
43
- "torchao>=0.16.0"
44
-
45
- # Copy repo source
46
  COPY . .
47
 
 
 
 
 
 
 
 
48
  # Run the FastAPI server (app:app = the `app` FastAPI instance in app.py)
49
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]
 
 
1
+ # ── OpenEnv: Distributed Data Cluster Triage ──────────────────────────────
2
+ # Serves:
3
+ # β€’ OpenEnv HTTP API: POST /reset, POST /step, GET /state, GET /health
4
+ # β€’ HTML Frontend: GET / (interactive dashboard)
5
+ # Port: 7860 (required for Hugging Face Spaces)
6
+ # ──────────────────────────────────────────────────────────────────────────
 
 
7
 
8
+ FROM python:3.10.14-slim-bookworm
9
 
10
  WORKDIR /app
11
 
12
+ # Apply latest security patches
13
+ RUN apt-get update && apt-get upgrade -y \
14
+ && apt-get install -y --no-install-recommends curl \
15
+ && apt-get clean \
16
+ && rm -rf /var/lib/apt/lists/*
17
+
18
+ # Install Python dependencies first (Docker cache layer)
19
+ COPY requirements.txt .
20
+ RUN pip install --no-cache-dir --upgrade pip \
21
+ && pip install --no-cache-dir -r requirements.txt
22
+
23
+ # Copy environment source
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  COPY . .
25
 
26
+ # Health check β€” confirms the FastAPI server is live
27
+ HEALTHCHECK --interval=30s --timeout=10s --start-period=15s --retries=3 \
28
+ CMD curl -f http://localhost:7860/health || exit 1
29
+
30
+ # Expose Hugging Face Spaces port
31
+ EXPOSE 7860
32
+
33
  # Run the FastAPI server (app:app = the `app` FastAPI instance in app.py)
34
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]
35
+