Scheduling and operations
The unit of work is one idempotent poll. Any scheduler can drive it, which is why the scheduler itself is not a port.
From models/myunet/:
myunet-nowcast --config config/default.json --source ftp --scheduled \
--output-dir outputs
What a poll does
Take the advisory lock, or log
BUSYand exit.Prune expired cached transfers.
List the provider — cheaply, one observation, no checkpoint read.
Check freshness against
--max-age-hours.If that issue time is already published and every output still matches its checksum, log
UP_TO_DATEand exit.Otherwise acquire the window, load the model, run, publish atomically.
Important
Step 3 before step 6 is deliberate. Composition is two-phase so that a poll finding nothing new never reads a checkpoint that may be hundreds of megabytes.
Reading the logs
Four stable tokens, suitable for alerting:
Token |
Meaning |
Normal? |
|---|---|---|
|
a new issue time is being processed |
yes |
|
the latest is already published and verified |
yes |
|
the window is incomplete or stale |
yes, often |
|
another poll holds the lock |
occasionally |
Note
WAITING is not an error and exits 0. Waiting for data that has not
been published is ordinary operation. Alerting on it will produce noise and
train people to ignore the alerts.
Three ways to drive it
A systemd timer
The OS owns scheduling, restart and logging, and a one-shot unit cannot drift.
From models/myunet/:
uv run python deploy/render_units.py
systemd-analyze verify deploy/generated/myunet.service deploy/generated/myunet.timer
The units land in models/myunet/deploy/generated/, which is gitignored
because they carry absolute host paths. The generator writes only there:
it installs nothing and enables nothing. Regenerate after moving the project.
The container loop
One artefact, portable, no host configuration. See Running in a container.
An external orchestrator
A Kubernetes CronJob, Argo, Airflow — anything that can run the one-shot
command. Set concurrencyPolicy: Forbid; the file lock is host scoped and
does not coordinate replicas.
Choosing an interval
In nowcasting, latency is the product
Polling every five minutes for hourly data costs up to five minutes of a product whose value decays in minutes, and spends about twelve listings an hour to do it.
Polling more often does not make the provider publish sooner. It only narrows the gap between publication and detection. If the provider offers a notification, use it; the polling loop is a fallback, not an ideal.
A reasonable middle ground is adaptive polling: frequent during the window when data usually arrives, relaxed outside it. The latency metric below tells you where that window is.
Worth measuring
Two signals carry most of the value:
Latency from issue time to publication. The service-level indicator that
matters. run_time and created_at in each manifest give it to you with no
extra instrumentation.
Staleness. No run published for more than twice the step is the single most useful alert. It catches a dead provider, a crash loop, a full disk and an expired credential, all with one rule.
Also worth watching: masked_output_fraction rising, repeated
IntegrityError, and polls that never reach NEW_DATA.
Failure modes
Symptom |
Likely cause |
Response |
|---|---|---|
|
the provider stopped, or names changed |
check a listing by hand |
|
a previous poll hung |
the lock releases on death; look for a stuck process |
|
corrupt or swapped bundle |
re-download; do not retry blindly |
|
reprocessing an existing issue time |
intended; use a different output directory |
|
degraded input |
raise |
Cache retention
Transfers are cached under a per-user temporary directory and expire after
--cache-ttl-hours, default 24. Cleanup runs on every execution and every
scheduled poll, including polls that publish nothing.
Important
Only managed namespace directories are pruned. Files supplied through
--input-dir are never removed, whatever their age.
Backfilling
There is no --backfill mode yet. Because runs are idempotent and keyed by
issue time, a loop works:
From models/myunet/:
for hour in $(seq 0 23); do
myunet-nowcast --config config/archive.json --source ftp \
--run-time "2026-01-15T$(printf %02d $hour):00:00Z" \
--output-dir outputs || true
done
An archive configuration — a second file such as
models/myunet/config/archive.json — uses an strftime template in
remote_directory,
which requires an explicit --run-time and therefore cannot be combined with
--scheduled.
Note
A first-class --backfill FROM..TO would be cheap, since idempotency and
issue-time keying already exist. It is simply not built.