/ eu-air-traffic / Makefile
swadhinbiswas Wire Hugging Face dataset docs, card generator and repo defaults · 9/16/2026
556d677
136 lines · 5.0 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
.PHONY: setup bootstrap run test lint format dashboard dbt api streamlit verify quality clean dbt-docs dbt-test web web-data web-build web-install collector collector-once sink sink-loop live lake-pull-silver lake-push-silver hf-card hf-card-push motherduck reference-data

PYTHON ?= .venv/bin/python

setup:
	uv venv --python 3.12 --clear
	uv pip install -e ".[dev]"

bootstrap: setup
	mkdir -p warehouse/raw warehouse/bronze warehouse/silver warehouse/gold warehouse/quarantine warehouse/checkpoints
	cp -n .env.example .env || true
	@echo "Bootstrap complete. Dirs created."

# ── Pipeline commands ─────────────────────────────────────────────────────────
run:
	$(PYTHON) -m pipelines.orchestrator

run-full: run dbt

# ── VPS collector + live API ──────────────────────────────────────────────────
collector:
	$(PYTHON) -m services.collector

collector-once:
	$(PYTHON) -m services.collector --once

live:
	$(PYTHON) -m services.collector --no-api

# ── Kafka sink (Kafka → Bronze Parquet → Hugging Face) ────────────────────────
sink:
	$(PYTHON) -m services.sink

sink-loop:
	$(PYTHON) -m services.sink --loop

# ── Lake / warehouse publishing ───────────────────────────────────────────────
lake-pull-bronze:
	$(PYTHON) -m scripts.lake_sync pull-bronze

lake-pull-silver:
	$(PYTHON) -m scripts.lake_sync pull-silver

lake-push-silver:
	$(PYTHON) -m scripts.lake_sync push-silver

motherduck:
	$(PYTHON) -m scripts.publish_motherduck

# Regenerate the aircraft/operator reference data used by the classifier.
reference-data:
	$(PYTHON) -m scripts.build_reference_data

# ── Hugging Face dataset card ─────────────────────────────────────────────────
# Render the Hub README locally, or push it (needs HF_TOKEN; refuses anything
# but swadhinbiswas/air-traffic and refuses private repos).
hf-card:
	$(PYTHON) -m scripts.hf_dataset_card

hf-card-push:
	$(PYTHON) -m scripts.hf_dataset_card --push

# ── API & Dashboard ───────────────────────────────────────────────────────────
api:
	$(PYTHON) -m uvicorn apps.main:app --host 0.0.0.0 --port 8000 --reload

streamlit:
	$(PYTHON) -m streamlit run streamlit_app.py --server.port 8501

dashboard:
	$(PYTHON) -m scripts.build_dashboard

# ── React dashboard (God's Eye View) ──────────────────────────────────────────
# Runtime data: the app reads from the API. `web-data` only generates the
# optional offline bundle for a fully static deployment.
web-data:
	$(PYTHON) -m scripts.build_web_bundle

web-install:
	cd web && npm install

web:
	cd web && npm run dev

web-build:
	cd web && npm run build

# ── dbt commands ──────────────────────────────────────────────────────────────
dbt:
	cd dbt && ../.venv/bin/dbt build --profiles-dir .

dbt-test:
	cd dbt && ../.venv/bin/dbt test --profiles-dir .

dbt-docs:
	cd dbt && ../.venv/bin/dbt docs generate --profiles-dir . && ../.venv/bin/dbt docs serve --profiles-dir .

dbt-freshness:
	cd dbt && ../.venv/bin/dbt source freshness --profiles-dir .

# ── Development ──────────────────────────────────────────────────────────────
test:
	$(PYTHON) -m pytest tests/ -v

lint:
	$(PYTHON) -m ruff check .

format:
	$(PYTHON) -m ruff check --fix .
	$(PYTHON) -m ruff format .

typecheck:
	$(PYTHON) -m mypy config ingestion pipelines apps scripts --ignore-missing-imports

verify: lint typecheck test

quality:
	$(PYTHON) -m pipelines.quality

quality-full: quality dbt-test dbt-freshness

# ── Docker ────────────────────────────────────────────────────────────────────
superset:
	docker compose -f docker/docker-compose.yml up -d superset

docker-up:
	docker compose -f docker/docker-compose.yml up -d

# ── Cleanup ──────────────────────────────────────────────────────────────────
clean:
	rm -rf warehouse/raw warehouse/bronze warehouse/silver warehouse/gold warehouse/quarantine warehouse/checkpoints
	rm -f warehouse/*.duckdb warehouse/*.duckdb.wal

clean-all: clean
	rm -rf dbt/target dbt/logs