feat(comfyui-ui): add new static frontend image#3
Open
arsac wants to merge 12 commits into
Open
Conversation
- Change EXPOSE 8188 to EXPOSE 80 (scaffold uses nginx default port; Task 3 will set the port when nginx.conf is added) - Remove LABEL directives — repo convention puts labels in docker-bake.hcl and CI's docker-metadata-action sets title - Remove # syntax=docker/dockerfile:1.9 to match repo style
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- cd into app dir before docker buildx bake so default context resolves (was failing on any checkout without pre-cached image) - Add readiness check for fake backend before starting UI to eliminate proxy-test race condition Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… http 1.1) - Drop $request_uri from metadata location proxy_pass so keepalive pool is actually used for the cached endpoints - Reject COMFYUI_BACKEND with a path component explicitly; nginx gives a cryptic error otherwise - Fix misleading variable name in nginx.conf header comment - Add proxy_http_version 1.1 and Connection "" to dynamic API location so keepalive works for the catch-all proxy Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Renovate auto-derives groupSlug from groupName when the name is already a valid slug; setting both was dead config.
…s compatibility The shared .github/actions/app-options/action.yaml extracts the image version via jq select(.name == "VERSION"), so the bake variable must be named VERSION. The Dockerfile ARG remains FRONTEND_VERSION; the bake file passes VERSION's value into it. README updated to reflect the rename. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
Adds a new
apps/comfyui-ui/directory producingghcr.io/arsac/comfyui-ui:<version>. The image isnginx:alpineserving theComfy-Org/ComfyUI_frontenddist.zipas static files, with reverse-proxying and response caching to the ComfyUI backend pod.The motivation is splitting comfyui's UI tier from its GPU backend tier so the backend can scale from zero without breaking the browser UI. A follow-up PR in
arsac/home-opswill wire up the Deployment, Service, HTTPRoute, and ScaledObject that consume this image.Design notes
VERSIONtracksComfy-Org/ComfyUI_frontend(the static files shipped in this image).COMFYUI_VERSIONtrackscomfyanonymous/ComfyUI(the backend this UI is paired with). Both are Renovate-managed and grouped via a new packageRule in.renovaterc.json5so a maintainer sees bumps together.automerge: falseon the group so a human verifies thatVERSIONmatches thecomfyui-frontend-packageversion pinned by the new ComfyUI tag'srequirements.txt.VERSION(notFRONTEND_VERSION) because the shared CI.github/actions/app-options/action.yamlextracts the version viajq '.[] | select(.name == "VERSION") | .value'and would otherwise get an empty string. The Dockerfile's internalARGis stillFRONTEND_VERSION— the bake file passesVERSION's value into it.comfyui,comfyui-cache,comfyui-models) can't be shared across nodes, and ComfyUI has in-memory state (queue, history, loaded models) that can't be shared across processes regardless. A dedicated nginx image is ~50MB vs ~1-2GB for a second ComfyUI Python process, and avoids the state-split entirely./object_info,/embeddings,/extensions,/system_statsare cached for 6h withproxy_cache_use_staleon any backend error (500/502/503/504/429), so the UI loads even when the backend is scaled to 0 (after the cache has been primed once)./wsis a direct WebSocket proxy with upgrade headers. All other endpoints (/prompt,/queue,/history,/view,/upload,/api/*, etc.) are direct-proxy with no cache — they return 502 when backend is down, which is correct behavior for user-initiated actions.COMFYUI_BACKENDenv var specifies the backend Service URL. Defaults tohttp://comfyui-predictor.ai.svc.cluster.local:80. The entrypoint strips the scheme, rejects path components with a clear error, and renders the host:port into the nginx upstream block via envsubst before nginx starts.nginx -tsanity-checks the rendered config.Test plan
bats apps/comfyui-ui/test/test-build.batspasses locally — 6 tests cover static serving, proxy, cache, stale-on-backend-down, and 502 for non-cached endpoints when backend is downdocker buildx bake image-localsucceedsdocker buildx bake image-all --printresolves cleanly forlinux/amd64andlinux/arm64docker run -e COMFYUI_BACKEND=http://test:8000/api/v1— container exits with clear error.github/actions/app-optionsdry-run returnsv1.38.14forVERSION(was empty before the rename)ghcr.io/arsac/comfyui-ui:rollingis tagged and pullablecomfyui-predictorbackendOut of scope
arsac/home-ops