bobaoxu2001 commited on
Commit
cfcbebf
·
1 Parent(s): c4fe0a4

Deploy: Docker-based Streamlit app with startup data generation

Browse files
.gitignore ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ __pycache__/
2
+ *.pyc
3
+ .env
4
+ *.db
5
+ *.db-journal
6
+ data/processed/results.db
7
+ data/processed/trace.jsonl
8
+ .DS_Store
9
+ .venv/
10
+ venv/
11
+ .claude/
Dockerfile CHANGED
@@ -2,18 +2,21 @@ FROM python:3.11-slim
2
 
3
  WORKDIR /app
4
 
5
- RUN apt-get update && apt-get install -y --no-install-recommends \
6
- build-essential \
7
- && rm -rf /var/lib/apt/lists/*
8
-
9
  COPY requirements.txt .
10
  RUN pip install --no-cache-dir -r requirements.txt
11
 
12
  COPY . .
13
 
 
 
 
 
 
 
 
14
  EXPOSE 7860
15
 
16
- HEALTHCHECK CMD curl --fail http://localhost:7860/_stcore/health
17
 
18
  ENTRYPOINT ["streamlit", "run", "app/Home.py", \
19
  "--server.port=7860", \
 
2
 
3
  WORKDIR /app
4
 
 
 
 
 
5
  COPY requirements.txt .
6
  RUN pip install --no-cache-dir -r requirements.txt
7
 
8
  COPY . .
9
 
10
+ # Remove __pycache__ dirs
11
+ RUN find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null; true
12
+
13
+ # Build pipeline data at image build time
14
+ ENV PYTHONPATH=/app
15
+ RUN python scripts/startup.py
16
+
17
  EXPOSE 7860
18
 
19
+ HEALTHCHECK CMD curl --fail http://localhost:7860/_stcore/health || exit 1
20
 
21
  ENTRYPOINT ["streamlit", "run", "app/Home.py", \
22
  "--server.port=7860", \
eval/__pycache__/__init__.cpython-311.pyc DELETED
Binary file (232 Bytes)
 
eval/__pycache__/failure_modes.cpython-311.pyc DELETED
Binary file (11.8 kB)
 
eval/__pycache__/metrics.cpython-311.pyc DELETED
Binary file (8.54 kB)
 
eval/__pycache__/run_eval.cpython-311.pyc DELETED
Binary file (16.9 kB)
 
pipeline/__pycache__/__init__.cpython-311.pyc DELETED
Binary file (236 Bytes)
 
pipeline/__pycache__/extract.cpython-311.pyc DELETED
Binary file (13.8 kB)
 
pipeline/__pycache__/feedback.cpython-311.pyc DELETED
Binary file (9.27 kB)
 
pipeline/__pycache__/gate.cpython-311.pyc DELETED
Binary file (4.09 kB)
 
pipeline/__pycache__/loaders.cpython-311.pyc DELETED
Binary file (4.39 kB)
 
pipeline/__pycache__/normalize.cpython-311.pyc DELETED
Binary file (3.05 kB)
 
pipeline/__pycache__/schemas.cpython-311.pyc DELETED
Binary file (5.5 kB)
 
pipeline/__pycache__/storage.cpython-311.pyc DELETED
Binary file (12.9 kB)
 
pipeline/__pycache__/validate.cpython-311.pyc DELETED
Binary file (2.83 kB)
 
scripts/startup.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Startup script: rebuild DB + seed feedback for deployment.
2
+
3
+ Run this before launching the Streamlit app to ensure data exists.
4
+ """
5
+ import sys
6
+ import os
7
+
8
+ sys.path.insert(0, os.getcwd())
9
+
10
+ from scripts.run_pipeline import run_pipeline
11
+ from scripts.seed_feedback import seed_feedback
12
+
13
+ print("=== Startup: rebuilding pipeline data ===")
14
+ run_pipeline(use_mock=True)
15
+ print("\n=== Startup: seeding feedback data ===")
16
+ seed_feedback()
17
+ print("\n=== Startup complete ===")
tests/__pycache__/__init__.cpython-311.pyc DELETED
Binary file (233 Bytes)
 
tests/__pycache__/test_eval.cpython-311-pytest-7.4.0.pyc DELETED
Binary file (36 kB)
 
tests/__pycache__/test_extract.cpython-311-pytest-7.4.0.pyc DELETED
Binary file (13.7 kB)
 
tests/__pycache__/test_feedback.cpython-311-pytest-7.4.0.pyc DELETED
Binary file (25.5 kB)
 
tests/__pycache__/test_gate.cpython-311-pytest-7.4.0.pyc DELETED
Binary file (8.53 kB)
 
tests/__pycache__/test_schemas.cpython-311-pytest-7.4.0.pyc DELETED
Binary file (32.2 kB)
 
tests/__pycache__/test_storage.cpython-311-pytest-7.4.0.pyc DELETED
Binary file (14.6 kB)
 
tests/__pycache__/test_validate.cpython-311-pytest-7.4.0.pyc DELETED
Binary file (6.46 kB)