Elliot89 commited on
Commit
0af1961
Β·
1 Parent(s): 2e69352

fix: slim requirements, HTML root for HF status detection

Browse files
Files changed (3) hide show
  1. Dockerfile +5 -13
  2. requirements.txt +1 -1
  3. server/app.py +10 -12
Dockerfile CHANGED
@@ -1,27 +1,19 @@
1
  FROM python:3.11-slim
2
 
3
- # Set working directory
4
  WORKDIR /app
5
 
6
- # Install Python dependencies first (maximizes Docker layer cache)
7
  COPY requirements.txt .
8
  RUN pip install --no-cache-dir -r requirements.txt
9
 
10
- # Copy application code
11
- COPY tasks.py .
12
- COPY graders.py .
13
- COPY openenv.yaml .
14
- COPY inference.py .
15
- COPY server/ ./server/
16
 
17
- # Ensure server is a Python package
18
  RUN touch server/__init__.py
19
 
20
- # HuggingFace Spaces requires port 7860
21
  EXPOSE 7860
22
-
23
- # Add project root to Python path
24
  ENV PYTHONPATH=/app
25
 
26
- # Start the FastAPI server
27
  CMD ["uvicorn", "server.app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
  FROM python:3.11-slim
2
 
 
3
  WORKDIR /app
4
 
 
5
  COPY requirements.txt .
6
  RUN pip install --no-cache-dir -r requirements.txt
7
 
8
+ COPY tasks.py .
9
+ COPY graders.py .
10
+ COPY openenv.yaml .
11
+ COPY inference.py .
12
+ COPY server/ ./server/
 
13
 
 
14
  RUN touch server/__init__.py
15
 
 
16
  EXPOSE 7860
 
 
17
  ENV PYTHONPATH=/app
18
 
 
19
  CMD ["uvicorn", "server.app:app", "--host", "0.0.0.0", "--port", "7860"]
requirements.txt CHANGED
@@ -1,5 +1,5 @@
1
  fastapi==0.115.0
2
- uvicorn[standard]==0.30.6
3
  pydantic==2.9.2
4
  openai==1.51.0
5
  requests==2.32.3
 
1
  fastapi==0.115.0
2
+ uvicorn==0.30.6
3
  pydantic==2.9.2
4
  openai==1.51.0
5
  requests==2.32.3
server/app.py CHANGED
@@ -57,23 +57,21 @@ from fastapi.responses import HTMLResponse
57
 
58
  @app.get("/", response_class=HTMLResponse)
59
  def root():
60
- return """
61
- <!DOCTYPE html>
62
  <html>
63
- <head><title>SRE Incident Response β€” OpenEnv</title></head>
64
  <body style="font-family:sans-serif;max-width:600px;margin:40px auto;padding:20px">
65
- <h1>🚨 SRE Incident Response β€” OpenEnv</h1>
66
- <p>Status: <strong style="color:green">Running</strong></p>
67
- <p>An OpenEnv environment for training AI agents on SRE incident response tasks.</p>
68
  <ul>
69
- <li><a href="/health">/health</a> β€” Health check</li>
70
- <li><a href="/tasks">/tasks</a> β€” All tasks</li>
71
- <li><a href="/docs">/docs</a> β€” Interactive API docs</li>
72
  </ul>
73
- <p><em>3 tasks: alert_classification (easy), root_cause_analysis (medium), remediation_planning (hard)</em></p>
74
  </body>
75
- </html>
76
- """
77
 
78
 
79
  # ── Core OpenEnv endpoints ───────────────────────────────────────────────────
 
57
 
58
  @app.get("/", response_class=HTMLResponse)
59
  def root():
60
+ return """<!DOCTYPE html>
 
61
  <html>
62
+ <head><title>SRE Incident Response OpenEnv</title></head>
63
  <body style="font-family:sans-serif;max-width:600px;margin:40px auto;padding:20px">
64
+ <h1>&#x1F6A8; SRE Incident Response &mdash; OpenEnv</h1>
65
+ <p>Status: <strong style="color:green">Running &#x2713;</strong></p>
66
+ <p>OpenEnv environment for training AI agents on SRE incident response.</p>
67
  <ul>
68
+ <li><a href="/health">/health</a> &mdash; Health check</li>
69
+ <li><a href="/tasks">/tasks</a> &mdash; All 3 tasks</li>
70
+ <li><a href="/docs">/docs</a> &mdash; Interactive API docs (Swagger)</li>
71
  </ul>
72
+ <p><em>Tasks: alert_classification (easy) &rarr; root_cause_analysis (medium) &rarr; remediation_planning (hard)</em></p>
73
  </body>
74
+ </html>"""
 
75
 
76
 
77
  # ── Core OpenEnv endpoints ───────────────────────────────────────────────────