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"]