Skip to content

Commit 6168c8b

Browse files
committed
fix: pin image versions, fix DB credentials, add hf_models placeholder
- docker-compose.yml: pin postgres to v16 (postgres:latest is v18+ which changed data dir layout from /data to versioned subdir, causing container exit code 1 on existing volumes) - docker-compose.yml: inject AIRFLOW__DATABASE__SQL_ALCHEMY_CONN via environment so password comes from .env at runtime instead of being hardcoded in the Dockerfile; fix default password mismatch (was 'airflow', now consistent with POSTGRES_PASSWORD default) - airflow/Dockerfile: pin to apache/airflow:2.10.4 (was :latest); remove hardcoded SQL_ALCHEMY_CONN — now injected by docker-compose - streamlit_app/Dockerfile: add --start-period=30s to HEALTHCHECK (Streamlit takes ~30s to boot; without it depends_on:healthy could fail prematurely before the app is ready) - hf_models/.gitkeep: track placeholder so the directory exists on fresh clones — required by the text-completion-llm-service bind mount - .gitignore: allow hf_models/.gitkeep (hf_models/* + !.gitkeep) - Makefile: quickstart now runs mkdir -p hf_models to ensure the dir exists before docker compose build - README.md: fix Grafana credentials (was 'admin/admin', now points to .env); add pinned versions to Tech Stack table
1 parent e72d25d commit 6168c8b

7 files changed

Lines changed: 13 additions & 9 deletions

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ coverage.xml
3030
.ruff_cache/
3131

3232
# ── Model cache ──
33-
hf_models/
33+
hf_models/*
34+
!hf_models/.gitkeep
3435

3536
# ── Benchmark artifacts ──
3637
benchmark/data/

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ quickstart: ## One-command setup: env → build → start → load demo data
1111
@echo "══════════════════════════════════════════════════════"
1212
@test -f .env || (cp .env.example .env && echo "✓ Created .env from .env.example")
1313
@test -f .env && echo "✓ .env already exists"
14+
@mkdir -p hf_models && echo "✓ hf_models/ directory ready (HuggingFace model cache)"
1415
docker compose build
1516
docker compose up -d
1617
@echo "⏳ Waiting for services to be healthy..."

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ docker exec -it airflow airflow users create \
5555
|---|---|---|
5656
| **Streamlit** (AI Pipeline Builder) | http://localhost:8501 | — |
5757
| **Airflow** | http://localhost:8080 | admin / admin |
58-
| **Grafana** | http://localhost:3000 | admin / admin |
58+
| **Grafana** | http://localhost:3000 | admin / *GF_SECURITY_ADMIN_PASSWORD from .env* |
5959
| **Prometheus** | http://localhost:9090 | — |
6060

6161
### Try a Demo Pipeline
@@ -303,7 +303,7 @@ See [`.env.example`](.env.example) for all available variables including databas
303303
| Orchestration | Apache Airflow |
304304
| AI Agent | OpenAI / HuggingFace Transformers |
305305
| UI | Streamlit |
306-
| Containers | Docker, Docker Compose |
306+
| Containers | Docker, Docker Compose (PostgreSQL 16, Airflow 2.10.4) |
307307
| Monitoring | Prometheus + Grafana |
308308
| Testing | pytest, ruff |
309309
| CI/CD | GitHub Actions |

airflow/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Usa l'immagine ufficiale di Apache Airflow
2-
FROM apache/airflow:latest
1+
# Official Apache Airflow image (pinned for reproducibility)
2+
FROM apache/airflow:2.10.4
33

4-
# Imposta le variabili di ambiente per il database e Prometheus
5-
ENV AIRFLOW__DATABASE__SQL_ALCHEMY_CONN=postgresql+psycopg2://airflow:airflow@postgres/airflow
4+
# Metrics: export Airflow stats to Prometheus via statsd-exporter
5+
# DB connection string is injected at runtime by docker-compose (see AIRFLOW__DATABASE__SQL_ALCHEMY_CONN)
66
ENV AIRFLOW__METRICS__STATSD_ON=True
77
ENV AIRFLOW__METRICS__STATSD_HOST=statsd-exporter
88
ENV AIRFLOW__METRICS__STATSD_PORT=9125

docker-compose.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
services:
22
postgres:
3-
image: postgres:latest
3+
image: postgres:16
44
container_name: postgres
55
environment:
66
POSTGRES_USER: ${POSTGRES_USER:-airflow}
@@ -24,6 +24,8 @@ services:
2424
context: ./airflow
2525
dockerfile: Dockerfile
2626
container_name: airflow
27+
environment:
28+
- AIRFLOW__DATABASE__SQL_ALCHEMY_CONN=postgresql+psycopg2://${POSTGRES_USER:-airflow}:${POSTGRES_PASSWORD:-change-me-strong-password}@postgres/${POSTGRES_DB:-airflow}
2729
depends_on:
2830
postgres:
2931
condition: service_healthy

hf_models/.gitkeep

Whitespace-only changes.

streamlit_app/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ ENV PYTHONPATH="/app"
1616

1717
EXPOSE 8501
1818

19-
HEALTHCHECK --interval=30s --timeout=10s --retries=3 \
19+
HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \
2020
CMD curl -f http://localhost:8501/_stcore/health || exit 1
2121

2222
CMD ["streamlit", "run", "streamlit_app/app.py", \

0 commit comments

Comments
 (0)