Skip to content

Full image: a system Chrome, so kaleido 1.x works in container jobs #342

Closed

Description

@mmcky

Context. QuantEcon/lectures' one environment for its sites, _base/environment-update.yml (QuantEcon/lectures#70), pins kaleido 1.5.1, the newest, which the series build with (advanced's own build installs the newest kaleido on ubuntu-latest, whose runner has Google Chrome). In ghcr.io/quantecon/quantecon kaleido 1.x finds no Chrome: as #85 records, container jobs set HOME=/github/home, so a Chrome fetched under /root when the image is built is not found, and containers/quantecon/environment.yml pins kaleido<1.0 (0.2.1) instead. Reproduced on 2026-11-18: kaleido 1.5.0 with plotly 6.7.0 and no Chrome raises RuntimeError: Kaleido requires Google Chrome to be installed. Three advanced lectures export plotly figures with kaleido (BCG_complete_mkts, BCG_incomplete_mkts, knowing_forecasts_of_others), so the advanced site cannot build in the image with the shared environment.

Proposal. Install a system Chrome in the full image (Google Chrome stable from Google's apt repository, or Chromium) at a standard path, which kaleido's choreographer finds whatever HOME is (or set BROWSER_PATH to it), and lift the kaleido<1.0 pin. Test in the container tests: fig.to_image(format="png") succeeds as a job would run it, with HOME=/github/home.

Why now. QuantEcon/lectures' site builds move to the full image with the shared environment (QuantEcon/project-monorepo#77); the advanced site's build needs this first.

Activity

  1. added a commit that references this issue on Nov 19, 2026
  2. mmcky commented on Nov 19, 2026

    @mmcky
    ContributorAuthor

    A check of this issue against main at 52e8a72, before any code, with the maintainer's decisions on its four questions. Nothing merged since, up to f2a0333, after v0.21.1, touches the images' kaleido or plotly. The aim holds: kaleido 1.x finds no Chrome in either image, since choreographer 1.4.0 looks for a download under $HOME/.local/share, then BROWSER_PATH, then PATH and the usual /usr/bin paths; in a container job nothing has been downloaded under HOME=/github/home, BROWSER_PATH is unset, and neither image has a Chrome on PATH or in /usr/bin. Both images still install kaleido 0.2.1.

    Chrome: Chrome for Testing's chrome-linux64 at a pinned version, 158.0.8127.36 (the current stable), checked by SHA-256 as Miniconda and Node are, unpacked to /opt/chrome, with BROWSER_PATH set. Google's apt repository keeps only the current release, so it can't be pinned, and Ubuntu 24.04's Chromium is a snap, which doesn't run in a container. The image build will fail unless chrome --version matches the pin and every library it links against is present. Dependabot can't track the pin, so a bump is made by hand, as for Node.

    Images: both, not the full one only. QuantEcon/lectures' site build runs in the lean image today (tools/site-matrix maps ubuntu-latest to quantecon-build), as do lecture-dp's builds and the canary's, and plotly 7 will need kaleido 1.x in the lean image too. With kaleido 0.2.1's bundled Chromium gone, each image grows by about 0.13 GB compressed and 0.2 GB on disk.

    Pin: kaleido==1.5.2 in both images. It fixes an intermittent ReferenceError: kaleido_scopes is not defined that 1.5.1 introduced (plotly/Kaleido#487), and declares the same requirements. plotly stays at the baseline's 6.7.0, whose exports work with kaleido 1.5, and anaconda=2026.07 holds no kaleido, so the baseline doesn't move. An exact pin means each kaleido release reaches the images through a Dependabot pull request whose smoke test exports a figure.

    Not breaking: plotly's to_image and write_image are called the same way with kaleido 1.x, and no QuantEcon repository uses what 1.x drops (kaleido 0.2's own kaleido.scopes API, EPS export). The CHANGELOG entry will say what a build will see: figures rendered by Chrome 158 with the system's fonts, MathJax 3 for LaTeX in plotly labels, and slower exports, since kaleido 1.x starts Chrome for each figure. A repository that needs kaleido 0.2 can still add kaleido<1 through environment-update.

    Test, as planned: the smoke test already exports a plotly PNG in a container job under HOME=/github/home. It will gain checks that kaleido is 1.5.2, and that choreographer finds Chrome at BROWSER_PATH and not in a download, so that a return to kaleido 0.2 or a lost Chrome fails it, and it will be shown red on today's image first.

    Also in the regression set: back_prop (in lecture-python.myst and the pool) exports two figures. It runs pip install -U kaleido plotly and kaleido.get_chrome_sync() itself, which is how the matrix's lecture-python.myst legs pass today, and choreographer goes on preferring that download. The merge will rebuild and promote both images, and the lecture matrix that follows will be read for the three advanced pages that export figures, and back_prop, in both. The same pull request will correct both Dockerfiles' note on wrangler's Node minimum, which is 22.12 for the wrangler pinned since #340 (see #341).

    Claude Code (on behalf of mmcky)

  3. added a commit that references this issue on Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions