fix(base): locate agent-browser's chrome arch-agnostically
Lint / actionlint (push) Failing after 12s
Lint / hadolint (push) Successful in 12s
Publish Docker Image / resolve-versions (push) Failing after 26s
Publish Docker Image / base-decide (push) Has been skipped
Publish Docker Image / build-base (push) Has been skipped
Publish Docker Image / smoke (push) Has been skipped
Publish Docker Image / build-variant (push) Has been skipped
Publish Docker Image / promote-base-latest (push) Has been skipped
Publish Docker Image / update-description (push) Has been skipped
Publish Docker Image / smoke-studio (push) Failing after 31m44s
Publish Docker Image / build-variant-studio (push) Has been skipped
Lint / actionlint (push) Failing after 12s
Lint / hadolint (push) Successful in 12s
Publish Docker Image / resolve-versions (push) Failing after 26s
Publish Docker Image / base-decide (push) Has been skipped
Publish Docker Image / build-base (push) Has been skipped
Publish Docker Image / smoke (push) Has been skipped
Publish Docker Image / build-variant (push) Has been skipped
Publish Docker Image / promote-base-latest (push) Has been skipped
Publish Docker Image / update-description (push) Has been skipped
Publish Docker Image / smoke-studio (push) Failing after 31m44s
Publish Docker Image / build-variant-studio (push) Has been skipped
v1.6.0's first build failed on amd64: playwright@latest fetches Chrome for Testing, which extracts to chromium-<rev>/chrome-linux64/ on amd64 (vs chrome-linux/ on arm64). The hardcoded chrome-linux/ glob matched only arm64, so amd64 built no /usr/local/bin/agent-chrome symlink and 'test -x' failed (agent-browser --version had already printed 0.32.1 — the tell). Replace the glob with an arch-agnostic 'find -name chrome -path */chromium-*/*' (skips the chrome-headless-shell binary and the chromium_headless_shell dir), guarded by [ -n ] + the existing test -x. Verified locally: resolves the CfT chrome and agent-browser drives it headless. hadolint clean.
This commit is contained in:
+6
-6
@@ -478,9 +478,10 @@ RUN curl -fsSL --retry 5 --retry-delay 5 --retry-all-errors https://deb.nodesour
|
|||||||
# Playwright honours PLAYWRIGHT_BROWSERS_PATH, so we place the browser under
|
# Playwright honours PLAYWRIGHT_BROWSERS_PATH, so we place the browser under
|
||||||
# /usr/local/share (never shadowed) and hand agent-browser a STABLE symlink
|
# /usr/local/share (never shadowed) and hand agent-browser a STABLE symlink
|
||||||
# via AGENT_BROWSER_EXECUTABLE_PATH — the symlink insulates the ENV from
|
# via AGENT_BROWSER_EXECUTABLE_PATH — the symlink insulates the ENV from
|
||||||
# Playwright's per-version `chromium-<rev>` directory name (glob picks the
|
# Playwright's per-version, per-ARCH browser directory (`chrome-linux` on arm64,
|
||||||
# real headful build; the `chromium_headless_shell-*` dir has an underscore
|
# `chrome-linux64` on amd64 — Chrome-for-Testing), so we `find` the `chrome`
|
||||||
# so `chromium-*` never matches it).
|
# binary rather than hardcode the path; the headless-shell binary is named
|
||||||
|
# `chrome-headless-shell`, so `-name chrome` skips it.
|
||||||
#
|
#
|
||||||
# `playwright install --with-deps chromium` also apt-installs Chromium's
|
# `playwright install --with-deps chromium` also apt-installs Chromium's
|
||||||
# runtime libs; verified to resolve correctly on Debian trixie (exit 0 — the
|
# runtime libs; verified to resolve correctly on Debian trixie (exit 0 — the
|
||||||
@@ -499,9 +500,8 @@ RUN NPM_CONFIG_PREFIX=/usr npm install -g \
|
|||||||
"agent-browser@${AGENT_BROWSER_VERSION}" \
|
"agent-browser@${AGENT_BROWSER_VERSION}" \
|
||||||
"playwright@${PLAYWRIGHT_VERSION}" && \
|
"playwright@${PLAYWRIGHT_VERSION}" && \
|
||||||
playwright install --with-deps chromium && \
|
playwright install --with-deps chromium && \
|
||||||
for chrome in "${PLAYWRIGHT_BROWSERS_PATH}"/chromium-*/chrome-linux/chrome; do \
|
CHROME="$(find "${PLAYWRIGHT_BROWSERS_PATH}" -type f -name chrome -path '*/chromium-*/*' | head -n1)" && \
|
||||||
ln -sf "$chrome" /usr/local/bin/agent-chrome; break; \
|
[ -n "$CHROME" ] && ln -sf "$CHROME" /usr/local/bin/agent-chrome && \
|
||||||
done && \
|
|
||||||
agent-browser --version && \
|
agent-browser --version && \
|
||||||
test -x "$(readlink -f /usr/local/bin/agent-chrome)" && \
|
test -x "$(readlink -f /usr/local/bin/agent-chrome)" && \
|
||||||
rm -rf "${PLAYWRIGHT_BROWSERS_PATH}"/chromium_headless_shell-* && \
|
rm -rf "${PLAYWRIGHT_BROWSERS_PATH}"/chromium_headless_shell-* && \
|
||||||
|
|||||||
Reference in New Issue
Block a user