From 2f613e4f11ff9ed5218f70dc68958aaa7b59167a Mon Sep 17 00:00:00 2001 From: Lance Walters Date: Sat, 5 Dec 2026 00:29:11 -0500 Subject: [PATCH] fix(osint): run the PR #72 summarizer (fail-loudly + concurrent map phase) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The resilience fix sirius/osint-dashboard@fb5285d (PR #72) was merged but never deployed: ns osint still ran the 11/19 image amd64-fe2b5df369d0, which has neither the concurrent map phase nor NousAPIError, so a non-retryable Nous rejection was swallowed as an empty completion and the analyst idled for nine days without a single signal. * pin deploy/osint-news-summarizer to the CI-built amd64-fb5285df7f38 (build run 1497 / job 2165, manifest sha256:e2387f90...4de52) * pin osint-analyst-exporter to the same tag — it borrows the summarizer image for python3 + psycopg2, and two tags for one image read as drift * SUMMARY_MAP_CONCURRENCY=16 next to BATCH_SIZE: ~20 s per map call, the 746-batch recap measured 951 s at 16 (8 projects to ~98 min) * README: image inventory + a section on the new behaviour and log line --- apps/base/osint/README.md | 17 ++++++++++++++++- apps/base/osint/analyst-exporter.yaml | 8 ++++++-- apps/base/osint/configmap.yaml | 7 +++++++ apps/base/osint/news-summarizer-deployment.yaml | 7 ++++++- 4 files changed, 35 insertions(+), 4 deletions(-) diff --git a/apps/base/osint/README.md b/apps/base/osint/README.md index f9676ee..27845bf 100644 --- a/apps/base/osint/README.md +++ b/apps/base/osint/README.md @@ -15,7 +15,7 @@ instead of a host Docker container on the Pi. | `osint-camera-service` | same app image | public-camera discovery + snapshots (PVC `osint-camera-snapshots` 3 Gi, shared with the app) | | `osint-titiler` | `forgejo…/sirius/titiler:0.26.0` | SAR COG tile proxy, exposed same-origin at `/titiler` | | `osint-news-scraper` | `forgejo…/sirius/osint-news-scraper:amd64-58f71f5b4520` | Scrapy news scraper loop | -| `osint-news-summarizer` | `forgejo…/sirius/osint-news-summarizer:amd64-fe2b5df369d0` | "analyst" — Nous Portal briefs every 15 min + 23:00 recap | +| `osint-news-summarizer` | `forgejo…/sirius/osint-news-summarizer:amd64-fb5285df7f38` | "analyst" — Nous Portal briefs every 15 min + 23:00 recap | Every workload is pinned to `kubernetes.io/hostname: siriussec` (Gateway/Envoy co-location + local-path PVs). @@ -141,6 +141,21 @@ because `chat()` swallows non-200s and returns an empty string. It is set in `configmap.yaml`; changing it in the UI (`PUT /api/settings`) only takes effect when the env var is empty, because `resolve_model()` prefers the env. +## Analyst resilience + map concurrency (PR #72) + +`SUMMARY_MAP_CONCURRENCY` (16, in `configmap.yaml`) sets how many map calls are +in flight. Each call is a ~20 s wall clock, so the phase is latency-bound: the +746-batch recap measured **951 s** end-to-end at 16, where 8 is projected at +~98 min. The code default is also 16; the env var is pinned so a default change +upstream cannot silently stretch the 15-min interval past its window. + +A non-retryable Nous rejection (400/404/422 — e.g. a retired model id) now +raises `NousAPIError` and aborts the run with `rc=1` instead of being swallowed +as an empty completion, so the failure shows up in the pod log on the *first* +tick rather than as nine days of "idle" ticks. The per-run summary line is +`summarize done kind= summary_id=… model=… batches=… articles=… +ticker=… map=… elapsed=…s`. + ## Analyst grading (PR #53 + #54) The map call scores every article **0-100** against a rubric in the same request diff --git a/apps/base/osint/analyst-exporter.yaml b/apps/base/osint/analyst-exporter.yaml index 0c975e1..a3c7dbf 100644 --- a/apps/base/osint/analyst-exporter.yaml +++ b/apps/base/osint/analyst-exporter.yaml @@ -21,7 +21,10 @@ # Why the summarizer image: it is the only image in this namespace that already # ships psycopg2 and a python3, and it is pinned by tag (no floating base). The # script uses the stdlib HTTP server, so nothing is installed at runtime and no -# new image build is needed. Revisit if that image is ever replaced. +# new image build is needed. It tracks the summarizer's own pin (currently +# amd64-fb5285df7f38) — bump BOTH together; two different tags for one image in +# one namespace reads as drift in an audit, and the exporter only needs the +# interpreter + psycopg2, which every summarizer build carries. --- apiVersion: v1 kind: ConfigMap @@ -217,7 +220,8 @@ spec: containers: - name: exporter # Pinned summarizer image: python3 + psycopg2, see header comment. - image: forgejo.siriusdevops.com/sirius/osint-news-summarizer:amd64-fe2b5df369d0 + # Kept equal to the summarizer pin in news-summarizer-deployment.yaml. + image: forgejo.siriusdevops.com/sirius/osint-news-summarizer:amd64-fb5285df7f38 imagePullPolicy: IfNotPresent command: ["python", "/opt/exporter/exporter.py"] env: diff --git a/apps/base/osint/configmap.yaml b/apps/base/osint/configmap.yaml index 1ef4fab..1fb953d 100644 --- a/apps/base/osint/configmap.yaml +++ b/apps/base/osint/configmap.yaml @@ -78,6 +78,13 @@ data: # batches risk timing out and silently contributing nothing to the reduce # phase. BATCH_SIZE: "4" + # Map-phase fan-out (PR #72). Each map call is a ~20 s wall clock, so the + # phase is latency-bound, not CPU-bound: the 746-batch recap measured 951 s + # end-to-end at 16 in flight, where 8 is projected at ~98 min. 16 is also the + # summarizer's DEFAULT_SUMMARY_MAP_CONCURRENCY; it is pinned here so a future + # code default change cannot silently stretch the 15-min interval past its + # window. + SUMMARY_MAP_CONCURRENCY: "16" # Map-phase grading (PR #53): the map call scores every article 0-100 against # a rubric and only blocks >= SUMMARY_MIN_SCORE reach the brief. When nothing # clears the bar the top SUMMARY_FALLBACK_TOP are used so the HUD is not blank diff --git a/apps/base/osint/news-summarizer-deployment.yaml b/apps/base/osint/news-summarizer-deployment.yaml index 264da5b..931a029 100644 --- a/apps/base/osint/news-summarizer-deployment.yaml +++ b/apps/base/osint/news-summarizer-deployment.yaml @@ -39,7 +39,12 @@ spec: kubernetes.io/arch: amd64 containers: - name: news-summarizer - image: forgejo.siriusdevops.com/sirius/osint-news-summarizer:amd64-fe2b5df369d0 + # amd64-fb5285df7f38 = sirius/osint-dashboard@fb5285d (PR #72, merged): + # the map phase runs concurrently (SUMMARY_MAP_CONCURRENCY) and a + # non-retryable Nous rejection raises NousAPIError instead of being + # swallowed, so a wedged analyst fails loudly instead of idling for + # nine days on silent empty completions (card t_22334588 / t_2ae9f0c0). + image: forgejo.siriusdevops.com/sirius/osint-news-summarizer:amd64-fb5285df7f38 imagePullPolicy: IfNotPresent # Loop: batch the last window, call Nous Portal, write summaries. command: ["python", "run_news_summarizer.py"] -- 2.52.0