Skip to content

javihslu/foehncast

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

352 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FoehnCast — is the drive worth it?

FoehnCast

CI License: MIT

FoehnCast tells you which Swiss kiteboarding spot is worth the drive today. It pulls weather forecasts, builds features, trains a quality model, and ranks spots through an API — all following the Feature → Training → Inference (FTI) pattern from the HSLU MLOps course.

Full docs: https://javihslu.github.io/foehncast/

Reviewers: the scoring checklist maps every grading criterion to where it is implemented, with direct links to the code, docs, and live services.

How It Works

flowchart TD
  Forecasts[Weather APIs] -->|Feature pipeline| Curated[Curated features]
  Curated -->|Training pipeline| Registry[MLflow model registry]
  Curated --> Feast[Feast online store]
  Inputs[Live forecast + drive time] --> API[FastAPI]
  Feast --> API
  Registry --> API
  API --> Rank[Ranked spots]
Loading

Three pipelines, one goal:

Pipeline What it does
Feature Fetches forecasts, engineers wind features, validates data, stores parquet
Training Labels quality, trains a model, evaluates it, registers in MLflow
Inference Serves predictions via FastAPI + ranks spots for one rider profile

Quick Start

Option 1: Try the live demo (no setup)

FoehnCast Rider Console — click to open the live demo
Open the live demo → — ranked Swiss kiteboarding spots, served from Cloud Run.

What Link
Streamlit UI https://foehncast-ui-290885878569.europe-west6.run.app/
API https://foehncast-serve-290885878569.europe-west6.run.app/
Metrics https://foehncast-serve-290885878569.europe-west6.run.app/metrics

Option 2: Run locally with Docker

git clone https://github.com/javihslu/foehncast.git
cd foehncast
./scripts/bootstrap-local.sh

The script starts the local stack (Airflow, MLflow, MinIO, Prometheus, and the app) and runs a smoke test. No cloud credentials are needed.

After bootstrap, you get:

Service URL
App (FastAPI) http://127.0.0.1:8000
Airflow http://127.0.0.1:8080
MLflow http://127.0.0.1:5001
Prometheus http://127.0.0.1:9090

Try it:

curl -X POST http://127.0.0.1:8000/rank \
  -H 'content-type: application/json' \
  -d '{"spot_ids":["silvaplana","urnersee"]}'

Reproducible pipelines (DVC)

DVC lets you rerun the offline pipelines deterministically:

dvc repro          # ingest → curate → train
dvc metrics show   # check training results

Both DVC stages call the same Python modules as the Airflow DAGs, so the offline and orchestrated runs share one code path.

Tests

make test          # run the unit tests
make lint          # ruff
make coverage      # coverage report

Cloud Deployment

The cloud version runs on GCP Cloud Run. Contributors do not need cloud access; Docker is enough to run everything locally.

flowchart LR
    classDef public fill:#c8e6c9,stroke:#2e7d32,color:#0f2530
    classDef managed fill:#e3f2fd,stroke:#1565c0,color:#0f2530
    classDef svc fill:#fff3e0,stroke:#ef6c00,color:#0f2530

    UI[Streamlit UI]:::public
    APP[FastAPI App]:::public
    MLF[MLflow]:::svc
    WF[Cloud Workflows]:::svc

    BQ[(BigQuery)]:::managed
    GCS[(Cloud Storage)]:::managed
    SQL[(Cloud SQL)]:::managed

    APP --> BQ & GCS
    MLF --> SQL & GCS
    WF -->|schedules pipelines| APP
Loading

Deployment is handled by Terraform (infrastructure) and Cloud Build triggers (images). See the Cloud Architecture docs for details.

Repo Layout

src/foehncast/       # All application code (features, training, inference, monitoring)
dags/                # Airflow DAG definitions
ui/                  # Streamlit dashboard
containers/          # Dockerfiles (6 services)
scripts/             # Bootstrap and helper scripts
terraform/           # GCP infrastructure-as-code
tests/               # pytest unit tests
docs/                # MkDocs source → GitHub Pages
config.yaml          # All tuneable parameters (spots, model, APIs)
dvc.yaml             # Reproducible pipeline stages

Links

About

Predicts which Swiss kiteboarding spot is worth the drive today. A Feature → Training → Inference MLOps system: Open-Meteo forecasts, a random-forest quality model tracked in MLflow, served through FastAPI and a Streamlit app. Runs locally with Docker Compose and on GCP Cloud Run, with Prometheus and Evidently monitoring.

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors