Skip to content

feat: preinstall Playwright and Puppeteer browser system dependencies (issue #68)#69

Merged
konard merged 4 commits intomainfrom
issue-68-4aeda74d2fdd
Mar 13, 2026
Merged

feat: preinstall Playwright and Puppeteer browser system dependencies (issue #68)#69
konard merged 4 commits intomainfrom
issue-68-4aeda74d2fdd

Conversation

@konard
Copy link
Member

@konard konard commented Mar 10, 2026

Summary

Fixes #68

This PR adds all OS-level system library dependencies required to run Chromium, Firefox, and WebKit browsers via Playwright and Puppeteer. It also globally installs the playwright and @puppeteer/browsers CLI tools.

Problem

When using npx playwright install inside a container based on konard/sandbox, browsers are downloaded but the host system is missing required OS libraries. Playwright emits:

╔══════════════════════════════════════════════════════╗
║ Host system is missing dependencies to run browsers. ║
║ Please install them with the following command:      ║
║                                                      ║
║     sudo npx playwright install-deps                 ║
║                                                      ║
║ Alternatively, use apt:                              ║
║     sudo apt-get install libatk1.0-0t64\             ║
║         libatk-bridge2.0-0t64\                       ║
║         libcups2t64\                                 ║
║         libxkbcommon0\                               ║
║         libatspi2.0-0t64\                            ║
║         libxdamage1\                                 ║
║         libasound2t64                                ║
╚══════════════════════════════════════════════════════╝

Observed in hive-mind CI: https://github.com/link-assistant/hive-mind/actions/runs/22902572178/job/66453518615

Root Cause

The sandbox-js base Dockerfile only installs minimal prerequisites (curl git sudo ca-certificates unzip). The ~60 system libraries needed by browser engines (GTK, CUPS, D-Bus, libXkbcommon, ALSA, GStreamer, ATK, etc.) were absent.

Solution

  1. ubuntu/24.04/js/Dockerfile — Add the complete set of browser system dependencies as a new apt-get install layer. Since sandbox-js is the base for all images (sandbox-essentials, sandbox-full), all derived images inherit these deps automatically.

  2. ubuntu/24.04/essentials-sandbox/install.sh — Add the same deps for standalone installs, and globally install playwright and @puppeteer/browsers CLIs via npm.

  3. docs/case-studies/issue-68/CASE-STUDY.md — Deep root cause analysis with CI log data, official dependency sources, and solution rationale.

Packages Added

The complete union of Playwright (Chromium + Firefox + WebKit) and Puppeteer (Chrome) dependencies for Ubuntu 24.04:

  • Chromium/Chrome: libasound2t64, libatk-bridge2.0-0t64, libatk1.0-0t64, libcups2t64, libgbm1, libnspr4, libnss3, libxkbcommon0, and more
  • Firefox: libavcodec60, libgtk-3-0t64, libpangocairo-1.0-0, libxcursor1, etc.
  • WebKit: gstreamer1.0-*, libenchant-2-2, libgtk-4-1, libgstreamer-*, libharfbuzz-*, etc.
  • Display/Fonts: xvfb, fonts-liberation, fonts-noto-color-emoji, fonts-ipafont-gothic, etc.
  • Puppeteer extra: libxss1, libxtst6, xdg-utils

CLIs Installed

  • playwrightnpx playwright install [chromium|firefox|webkit], npx playwright test
  • @puppeteer/browsersnpx @puppeteer/browsers install chrome@stable

References


This PR was created automatically by the AI issue solver

Adding .gitkeep for PR creation (default mode).
This file will be removed when the task is complete.

Issue: #68
@konard konard self-assigned this Mar 10, 2026
konard and others added 2 commits March 10, 2026 13:03
…wser dependencies)

Compile CI logs, research findings, root cause analysis, and proposed
solution for the missing Playwright/Puppeteer system dependencies issue.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… (issue #68)

Add all OS-level library dependencies required by Chromium, Firefox, and WebKit
to the sandbox-js base Dockerfile and essentials-sandbox install script. This
eliminates the "Host system is missing dependencies to run browsers" warning
reported in the hive-mind CI logs.

Changes:
- ubuntu/24.04/js/Dockerfile: add ~60 system packages for Playwright/Puppeteer
  (libasound2t64, libatk*, libcups2t64, libxkbcommon0, xvfb, fonts, etc.)
- ubuntu/24.04/essentials-sandbox/install.sh: install playwright and
  @puppeteer/browsers CLIs globally via npm for all sandbox users

All derived images (sandbox-essentials, sandbox-full) inherit the browser deps
from the js base image. No manual `npx playwright install-deps` required.

Fixes #68

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@konard konard changed the title [WIP] We should preinstall dependencies for playwright and puppeteer, including their CLI tools feat: preinstall Playwright and Puppeteer browser system dependencies (issue #68) Mar 10, 2026
@konard konard marked this pull request as ready for review March 10, 2026 13:04
@konard
Copy link
Member Author

konard commented Mar 10, 2026

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Public pricing estimate: $4.247323
  • Calculated by Anthropic: $3.807664 USD
  • Difference: $-0.439659 (-10.35%)
    📎 Log file uploaded as Gist (3588KB)
    🔗 View complete solution draft log

Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard
Copy link
Member Author

konard commented Mar 10, 2026

🔄 Auto-restart 1/3

Detected uncommitted changes from previous run. Starting new session to review and commit them.

Uncommitted files:

?? ci-logs/docker-build-test-log.txt

Auto-restart will stop after changes are committed or after 2 more iterations. Please wait until working session will end and give your feedback.

@konard
Copy link
Member Author

konard commented Mar 10, 2026

🔄 Auto-restart 1/3 Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Public pricing estimate: $0.406326
  • Calculated by Anthropic: $0.723653 USD
  • Difference: $0.317327 (+78.10%)
    📎 Log file uploaded as Gist (4483KB)
    🔗 View complete solution draft log

Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard
Copy link
Member Author

konard commented Mar 10, 2026

✅ Ready to merge

This pull request is now ready to be merged:

  • All CI checks have passed
  • No merge conflicts
  • No pending changes

Monitored by hive-mind with --auto-restart-until-mergeable flag

@konard konard merged commit e021323 into main Mar 13, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

We should preinstall dependencies for playwright and puppeteer, including their CLI tools

1 participant