Rewrite chromium wrapper.sh as a Go binary#234
Draft
sjmiller609 wants to merge 1 commit intomainfrom
Draft
Conversation
Replaces the bash wrapper.sh shipped in both browser images with a single
Go binary (server/cmd/wrapper) that detects the headful vs headless
profile from supervisor's conf.d at boot.
The Go wrapper preserves behaviour parity with the bash scripts but
removes serial dead time on the boot path:
- Phase A starts xorg/xvfb, dbus, and chromedriver in a single
supervisorctl invocation; readiness is then probed concurrently.
- Envoy bootstrap (cert generation, NSS DB, template render) runs
in a goroutine alongside Phase A. Phase B gates on it because
chromium reads the system CA trust store at process start.
- Phase B starts chromium, kernel-images-api, and (headful) mutter
+ optional neko in one call so their bring-up overlaps chromium boot.
- Final readiness waits on the union of CDP, chromedriver,
forward-proxy, and (when enabled) neko + envoy in parallel.
Per-service tweaks:
- supervisor confs: startsecs=2 → 0 so supervisorctl start returns
as soon as the program is launched (Go probes readiness directly).
- init-envoy.sh: drop the trailing 50-iteration port poll and
curl-through-proxy test; the Go wrapper's waitAllReady covers it.
- Kraftfile cmd updated from /wrapper.sh to /wrapper.
Cosmetic + non-critical work (pulseaudio, --no-sandbox infobar
dismissal) runs off the hot path.
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
Replaces the bash
wrapper.shshipped inchromium-headfulandchromium-headlesswith a single Go binary (server/cmd/wrapper) that detects the profile at boot from supervisor'sconf.d(xorg.conf→ headful,xvfb.conf→ headless).The Go wrapper preserves behaviour parity with the bash scripts but removes serial dead time on the boot path:
xorg/xvfb,dbus, andchromedriverin a singlesupervisorctlinvocation; readiness is then probed concurrently.chromium,kernel-images-api, and (headful)mutter+ optionalnekoin one call so their bring-up overlaps chromium boot rather than trailing CDP.Per-service tweaks:
startsecs=2→0sosupervisorctl startreturns as soon as the program is launched (the Go wrapper probes readiness directly).init-envoy.sh: drop the trailing 50-iteration port poll and curl-through-proxy test; the Go wrapper'swaitAllReadycovers both.Kraftfilecmdupdated from/wrapper.shto/wrapper.Cosmetic + non-critical work (
pulseaudio,--no-sandboxinfobar dismissal) runs off the hot path.Test plan
go build ./cmd/wrapperandgo vet ./cmd/wrapperpassENABLE_WEBRTC=true)INST_NAME/METRO_NAME/XDS_SERVER/KERNEL_INSTANCE_JWTare setRUN_AS_ROOT=trueheadful flow still dismisses the--no-sandboxinfobar