2026-10-09 01:11:02 +07:00
# 📦 MERICA Pipeline Bundles (Data Lakehouse Production Assets)
2026-10-08 19:33:15 +07:00
2026-10-09 01:01:44 +07:00
> **Repositori Resmi**: **Single Source of Truth (SSOT)** Aset Konfigurasi Pipeline, Model dbt Medallion, Metadata, & Custom Operators untuk **MERICA Data Lakehouse**
2026-10-09 01:11:02 +07:00
> **Status**: **General Availability (GA) v1.0 — Production Ready**
> **Integrasi Platform**: Apache Airflow 3 Native Git DAG Bundles (`GitDagBundle` AIP-66) & dbt Core
2026-10-08 19:33:15 +07:00
---
2026-10-09 01:01:44 +07:00
## 🏛️ 1. Ikhtisar Repositori
2026-10-08 19:33:15 +07:00
2026-10-09 01:11:02 +07:00
Repositori ** `merica-pipelines` ** adalah **Single Source of Truth (SSOT)** yang mengisolasi seluruh logika bisnis pipeline data dan model analitik dari runtime engine platform MERICA Studio dan Apache Airflow.
2026-10-08 19:33:15 +07:00
2026-10-09 01:01:44 +07:00
Dengan arsitektur **Git DAG Bundles (AIP-66)** Apache Airflow 3:
2026-10-09 01:11:02 +07:00
* * *Sinkronisasi Otomatis Tanpa Restart**: Setiap berkas konfigurasi YAML di repositori ini secara otomatis disinkronkan ke Airflow runtime dalam interval **30 detik** tanpa mematikan atau me-restart scheduler/webserver.
* * *Canvas Interaktif MERICA Studio**: Konfigurasi YAML di repositori ini langsung dibaca dan dirender menjadi node-edge pipeline pada antarmuka visual MERICA Studio Canvas.
* * *Distribusi Terpusat**: Pengguna appliance MERICA Studio cukup mengarahkan URL repositori ini pada konfigurasi lingkungan untuk mendapatkan katalog pipeline terbaru.
2026-10-08 19:33:15 +07:00
---
2026-10-09 01:01:44 +07:00
## 📁 2. Struktur Direktori Repositori
2026-10-08 19:33:15 +07:00
```text
2026-10-09 01:11:02 +07:00
merica-pipelines/
2026-10-09 01:01:44 +07:00
├── README.md # Dokumentasi utama repositori
├── RELEASE_NOTES.md # Catatan rilis resmi v1.0 GA
2026-10-09 01:11:02 +07:00
├── TESTING.md # Panduan audit dan validasi aset pipeline
2026-10-09 01:01:44 +07:00
├── requirements.txt # Dependensi testing Python (pytest, ruff)
├── configs/ # Konfigurasi pipeline deklaratif (*.yaml)
│ ├── example_permits_medallion_dbt_postgres.yaml # Referensi E2E Medallion dbt
│ ├── ingestion_api_spku_air_quality.yaml # IoT Real-time Air Quality
2026-10-08 19:33:15 +07:00
│ ├── ingestion_db_environmental_permits_cdc.yaml # DB Transactional CDC (Sling)
2026-10-09 01:01:44 +07:00
│ └── ingestion_gws_waste_reports.yaml # Google Sheets Extractor & Sanitizer
├── dags/ # Airflow 3 DAG Factory & Custom Operators
│ ├── dag_factory.py # Dynamic DAG generator berbasis YAML deklaratif
│ └── helpers/ # Multi-engine execution operators
│ ├── base_lakehouse_operator.py
│ ├── duckdb_operator.py
│ ├── pyiceberg_operator.py
│ ├── pyspark_operator.py
│ ├── ge_lakehouse_operator.py
│ ├── dbt_trino_operator.py
│ ├── sling_helper.py
│ ├── storage_helper.py
│ ├── api_helper.py
│ ├── gws_helper.py
│ ├── merica_alert_hook.py
│ └── sitomat_callback_operator.py
├── dbt/ # Model SQL dbt Core Medallion
│ ├── dbt_project.yml # Konfigurasi dbt project
│ ├── profiles.yml # Koneksi profile dbt
2026-10-08 19:33:15 +07:00
│ └── models/
2026-10-09 01:01:44 +07:00
│ ├── silver/ # Deduplikasi CDC & Data Cleansing
│ └── gold/ # Data Mart, ISPU harian, & Agregasi KPI
├── metadata/ # Metadata visual posisi node kanvas (*.json)
2026-10-09 01:11:02 +07:00
├── samples/ # Dataset referensi untuk validasi lokal
2026-10-09 01:01:44 +07:00
├── schemas/ # Kontrak skema dataset (.gitkeep)
2026-10-09 01:11:02 +07:00
├── docs/ # Panduan teknis spesifikasi pipeline
2026-10-09 01:01:44 +07:00
└── tests/ # Automated unit tests untuk seluruh operator
2026-10-08 19:33:15 +07:00
```
---
2026-10-09 01:11:02 +07:00
## 📋 3. Katalog Pipeline Kanonikal
2026-10-08 19:33:15 +07:00
2026-10-09 01:01:44 +07:00
| Nama Pipeline | Domain | Jadwal | Engine & Alur Medallion |
2026-10-08 19:33:15 +07:00
| :--- | :--- | :--- | :--- |
2026-10-09 01:01:44 +07:00
| `example_permits_medallion_dbt_postgres` | Perizinan Lingkungan | `0 8 * * *` | **E2E Medallion** : Sling CDC $\rightarrow$ GE Bronze $\rightarrow$ dbt Silver $\rightarrow$ GE Silver $\rightarrow$ dbt Gold $\rightarrow$ Callback. |
| `ingestion_db_environmental_permits_cdc` | AMDAL / UKL-UPL | `0 */2 * * *` | **Log CDC** : Replikasi intensif Postgres DB $\rightarrow$ S3 Bronze Parquet $\rightarrow$ DuckDB Silver $\rightarrow$ dbt Gold. |
| `ingestion_api_spku_air_quality` | Kualitas Udara (SPKU) | `0 4 * * *` | **Sliding Window** : REST API JSON $\rightarrow$ Bronze S3 $\rightarrow$ DuckDB Iceberg $\rightarrow$ GE Suite $\rightarrow$ dbt Gold Mart. |
| `ingestion_gws_waste_reports` | Sampah & Limbah B3 | `0 4 * * *` | **GWS Sanitizer** : Google Sheets $\rightarrow$ Sanitasi Regex $\rightarrow$ S3 Bronze $\rightarrow$ PyIceberg Silver $\rightarrow$ dbt Gold. |
2026-10-08 19:33:15 +07:00
---
2026-10-09 01:11:02 +07:00
## ⚙️ 4. Cara Penggunaan Bersama MERICA Studio Appliance
2026-10-08 19:33:15 +07:00
2026-10-09 01:11:02 +07:00
Arahkan variabel lingkungan di `.env` file **MERICA Studio / Standalone** ke URL repositori ini:
2026-10-08 19:33:15 +07:00
2026-10-09 01:01:44 +07:00
```bash
2026-10-09 01:11:02 +07:00
# Konfigurasi repositori pipeline di .env:
GIT_PIPELINE_REPO_URL = https://repo.sicabe.com/merica-dlh/merica-pipelines.git
2026-10-09 01:01:44 +07:00
GIT_PIPELINE_REPO_BRANCH = main
GIT_PIPELINE_REPO_SUBDIR = dags
2026-10-08 19:33:15 +07:00
2026-10-09 01:11:02 +07:00
# Kredensial repositori git (kosongkan jika repositori dapat diakses tanpa autentikasi):
2026-10-09 01:01:44 +07:00
GIT_PIPELINE_REPO_USER =
GIT_PIPELINE_REPO_TOKEN =
```
2026-10-08 19:33:15 +07:00
2026-10-09 01:11:02 +07:00
Ketika stack MERICA Studio dijalankan (`./scripts/01_install_stack.sh` ), Airflow 3 DAG Processor akan otomatis mengunduh repositori ini dan menyajikan seluruh DAG pada antarmuka web Airflow ([http://localhost:14080 ](http://localhost:14080 )) serta MERICA Studio Canvas ([http://localhost:14000 ](http://localhost:14000 )).
2026-10-09 01:01:44 +07:00
---
## 🛠️ 5. Menambahkan Pipeline Baru
2026-10-09 01:11:02 +07:00
1. **Tambahkan berkas konfigurasi YAML** di direktori `configs/<nama_pipeline>.yaml` .
2. ** (Opsional) Tambahkan model dbt** di direktori `dbt/models/silver/` atau `dbt/models/gold/` .
2026-10-09 01:01:44 +07:00
3. **Commit & Push** :
2026-10-08 19:33:15 +07:00
```bash
2026-10-09 01:01:44 +07:00
git add configs/<nama_pipeline>.yaml
git commit -m "feat(pipeline): add new pipeline"
2026-10-08 19:33:15 +07:00
git push origin main
` ``
2026-10-09 01:11:02 +07:00
4. **Verifikasi**: Dalam waktu 30 detik, pipeline baru akan terdeteksi dan aktif secara otomatis di Airflow dan MERICA Studio.
2026-10-08 19:33:15 +07:00
---
2026-10-09 01:11:02 +07:00
## 🧪 6. Pengujian Unit Lokal
2026-10-08 19:33:15 +07:00
2026-10-09 01:01:44 +07:00
` ``bash
pip install -r requirements.txt
pytest tests/ -v
` ``