Commit Graph

698 Commits

Author SHA1 Message Date
Janis Eccarius 6765c5162d fix(spark-analytics): set HOME=/tmp so pip can write under non-root user 65534
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-21 15:42:50 +02:00
Janis Eccarius 4395415985 fix(spark-analytics): add --no-cache-dir to pip install for nonexistent home dir
User 65534 has no home directory; pip cache write to /nonexistent fails. Skip cache.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-21 15:41:41 +02:00
Janis Eccarius ca78173a56 feat(spark-analytics): switch webview to PostgreSQL, always write analytics to DB
- Rewrite webview serve.py to query PostgreSQL analytics tables via psycopg2
  instead of reading CSV files from PVC; PVC mount removed from Deployment
- Remove isPgnMode guard from all 4 original jobs so results always write to DB
  regardless of whether input comes from game_records or a Lichess PGN dump
- Add JDBC write-back to all 7 new analytics jobs (game_length_distribution,
  game_length_by_result, color_advantage, elo_distribution, time_control_stats,
  hourly_activity, weekly_activity, rating_mismatch, termination_stats)
- Add analytics_component_sizes JDBC write to PlayerGraphJob
- Add NOWCHESS_PGN_PATH staging patches for the 7 new CronJobs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-21 15:35:32 +02:00
Janis Eccarius 4379c0e867 fix(secret): update INTERNAL_SECRET value in ncs-internal-secret 2026-06-21 15:09:50 +02:00
Janis Eccarius a190d50a09 feat(spark-analytics): add 7 CronJobs, results webview, and LiChess staging demo
Adds CronJobs and headless driver Services for GameLengthJob, ColorAdvantageJob,
EloDistributionJob, TimeControlJob, DailyActivityJob, RatingMismatchJob, and
TerminationStatsJob. All suspended by default; scheduled Saturday mornings.

Adds spark-analytics-webview: a stdlib Python HTTP server (ConfigMap + Deployment
+ Service) that reads CSV output from the spark-analytics-output PVC and renders
13 datasets as browsable HTML tables. Disabled (replicas=0) in base.

Staging overlay enables the webview (replicas=1), exposes it via Ingress at
spark-results-st.nowchess.janis-eccarius.de, and sets NOWCHESS_PGN_PATH on all
CronJobs to the Lichess Jan-2013 rated standard PGN dump for demo runs without
a NowChess database.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-21 15:09:49 +02:00
Janis Eccarius 2bc911ab81 fix(lf): Line Endings fixed 2026-06-21 15:09:47 +02:00
svc.kargo 49e9d60bb0 chore(kargo): update image tag official-bots to 0.21.0-x86_v2 on htwg-1-prod (#432) 2026-06-21 13:50:51 +02:00
svc.kargo e164e6d1a2 chore(kargo): update image tag official-bots to 0.21.0 on staging (#430) 2026-06-21 13:46:54 +02:00
svc.kargo bde04c0944 chore(kargo): update image tag tournament to 0.4.0-x86_v2 on htwg-1-prod (#431) 2026-06-21 13:46:53 +02:00
svc.kargo ea4728b111 chore(kargo): update image tag core to 0.53.0-x86_v2 on htwg-1-prod (#428) 2026-06-21 13:46:46 +02:00
svc.kargo 72e623bbf5 chore(kargo): update image tag tournament to 0.4.0 on staging (#427) 2026-06-21 13:42:52 +02:00
svc.kargo 79a2968950 chore(kargo): update image tag core to 0.53.0 on staging (#426) 2026-06-21 13:42:22 +02:00
svc.kargo 45284b6e36 chore(kargo): update image tag frontend to 0.4.3-x86_v2 on htwg-1-prod (#425) 2026-06-21 12:36:28 +02:00
lq64 0030998279 fix: add WebSocket timeout annotations and use-regex to ingresses (#419)
Add proxy-read-timeout and proxy-send-timeout (3600s) so nginx does not
drop long-lived WebSocket connections at the default 60s idle timeout.

Add use-regex: "true" to staging to match production — without it, the
ImplementationSpecific path for the game WebSocket
(/api/board/game/[A-Za-z0-9]{8}/ws) is treated as a literal string
instead of a regex and never matches real game IDs.

---------

Co-authored-by: LQ63 <lkhermann@web.de>
Reviewed-on: #419
Co-authored-by: Leon Hermann <lq@blackhole.local>
Co-committed-by: Leon Hermann <lq@blackhole.local>
2026-06-21 12:35:28 +02:00
svc.kargo fef2bb728b chore(kargo): update image tag ws to 0.17.0-x86_v2 on htwg-1-prod (#423)
chore(kargo): update image tag ws to 0.17.0-x86_v2 on htwg-1-prod

[View in Kargo UI](https://kargo.nowchess.janis-eccarius.de/project/nowchess-kargo/stage/htwg-1-prod)

---------

Co-authored-by: Kargo <no-reply@kargo.io>
Reviewed-on: #423
Co-authored-by: svc.kargo <kargo@blackhole.local>
Co-committed-by: svc.kargo <kargo@blackhole.local>
2026-06-21 12:35:21 +02:00
svc.kargo 3822f2a77f chore(kargo): update image tag frontend to 0.4.3 on eu-central-1-prod (#424) 2026-06-21 11:13:22 +02:00
svc.kargo 11ede2b94c chore(kargo): update image tag ws to 0.17.0 on eu-central-1-prod (#422) 2026-06-21 11:12:42 +02:00
svc.kargo 4916dc590f chore(kargo): update image tag frontend to 0.4.3 on staging (#421) 2026-06-21 11:08:31 +02:00
Janis Eccarius c39661828b fix: wire analysis service to ingress across all clusters
Add /api/analysis → nowchess-analysis-active:8087 path rule to
eu-central-1-staging, eu-central-1-prod, and htwg-1-prod ingresses.
Rule placed before the /api catch-all so nginx routes correctly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-21 10:32:01 +02:00
svc.kargo 994a709f44 chore(kargo): update image tag ws to 0.17.0 on staging (#420) 2026-06-19 12:35:52 +02:00
svc.kargo cef7823b44 chore(kargo): update image tag frontend to 0.4.2 on staging (#418) 2026-06-17 11:22:48 +02:00
Janis f655ce8ac6 fix(official-bots): resolve JWT verify key via MP env props (#417)
Reviewed-on: #417
2026-06-17 10:18:58 +02:00
Janis 93df9ee8d3 fix(official-bots): resolve JWT verify key via MP env props (#416)
The merged rollout set JWT_PUBLIC_KEY_PATH, but the running image's
config never references it, so mp.jwt.verify.publickey.location stayed
null and every token failed with "Verification key is unresolvable".

Replace it with the MicroProfile properties the runtime reads directly
(MP_JWT_VERIFY_PUBLICKEY_LOCATION, MP_JWT_VERIFY_ISSUER), pointing at the
already-mounted ncs-jwt-keys public key. No image rebuild needed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Reviewed-on: #416
2026-06-17 10:01:38 +02:00
Janis 4563782626 fix(official-bots): mount JWT public key from ncs-jwt-keys (#414)
Reviewed-on: #414
2026-06-17 09:51:15 +02:00
Janis 2d5047cc63 fix(official-bots): mount JWT public key from ncs-jwt-keys (#413)
The official-bots rollout never mounted the ncs-jwt-keys secret nor set
JWT_PUBLIC_KEY_PATH, so the service fell back to the image-baked
public.pem, which does not match the deployed signing key. Every token
failed RS256 verification -> 401.

Mount ncs-jwt-keys at /secrets/jwt and point JWT_PUBLIC_KEY_PATH there,
mirroring account/core/tournament. Verify-only, no private key.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Reviewed-on: #413
2026-06-17 09:43:05 +02:00
svc.kargo 669159b098 chore(kargo): update image tag frontend to 0.4.1 on eu-central-1-prod (#412) 2026-06-17 09:39:33 +02:00
svc.kargo 55bcbe8ee9 chore(kargo): update image tag account to 0.25.0 on eu-central-1-prod (#411) 2026-06-17 09:38:50 +02:00
svc.kargo 5d77b37f57 chore(kargo): update image tag frontend to 0.4.1-x86_v2 on htwg-1-prod (#410) 2026-06-17 09:38:03 +02:00
svc.kargo f11b96a387 chore(kargo): update image tag account to 0.25.0-x86_v2 on htwg-1-prod (#409) 2026-06-17 09:37:57 +02:00
svc.kargo 6b2c67bd77 chore(kargo): update image tag official-bots to 0.19.0 on eu-central-1-prod (#408) 2026-06-17 09:37:51 +02:00
svc.kargo 4850303432 chore(kargo): update image tag official-bots to 0.19.0-x86_v2 on htwg-1-prod (#407) 2026-06-17 09:37:50 +02:00
svc.kargo 793b92e1e3 chore(kargo): update image tag official-bots to 0.19.0 on staging (#406) 2026-06-17 09:33:57 +02:00
svc.kargo b8b7d5aa47 chore(kargo): update image tag account to 0.25.0 on staging (#405) 2026-06-17 09:33:26 +02:00
svc.kargo 79dc37ffb5 chore(kargo): update image tag frontend to 0.4.1 on staging (#404) 2026-06-17 09:22:11 +02:00
Janis dbf9a551a7 fix(ingress): route /api/bots to official-bots service (#403)
/api/bots/official/join-tournament returned 404 because no ingress
rule matched the prefix; requests fell through to the /api catch-all
and hit nowchess-core (8080), which has no such endpoint.

Add /api/bots Prefix rule -> nowchess-official-bots-active:8088 in
all three environments (staging, eu-central-1-prod, htwg-1-prod).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Reviewed-on: #403
2026-06-17 08:58:49 +02:00
Janis 06e70a5e8a feat(spark): add staging overlay, scale down prod
- spark-cluster/eu-central-1-staging: namespace nowchess-staging, ingress
  patched to spark-st.* / spark-history-st.* with TLS + cert-manager
- spark-analytics/eu-central-1-staging: namespace nowchess-staging, image
  pinned to 0.2.0, all CronJob + live-dashboard patches carried over
- eu-central-1/argo-apps: spark-cluster-staging + spark-analytics-staging
  ArgoCD apps pointing at new staging overlays
- spark-cluster/eu-central-1-prod: scale spark-master and spark-worker to 0

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-17 08:48:31 +02:00
svc.kargo f38fd0302c chore(kargo): update image tag frontend to 0.4.0 on staging (#402) 2026-06-17 08:24:42 +02:00
Janis Eccarius 95dc346064 fix(spark): use file:/// so driver serves analytics.jar to executors over HTTP 2026-06-17 01:33:13 +02:00
Janis Eccarius fe75a75a2e fix(spark): add headless Services + driver.host/port so executors can reach driver pods 2026-06-17 01:29:35 +02:00
Janis Eccarius 27920182cb fix(spark): raise executor.memory to 512m - JVM minimum heap is 471m 2026-06-17 01:23:25 +02:00
Janis Eccarius 0dbfd4d35c fix(spark): raise worker memory to 512m/1Gi to fit executor overhead 2026-06-17 01:20:59 +02:00
Janis Eccarius a0f96e9985 fix(spark): raise driver.memory to 512m - Spark 4.x minimum is 450m 2026-06-17 01:20:31 +02:00
Janis Eccarius 54e0561b43 fix(spark): fit executor within 256m worker - instances=1, memory=200m, driver=256m 2026-06-17 01:17:17 +02:00
Janis Eccarius 7eecc23510 chore(spark): minimal cluster - 1 master + 1 worker, reduced limits, no streaming 2026-06-17 01:09:36 +02:00
Janis Eccarius d34a78c921 chore(spark): scale down all Spark workloads to free cluster resources 2026-06-17 01:05:30 +02:00
Janis Eccarius 0070139a37 fix(spark): reduce worker cores to 2 per worker (4 total) 2026-06-17 00:47:51 +02:00
Janis Eccarius 1b75466b3e fix(spark): cap executor cores to prevent job starvation
Spark standalone gives executors all worker cores by default.
LiveDashboard was consuming all 8 cores (2 workers x 4 cores).
- streaming: spark.executor.cores=1 (uses 1 core total)
- batch jobs: spark.executor.cores=2 (uses 4 cores total, 2 per executor)
Leaves headroom for concurrent streaming + batch.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-17 00:44:16 +02:00
Janis Eccarius d3feb65eb3 fix(spark): increase worker cores to 4 to allow concurrent jobs
With SPARK_WORKER_CORES=1 and 2 workers the cluster has 2 total cores.
LiveDashboard holds both — batch jobs wait indefinitely. 4 cores per
worker gives 8 total, enough to run streaming + batch concurrently.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-17 00:41:49 +02:00
Janis Eccarius 906a8cda2c fix(sealed-secrets): migrate Helm repo URL to bitnami
bitnami-labs GitHub Pages repo (bitnami-labs.github.io/sealed-secrets)
returns 404 — chart moved to charts.bitnami.com/bitnami. Updates chart
version from 2.16.1 to 2.5.19 (controller 0.27.1 → 0.31.0). Controller
is backward-compatible with existing sealed secrets.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-17 00:40:23 +02:00
Janis Eccarius e9926cbf62 chore(argocd): re-enable auto-sync for Spark apps
Cluster stable. Re-enabling automated sync on spark-analytics and
spark-cluster. Driver DNS fix and Recreate strategy already in main,
so next sync deploys the corrected manifests.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-17 00:35:33 +02:00