Serve beta gallery art from the CDN, drop it from git#562
Open
ptrlrd wants to merge 1 commit into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
beta/latestsymlink.backend/static/images/beta/manifest.json(389 KB) listing every beta file per version, so the/imagesgallery can still enumerate them without the files on disk.images.py:/static/images/beta/..., which the frontend rewrites to the CDN.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-betacardsstill reads the main tree (1229).parser_pathsonly reads the beta tree at parse time (when sync-images has freshly populated it), anddata_service's image count already ignores beta archives — so nothing else breaks.Follow-ups (not in this PR)
manifest.jsonfor each new beta (it's currently static through v0.107.0). Until then, v0.108.0 won't show in the/imagesgallery — but it wasn't showing before either (the gallery'slatestis v0.106.1), so no regression.latestto the current beta is a separate change.