clone

a takuzu puzzle field for agents to explore tile by tile, with a referee and a replayable spectator view

deploy: the nightly runs on slate; Fly machine is the documented fallback

dami committed cdba749
commit
cdba7498b1e4800bfcc49b0070cddd8f4e27ff14
parent
0699a9639bba7bc04e52e4f553d856faec03ad74
author
dami <gazey55@gmail.com>
1 file changed, +27 -29
Mdeploy.md56++++++++++++++----------------
M deploy.md +27 -29
@@ -8,14 +8,32 @@ Two machines on Fly.io, one app:
88 (`MOSAIC_GENERATE=1`, `MOSAIC_DAILY_PREPARE=0`). Measured on it:99 ring 1 of the daily took 40 min at 181 MB peak RSS — far too slow for1010 the nightly, fine for judging.11-- **`mosaic-nightly`** (performance-4x, scheduled `daily`, no volume):12- runs the app image once a day with the push command — generate13- tomorrow's field (`--rings all --jobs 4 --band 24`, `GOMEMLIMIT` per14- chunk) and POST it to `/push/<date>` — then stops. Minutes of15- performance-4x per day. Created with `fly machine run` (see below); it16- is not touched by `fly deploy`, so after a deploy that changes the17- engine or the script, update its image:18- `fly machine update mosaic-nightly --image <the app's new image> -y`.11+- **The nightly runs on slate** (the user's Woodpecker CI,12+ `.woodpecker/nightly.yaml`): cron `nightly` at 05:00 UTC (and the13+ manual event) builds the engine with `golang:1.27` and runs14+ `deno task push-day --tomorrow --host https://mosaic-daily.fly.dev15+ --rings all --jobs $(nproc) --band 24` with the `mosaic_push_token`16+ secret; caches live under `/var/lib/mosaic-nightly` on the agent (repo17+ is trusted for volumes). Woodpecker repo id 4, cron id 9.18+- **If slate is down**, the paid fallback is a Fly scheduled machine19+ (performance-4x, ~$0.15 per run, ~50 min for the whole G=1000 field):20+21+ ```22+ IMAGE=$(fly status -a mosaic-daily | grep -o 'mosaic-daily:deployment-[A-Z0-9]*' | head -1)23+ fly machine run "registry.fly.io/$IMAGE" -a mosaic-daily --name mosaic-nightly --region dfw \24+ --vm-size performance-4x --schedule daily --restart no \25+ -e MOSAIC_PUSH_TOKEN="$(cat ~/.config/mosaic/push-token)" \26+ -e MOSAIC_DATA=/tmp/nightly/ -e MOSAIC_GOMEMLIMIT=512MiB -e MOSAIC_DAILY= \27+ -e MOSAIC_ROLE=nightly -e MOSAIC_NIGHTLY_ARGS='--host https://mosaic-daily.fly.dev --rings all --jobs 4 --band 24'28+ fly machine start mosaic-nightly -a mosaic-daily # run it now29+ fly machine destroy mosaic-nightly --force -a mosaic-daily # when slate is back30+ ```31+32+ It runs once a day at about its creation time and stops on exit; it33+ is not touched by `fly deploy` (update its image with `fly machine34+ update mosaic-nightly --image … -y`).35+- **Or by hand from the Mac:** `cd site && deno task push-day <date>`36+ (token in `~/.config/mosaic/push-token`).1937 2038 Rollover prefers the pushed field, then one the app prepared itself2139 (only if `MOSAIC_DAILY_PREPARE=1`), then the emergency field, which `/`
@@ -32,30 +50,10 @@ fly volumes create mosaic_data --region ams --size 1
3250 fly deploy3351 ```3452 35-## The nightly machine36-37-```38-IMAGE=$(fly status -a mosaic-daily | grep -o 'registry.fly.io/mosaic-daily:deployment-[A-Z0-9]*' | head -1) # or mosaic-daily:deployment-...39-fly machine run "$IMAGE" -a mosaic-daily --name mosaic-nightly --region dfw \40- --vm-size performance-4x --schedule daily --restart no \41- -e MOSAIC_PUSH_TOKEN="$(cat ~/.config/mosaic/push-token)" \42- -e MOSAIC_DATA=/tmp/nightly/ -e MOSAIC_GOMEMLIMIT=512MiB -e MOSAIC_DAILY= \43- -e MOSAIC_ROLE=nightly -e MOSAIC_NIGHTLY_ARGS='--host https://mosaic-daily.fly.dev --rings all --jobs 4 --band 24'44-fly machine start mosaic-nightly -a mosaic-daily # run it now, by hand45-fly machine logs mosaic-nightly -a mosaic-daily # wall clock, push result46-```47-48-(The image's CMD reads MOSAIC_ROLE: `nightly` runs the push, anything49-else serves; flyctl parses a positional `sh -c` as its own `-c`.)50-A scheduled machine runs once a day at about the time it was created,51-so create (or recreate) it at the hour you want the push to land; it52-stops when the command exits.53-5453 ## Every time5554 5655 ```57-fly deploy58-fly machine update mosaic-nightly --image <new image> -y -a mosaic-daily # if the engine or push script changed56+fly deploy # the app machine; the nightly builds its own engine on slate5957 ```6058 6159 ## Configuration (fly.toml [env])