Spaces:
Sleeping
Sleeping
containerization with docker and updated the readmes
Browse files- .dockerignore +16 -0
- Dockerfile +28 -0
- README.md +42 -0
- docs/HACKATHON_SUBMISSION.md +35 -0
.dockerignore
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
__pycache__
|
| 2 |
+
*.pyc
|
| 3 |
+
*.pyo
|
| 4 |
+
*.pyd
|
| 5 |
+
*.swp
|
| 6 |
+
*.tmp
|
| 7 |
+
.venv
|
| 8 |
+
.env
|
| 9 |
+
.git
|
| 10 |
+
.gitignore
|
| 11 |
+
Data
|
| 12 |
+
outputs
|
| 13 |
+
reports/*.pdf
|
| 14 |
+
configs/*.secrets.*
|
| 15 |
+
uv.lock
|
| 16 |
+
code4change_analysis.egg-info
|
Dockerfile
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# syntax=docker/dockerfile:1
|
| 2 |
+
FROM python:3.11-slim
|
| 3 |
+
|
| 4 |
+
# Runtime system dependency for scikit-learn/scipy wheels
|
| 5 |
+
RUN apt-get update \
|
| 6 |
+
&& apt-get install -y --no-install-recommends libgomp1 \
|
| 7 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 8 |
+
|
| 9 |
+
# Python env hygiene
|
| 10 |
+
ENV PYTHONDONTWRITEBYTECODE=1 \
|
| 11 |
+
PYTHONUNBUFFERED=1 \
|
| 12 |
+
PIP_NO_CACHE_DIR=1 \
|
| 13 |
+
PIP_DISABLE_PIP_VERSION_CHECK=1 \
|
| 14 |
+
PYTHONPATH=/app
|
| 15 |
+
|
| 16 |
+
WORKDIR /app
|
| 17 |
+
|
| 18 |
+
# Copy repo and install package (declared in pyproject.toml)
|
| 19 |
+
COPY . .
|
| 20 |
+
|
| 21 |
+
RUN pip install --upgrade pip setuptools wheel \
|
| 22 |
+
&& pip install .
|
| 23 |
+
|
| 24 |
+
# Streamlit default port
|
| 25 |
+
EXPOSE 8501
|
| 26 |
+
|
| 27 |
+
# Safe default: show CLI help
|
| 28 |
+
CMD ["court-scheduler", "--help"]
|
README.md
CHANGED
|
@@ -41,6 +41,48 @@ uv run court-scheduler workflow --cases 10000 --days 384
|
|
| 41 |
|
| 42 |
For a detailed walkthrough tailored for judges, see `docs/HACKATHON_SUBMISSION.md`.
|
| 43 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
## Data (DuckDB-first)
|
| 45 |
|
| 46 |
This repository uses a DuckDB snapshot as the canonical raw dataset.
|
|
|
|
| 41 |
|
| 42 |
For a detailed walkthrough tailored for judges, see `docs/HACKATHON_SUBMISSION.md`.
|
| 43 |
|
| 44 |
+
## Run with Docker (recommended for judges)
|
| 45 |
+
|
| 46 |
+
If you prefer not to install Python or uv locally, use the provided Docker image.
|
| 47 |
+
|
| 48 |
+
1) Build the image (run in repo root):
|
| 49 |
+
|
| 50 |
+
```bash
|
| 51 |
+
docker build -t code4change-analysis .
|
| 52 |
+
```
|
| 53 |
+
|
| 54 |
+
2) Show CLI help (Windows PowerShell example with volume mounts):
|
| 55 |
+
|
| 56 |
+
```powershell
|
| 57 |
+
docker run --rm `
|
| 58 |
+
-v ${PWD}\Data:/app/Data `
|
| 59 |
+
-v ${PWD}\outputs:/app/outputs `
|
| 60 |
+
code4change-analysis court-scheduler --help
|
| 61 |
+
```
|
| 62 |
+
|
| 63 |
+
3) Example CLI workflow:
|
| 64 |
+
|
| 65 |
+
```powershell
|
| 66 |
+
docker run --rm `
|
| 67 |
+
-v ${PWD}\Data:/app/Data `
|
| 68 |
+
-v ${PWD}\outputs:/app/outputs `
|
| 69 |
+
code4change-analysis court-scheduler workflow --cases 10000 --days 384
|
| 70 |
+
```
|
| 71 |
+
|
| 72 |
+
4) Run the Streamlit dashboard:
|
| 73 |
+
|
| 74 |
+
```powershell
|
| 75 |
+
docker run --rm -p 8501:8501 `
|
| 76 |
+
-v ${PWD}\Data:/app/Data `
|
| 77 |
+
-v ${PWD}\outputs:/app/outputs `
|
| 78 |
+
code4change-analysis `
|
| 79 |
+
streamlit run scheduler/dashboard/app.py --server.address=0.0.0.0
|
| 80 |
+
```
|
| 81 |
+
|
| 82 |
+
Then open http://localhost:8501.
|
| 83 |
+
|
| 84 |
+
Notes for Windows CMD: use ^ for line continuation and replace ${PWD} with the full path.
|
| 85 |
+
|
| 86 |
## Data (DuckDB-first)
|
| 87 |
|
| 88 |
This repository uses a DuckDB snapshot as the canonical raw dataset.
|
docs/HACKATHON_SUBMISSION.md
CHANGED
|
@@ -27,6 +27,41 @@ uv run streamlit run scheduler/dashboard/app.py
|
|
| 27 |
|
| 28 |
**No pre-processing required** — EDA automatically loads `Data/court_data.duckdb` when present; if missing, it falls back to `ISDMHack_Cases_WPfinal.csv` and `ISDMHack_Hear.csv` placed in `Data/`.
|
| 29 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
#### Alternative: CLI Workflow (for scripting)
|
| 31 |
```bash
|
| 32 |
# Run complete pipeline: generate cases + simulate
|
|
|
|
| 27 |
|
| 28 |
**No pre-processing required** — EDA automatically loads `Data/court_data.duckdb` when present; if missing, it falls back to `ISDMHack_Cases_WPfinal.csv` and `ISDMHack_Hear.csv` placed in `Data/`.
|
| 29 |
|
| 30 |
+
### Docker Quick Start (no local Python needed)
|
| 31 |
+
|
| 32 |
+
If you prefer a zero-setup run, use Docker. This is the recommended path for judges.
|
| 33 |
+
|
| 34 |
+
1) Build the image (from the repository root):
|
| 35 |
+
|
| 36 |
+
```bash
|
| 37 |
+
docker build -t code4change-analysis .
|
| 38 |
+
```
|
| 39 |
+
|
| 40 |
+
2) Show CLI help (Windows PowerShell example):
|
| 41 |
+
|
| 42 |
+
```powershell
|
| 43 |
+
docker run --rm `
|
| 44 |
+
-v ${PWD}\Data:/app/Data `
|
| 45 |
+
-v ${PWD}\outputs:/app/outputs `
|
| 46 |
+
code4change-analysis court-scheduler --help
|
| 47 |
+
```
|
| 48 |
+
|
| 49 |
+
3) Run the Streamlit dashboard:
|
| 50 |
+
|
| 51 |
+
```powershell
|
| 52 |
+
docker run --rm -p 8501:8501 `
|
| 53 |
+
-v ${PWD}\Data:/app/Data `
|
| 54 |
+
-v ${PWD}\outputs:/app/outputs `
|
| 55 |
+
code4change-analysis `
|
| 56 |
+
streamlit run scheduler/dashboard/app.py --server.address=0.0.0.0
|
| 57 |
+
```
|
| 58 |
+
|
| 59 |
+
Then open http://localhost:8501.
|
| 60 |
+
|
| 61 |
+
Notes:
|
| 62 |
+
- Replace ${PWD} with the full path if using Windows CMD (use ^ for line continuation).
|
| 63 |
+
- Mounting Data/ and outputs/ ensures inputs and generated artifacts persist on your host.
|
| 64 |
+
|
| 65 |
#### Alternative: CLI Workflow (for scripting)
|
| 66 |
```bash
|
| 67 |
# Run complete pipeline: generate cases + simulate
|