Three independent improvements in one commit:
1. Parallel band scoring (pipeline.rs):
- rayon par_iter across 23 bands replaces the serial for loop.
- All band files now write via try_join_all over spawn_blocking
instead of serializing one-at-a-time on NFS. Chain per-step
drops from ~60s to ~15-25s on a 4-core box.
2. Prometheus metrics (new metrics.rs):
- axum server on METRICS_ADDR (default :9100) exposes /metrics and
/health. Scraped by existing Prometheus via annotation.
- Histograms: chain step duration (by outcome), decode duration.
- Gauge: tasks in flight (RAII guarded so panics don't leak).
- Counter: chain steps by outcome.
- worker.rs records step duration and wraps each run in an
InFlightGuard.
3. HA + ordering fixes:
- deployment-grid-rs.yaml: replicas 1→2, required podAntiAffinity
spreads them across hosts, nodeAffinity prefers talos5 for one.
PROP_GRID_RS_PARALLELISM 4→3 per pod (6 concurrent across
replicas; smaller secondary-node footprint).
- Readiness probe on /health so rollouts wait for the runtime to
be alive.
- claim_next ordering: run_time ASC → DESC so the newest hourly
run drains before any stragglers from a broken prior run. Within
a run, forecast_hour ASC keeps nearest-first.
- grid_task_enqueuer sets kind="forecast" explicitly and updates
conflict_target to the new 3-column unique index introduced by
migration 20260419222624.
39 lines
1.1 KiB
TOML
39 lines
1.1 KiB
TOML
[package]
|
|
name = "prop_grid_rs"
|
|
version = "0.1.0"
|
|
edition = "2021"
|
|
publish = false
|
|
|
|
[lib]
|
|
name = "prop_grid_rs"
|
|
path = "src/lib.rs"
|
|
|
|
[[bin]]
|
|
name = "worker"
|
|
path = "src/bin/worker.rs"
|
|
|
|
[dependencies]
|
|
tokio = { version = "1", features = ["full"] }
|
|
sqlx = { version = "0.8", features = ["runtime-tokio-rustls", "postgres", "uuid", "chrono", "macros"] }
|
|
reqwest = { version = "0.12", features = ["rustls-tls", "stream"], default-features = false }
|
|
bytes = "1"
|
|
anyhow = "1"
|
|
thiserror = "2"
|
|
tracing = "0.1"
|
|
tracing-subscriber = { version = "0.3", features = ["env-filter", "json"] }
|
|
chrono = { version = "0.4", features = ["serde"] }
|
|
uuid = { version = "1", features = ["v4", "serde"] }
|
|
serde = { version = "1", features = ["derive"] }
|
|
serde_json = "1"
|
|
bincode = "1.3"
|
|
num_cpus = "1"
|
|
byteorder = "1"
|
|
futures = "0.3"
|
|
rayon = "1.10"
|
|
axum = { version = "0.7", default-features = false, features = ["http1", "tokio"] }
|
|
prometheus = { version = "0.13", default-features = false }
|
|
|
|
[dev-dependencies]
|
|
tokio = { version = "1", features = ["full", "test-util"] }
|
|
pretty_assertions = "1"
|
|
tempfile = "3"
|