Skip to content

Serve beta gallery art from the CDN, drop it from git#562

Open
ptrlrd wants to merge 1 commit into
mainfrom
fix/beta-images-off-git
Open

Serve beta gallery art from the CDN, drop it from git#562
ptrlrd wants to merge 1 commit into
mainfrom
fix/beta-images-off-git

Conversation

@ptrlrd

@ptrlrd ptrlrd commented Jul 3, 2026

Copy link
Copy Markdown
Owner

Why

Recent CI builds went from ~2m30s (#552) to ~2h4m (#557), and #559 has been building for ~an hour. It's not any PR's code — the "Build & push images" job relies on the runner's warm local Docker cache, and on a cold build it re-exports and re-pushes the 2.6 GB backend static layer. The ~12k committed beta images under backend/static/images/beta/ are the bulk of that layer.

The art already lives on the CDN (cdn.spire-codex.com/beta/<version>/) — verified every committed version returns 200 for both webp and png — so git doesn't need its own copy.

What changed

  • Removed the 12,326 committed beta image files (v0.103.0–v0.107.0) and the beta/latest symlink.
  • Added backend/static/images/beta/manifest.json (389 KB) listing every beta file per version, so the /images gallery can still enumerate them without the files on disk.
  • Reworked images.py:
    • Beta version list + resolution read the manifest instead of scanning the filesystem.
    • Beta category listing builds from the manifest; display URLs still point at /static/images/beta/..., which the frontend rewrites to the CDN.
    • The download-zip endpoint fetches beta bytes from the CDN (they're no longer on disk). Non-beta categories are untouched (still read the on-disk main tree).

Verified

With the files removed from disk, the manifest enumeration matches the previous on-disk counts exactly: cards 611, monsters 22, ui 250, backgrounds 69 (v0.107.0); versions list and latest (v0.106.1) resolve; non-beta cards still reads the main tree (1229). parser_paths only reads the beta tree at parse time (when sync-images has freshly populated it), and data_service's image count already ignores beta archives — so nothing else breaks.

Follow-ups (not in this PR)

  • The beta ingest pipeline should regenerate/append manifest.json for each new beta (it's currently static through v0.107.0). Until then, v0.108.0 won't show in the /images gallery — but it wasn't showing before either (the gallery's latest is v0.106.1), so no regression.
  • Bumping the gallery's latest to the current beta is a separate change.

The ~12k committed beta images under backend/static/images/beta/ were the
bulk of the 2.6 GB backend image layer. A cold Docker build re-exports and
re-pushes that whole layer, which is why recent CI builds jumped from ~2.5
min to ~2 hours. The art already lives on the CDN
(cdn.spire-codex.com/beta/<version>/), so git doesn't need its own copy.

Removed the committed beta image files and the latest symlink. Added
beta/manifest.json listing every beta file per version so the /images
gallery can still enumerate them. Reworked images.py: the beta gallery
reads the manifest (display URLs still point at /static, which the frontend
rewrites to the CDN), and the download endpoint fetches beta bytes from the
CDN since they are no longer on disk. Non-beta categories are unchanged.

Verified the manifest enumeration matches the previous on-disk counts
(cards 611, monsters 22, ui 250, backgrounds 69 for v0.107.0) with the
files removed, and that non-beta categories still read the main tree.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant