/ eu-air-traffic / scripts / run_lake.sh
swadhinbiswas Package the lake cycle for Hugging Face Jobs · 9/13/2026
8a8becd
31 lines · 1.1 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
#!/usr/bin/env bash
# One lake cycle: the same sequence .github/workflows/lake.yml runs, packaged
# for a Hugging Face Job (or any container). When the dataset is mounted
# locally, set HF_SYNC=0 and the HF pull/push round-trip is skipped entirely.
set -euo pipefail

export WAREHOUSE_TARGET="${WAREHOUSE_TARGET:-local}"
export DBT_TARGET="${DBT_TARGET:-dev}"
export AIR_TRAFFIC_DUCKDB_PATH="${AIR_TRAFFIC_DUCKDB_PATH:-$PWD/warehouse/air_traffic.duckdb}"
export LAKE_WINDOW_SECONDS="${LAKE_WINDOW_SECONDS:-420}"
HF_SYNC="${HF_SYNC:-1}"

if [ "$HF_SYNC" = "1" ]; then
  uv run python -m scripts.lake_sync pull-silver
fi

uv run python -m services.sink --window-seconds "$LAKE_WINDOW_SECONDS"
uv run python -m pipelines.silver

if [ "$HF_SYNC" = "1" ]; then
  uv run python -m scripts.lake_sync push-silver
fi

uv run python -m pipelines.warehouse
uv run dbt build --project-dir dbt --profiles-dir dbt
uv run python -m pipelines.warehouse --register-gold
uv run python -m scripts.publish_motherduck
uv run python -m pipelines.quality
uv run python -m scripts.publish_site_tables
uv run python -m scripts.publish_turso