Add download-beta page with live build progress#555
Open
elee1766 wants to merge 4 commits into
Open
Conversation
New /download-beta page that uses the streaming build API:
- Same look and feel as the existing /download page (same CSS,
header, footer, package rendering with icons, download counts,
version inputs, module docs previews)
- Vanilla JS instead of jQuery
- Clicking Download posts to /api/build, then navigates to
/download-beta/build/?key={hash} for live progress
- Build page shows current step label, progress bar, and
scrolling build log via SSE
- Auto-downloads the artifact on completion with a fallback
'click here' link
- If the build is already cached, skips straight to download
When the build server retries on a different worker (503 from a draining node), the SSE stream sends a 'reset' event. The frontend clears the build log, resets the progress bar, and shows a message that the build is retrying on another server.
The download-beta page now has a collapsible PGO Optimization section: - None (default): no PGO, same as before - Default: selects a pre-configured server-side profile - Upload: lets users upload their own .pprof file When a named profile is selected, it's sent as a ?pgo= query param. When a custom profile is uploaded, it's base64-encoded and sent in the POST body. A badge shows 'enabled' when PGO is active.
This reverts commit e0267c0.
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.
New
/download-betapage that provides live build progress when downloading custom Caddy builds.Pages
/download-beta-- Plugin selection/downloadpage (same CSS, header, footer, package icons, download counts, version inputs, module docs previews)POST /api/build, then navigates to the build page/download-beta/build/?key={hash}-- Build progressGET /api/build/{key}/eventsvia SSEUser flow
POST /api/buildreturns the build key/download-beta/build/?key=abc123resultevent withsuccess: true, the download starts automaticallyMultiple users building the same configuration share progress -- the first request triggers the build and everyone else joins the same stream.
Local test setup
This requires three services running together: the build worker, the portal (API), and the website (frontend). You'll also need PostgreSQL.
Related PRs
1. Build the custom Caddy binaries
Build worker binary (includes the streaming build handler):
Portal binary (includes the API handler):
2. PostgreSQL setup
Create the database and load the schema:
Seed with the top 10 plugins for testing:
3. Config files
Build worker (
buildworker.json) -- serves on:8888:{ "admin": {"disabled": true}, "apps": { "http": { "servers": { "worker": { "listen": ["127.0.0.1:8888"], "routes": [ { "match": [{"path": ["/streaming-build"]}], "handle": [{"handler": "caddy_builder_streaming", "timeout": "10m"}] }, { "match": [{"path": ["/build"]}], "handle": [{"handler": "caddy_builder", "timeout": "10m"}] } ] } } } } }Portal (
Caddyfile.portal) -- API on:4444, proxies to worker:{ order portal last admin off } :4444 { portal { dsn "postgresql://postgres:postgres@127.0.0.1:5432/caddy?sslmode=disable" build_worker_endpoint 127.0.0.1:5555 streaming_build_worker_endpoint 127.0.0.1:5556 } } # legacy build worker proxy :5555 { bind 127.0.0.1 reverse_proxy 127.0.0.1:8888 { rewrite /build } } # streaming build worker proxy :5556 { bind 127.0.0.1 reverse_proxy 127.0.0.1:8888 { rewrite /streaming-build } }Website (
Caddyfile.website) -- frontend on:2015:{ admin off } :2015 { root * <path-to-website-checkout>/src file_server templates encode zstd gzip try_files {path}.html {path} reverse_proxy /api/* 127.0.0.1:4444 }4. Run
In three terminals:
Then open http://localhost:2015/download-beta
Supervisor script