KOGAS LNG anomaly M2 — workspace 시드 (Issue #1210)
live-run cycle (M1 partial) 이후 M2 partial — KOGAS workspace 시드 + Bytewax scale up 검증.
M2 결과
| AC | 결과 |
|---|---|
| #1 KOGAS workspace + Keycloak group | ✅ workspace kogas row 시드 (slug=kogas, keycloak_group_path=/kogas-ops, status=active) |
| #7 Bytewax replicas=1 startup | ⚠️ Bytewax dataflow 가 batch-source 처럼 exit 0 (continuous Kafka consumer 변경은 M3). simulator worker 로 동등 검증 |
| #8 sink ≥ 80% | ✅ 100% (5/5) — EQ-M2-2/4 ANOMALY 정확 감지 |
#9 DLQ <1% | ✅ 0% |
| #2-#6 LNG 시드 + 모델 + KServe | ✅ M1 (live-run cycle 그대로 운영) |
| #10 Prometheus 메트릭 | ⏸ M3 (Bytewax 정식 운영 후) |
workspace 시드 SQL
INSERT INTO workspaces (id, name, slug, keycloak_group_path, status)
VALUES (gen_random_uuid(), '한국가스공사 (KOGAS)', 'kogas', '/kogas-ops', 'active')
ON CONFLICT (slug) DO UPDATE SET name = EXCLUDED.name, status = 'active', updated_at = now();
결과: workspace 96e306dd-1829-47bd-94d0-5c7dcd5c1909.
Bytewax scale up 시도 결과
Deployment scale 0 → 1 + annotation 제거:
kubectl annotate deploy gend-streaming-anomaly gend.io/scaled-down-reason- --overwrite
kubectl scale deploy gend-streaming-anomaly --replicas=1
5건 LNG event publish:
events = [
{"equipment_id":"EQ-M2-1","vibration_rms":0.5,...}, # normal
{"equipment_id":"EQ-M2-2","vibration_rms":3.4,...}, # anomaly
...
]
Bytewax Pod 결과: exit code 0 (Completed) 후 K8s restart 시도 → CrashLoopBackOff. dataflow 가 5 메시지 처리 후 정상 종료 — Kafka consumer auto_offset_reset=earliest 가 fetch 완료 시점에 종료. 본 M2 partial 범위 밖.
Workaround: simulator worker (live-run cycle 의 lng_worker.py) 로 동일 흐름 검증:
[lng] EQ-M2-1 vib=0.5 pred=1 normal
[lng] EQ-M2-2 vib=3.4 pred=-1 ANOMALY ← 정확 감지
[lng] EQ-M2-3 vib=0.4 pred=1 normal
[lng] EQ-M2-4 vib=3.1 pred=-1 ANOMALY ← 정확 감지
[lng] EQ-M2-5 vib=0.6 pred=1 normal
processed: 5, dlq: 0
Sink offset: streaming.anomaly_result 9+4+2 = 15 (이전 cycle 10 + 본 M2 5).
Bytewax 최종 상태
kubectl annotate deploy gend-streaming-anomaly \
gend.io/scaled-down-reason="Bytewax flow batch-source exit 0 (continuous-source 변경은 M3) — simulator worker 로 5/5 검증 완료" \
--overwrite
kubectl scale deploy gend-streaming-anomaly --replicas=0
M3 잔여
- Bytewax flow continuous-source 변환 (apps/streaming/src/gend_streaming/bytewax_jobs/anomaly_detection.py 수정 — KafkaSource 의 무한 consumption 유지 + graceful shutdown only on SIGTERM)
- KEDA ScaledObject (Kafka lag autoscale)
- Prometheus 메트릭 6종 실연동 (gend_streaming_*)
- Feast online materialize (현재 worker 가 직접 feature 추출 — M3 에서 Feast online lookup)
- lineage emit (OpenLineage)
- UI components/streaming/ (M3 UI partial 은 PR #1263 으로 완료)