fix(kirocrew): make Playwright reachable at runtime + install Chromium deps on AL2023 (follow-up to #94) - #97
Conversation
…L2023 Follow-up to #94 addressing three Codex P1s posted on commit 3e4984a after that PR was merged. All three affect the KiroCrew Playwright preinstall on the AL2023 ARM64 production target. P1 #1 — playwright-cli not on the gateway service PATH packs/kirocrew/install.sh:346 (before this commit) mise's global npm prefix is only on PATH during install; the systemd unit hardcodes PATH and does not activate mise, so the global playwright-cli was unreachable from gateway-spawned agents. P1 #2 — mise node binary also missing from the gateway PATH packs/kirocrew/install.sh:358 (before this commit) playwright-cli's launcher uses '#!/usr/bin/env node'; symlinking the launcher alone still fails with 'node: No such file or directory' because node itself only lives under mise. P1 #3 — --with-deps only supports apt-get; target is AL2023 (dnf) packs/kirocrew/install.sh:367 (before this commit) Playwright's Linux dependency phase queues apt-get update/install. On AL2023 this silently no-ops or errors and leaves Chromium's system libs unavailable. Two-layer fix for #1 + #2: a) packs/kirocrew/resources/kirocrew-gateway.service — prepend the mise shims directory (/home/ec2-user/.local/share/mise/shims) to the unit's Environment=PATH so node, npm and playwright-cli all resolve at service runtime the same way they do in an interactive shell. b) packs/kirocrew/install.sh — belt-and-suspenders: symlink both playwright-cli AND node into ~/.local/bin (already on the unit's PATH) in case shim generation lags or the user's mise layout differs. Fix for #3: Replace 'playwright-cli install-browser --with-deps' with an explicit dnf install of the AL2023 package names Playwright needs for Chromium (nss, nspr, atk, at-spi2-atk, cups-libs, libdrm, libxkbcommon, libX {composite,damage,fixes,randr}, mesa-libgbm, alsa-lib, pango, cairo), then run 'install-browser chromium' without --with-deps for the browser binary itself. Non-fatal warn paths preserved so a partial failure doesn't take down the whole install. bash -n clean on install.sh; systemd-analyze verify clean on the .service (existing __HOME__ placeholder warning is pre-existing and expected — deploy/bootstrap.sh substitutes it before enabling the unit). Refs: #94 (comment) (P1 x3 on 3e4984a)
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4a7a0b0426
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| pango | ||
| cairo | ||
| ) | ||
| if sudo dnf install -y "${_chromium_deps[@]}" 2>&1 | while IFS= read -r line; do log " dnf: ${line}"; done; then |
There was a problem hiding this comment.
Preserve Chromium dependency installation on Ubuntu
On a clean Ubuntu 22.04 deployment, which remains a supported OS in packs/kirocrew/manifest.yaml, this unconditional dnf command is unavailable, so the failure is merely warned about and install-browser chromium proceeds without installing the required shared libraries. The browser can therefore be downloaded successfully but fail when gateway agents launch it; select the dependency installation path by package manager, retaining an apt/--with-deps path for Ubuntu.
Useful? React with 👍 / 👎.
Follow-up to #94 addressing three Codex P1s posted on commit
3e4984a814after that PR was merged. All three affect the KiroCrew Playwright preinstall on the AL2023 ARM64 production target.The three P1s
P1 #1 —
playwright-clinot on the gateway service PATHmise's global npm prefix is only on
PATHduring install; the systemd unit hardcodesPATHand does not activate mise, so the globalplaywright-cliwas unreachable from gateway-spawned agents.P1 #2 — mise node binary also missing from the gateway PATH
playwright-cli's launcher uses#!/usr/bin/env node; symlinking the launcher alone still fails withnode: No such file or directorybecause node itself only lives under mise.P1 #3 —
--with-depsonly supports apt-get; target is AL2023 (dnf)Playwright's Linux dependency phase queues
apt-get update/install. On AL2023 this silently no-ops or errors and leaves Chromium's system libs unavailable.Two-layer fix for #1 + #2
a)
packs/kirocrew/resources/kirocrew-gateway.service— prepend the mise shims directory (/home/ec2-user/.local/share/mise/shims) to the unit'sEnvironment=PATHsonode,npmandplaywright-cliall resolve at service runtime the same way they do in an interactive shell.b)
packs/kirocrew/install.sh— belt-and-suspenders: symlink bothplaywright-cliandnodeinto~/.local/bin(already on the unit's PATH) in case shim generation lags or the user's mise layout differs.Fix for #3
Replace
playwright-cli install-browser --with-depswith an explicitdnf installof the AL2023 package names Playwright needs for Chromium (nss, nspr, atk, at-spi2-atk, cups-libs, libdrm, libxkbcommon, libX{composite,damage,fixes,randr}, mesa-libgbm, alsa-lib, pango, cairo), then runinstall-browser chromiumwithout--with-depsfor the browser binary itself.Verification
bash -n packs/kirocrew/install.sh: OKsystemd-analyze verifyon the .service: clean (existing__HOME__placeholder warning is pre-existing and expected —deploy/bootstrap.shsubstitutes it before enabling the unit)Refs
Not merging per Aug 22 20:34 rule.