Pin kaleido<1.0 in both containers to fix ChromeNotFoundError - #85
Merged
Conversation
`kaleido` was pip-installed unpinned and resolved to v1.x, which dropped the self-contained chromium and requires a separately provisioned Chrome. The Dockerfiles ran `kaleido.get_chrome_sync()` at build time (as root, into /root/.cache), but GitHub Actions container jobs run with HOME=/github/home, so at test runtime kaleido looked in the wrong place and Plotly static-image export failed with ChromeNotFoundError (BCG_complete_mkts.md, BCG_incomplete_mkts.md, knowing_forecasts_of_others.md) — the same "unpinned dep bumped a major" class as #28. Pin `kaleido<1.0` in both images and drop the now-invalid get_chrome_sync build step (v0 has no such API). kaleido 0.2.x bundles its own chromium (location-independent, so unaffected by the HOME difference) and still exports PNGs on the current plotly — verified plotly 6.7.0 + kaleido 0.2.1 produces a PNG (deprecation warning only, no error). The existing apt chromium runtime libs are retained for the bundled browser. Migrating to kaleido v1 with a system-provisioned Chrome is left as a future follow-up. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR stabilizes Plotly static-image export in the quantecon and quantecon-build container images by preventing kaleido from upgrading to v1.x (which requires an externally provisioned Chrome) and by removing the now-invalid build-time Chrome download step.
Changes:
- Pin
kaleido<1.0in both containerenvironment.ymlfiles to keep using kaleido v0.x (bundled chromium). - Remove the
kaleido.get_chrome_sync()build step from both container Dockerfiles. - Document the fix and rationale in
CHANGELOG.mdunder Unreleased → Fixed.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
containers/quantecon/environment.yml |
Pin kaleido<1.0 in pip deps with rationale for CI runtime HOME behavior. |
containers/quantecon/Dockerfile |
Remove build-time kaleido.get_chrome_sync() invocation. |
containers/quantecon-build/environment.yml |
Pin kaleido<1.0 in pip deps with matching rationale. |
containers/quantecon-build/Dockerfile |
Remove build-time kaleido.get_chrome_sync() invocation. |
CHANGELOG.md |
Add Unreleased changelog entry describing the kaleido pin + removed Chrome download step. |
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.
Problem
The container tests (
test-containers-lectures.yml) fail at notebook execution withChromeNotFoundErrorfromkaleidoon Plotly static-image export —BCG_complete_mkts.md,BCG_incomplete_mkts.md,knowing_forecasts_of_others.md. This is the same "unpinned dependency bumped a major" class as #28.Root cause
kaleidowas pip-installed unpinned and resolved to v1.x (currently 1.3.0). kaleido v1 dropped the self-contained chromium and requires a separately provisioned Chrome. Both Dockerfiles rankaleido.get_chrome_sync()at build time — but that downloads Chrome under/root/.cache(build runs as root), while GitHub Actions container jobs run withHOME=/github/home, so at test runtime kaleido looks in the wrong place and can't find Chrome.Fix
kaleido<1.0in bothcontainers/quantecon/environment.ymlandcontainers/quantecon-build/environment.yml.kaleido.get_chrome_sync()build step from both Dockerfiles (v0 has no such API; leaving it would fail the build).kaleido 0.2.x bundles its own chromium inside the package (location-independent, so the
HOMEdifference is irrelevant) and still exports images on the current plotly. The existing apt chromium runtime libs (libnss3,libgbm1,libasound2t64, …) are retained for the bundled browser.Verification
Installed
plotly==6.7.0(the version the lean image resolves) +kaleido==0.2.1on Python 3.13 and exported a PNG:Only
DeprecationWarnings are emitted (Plotly notes kaleido v0 support is deprecated) — no error. The full image's plotly 6.3.0 is older and on the same deprecation (warn, not error) path.Caveat / follow-up
This is a pragmatic stopgap consistent with long-standing QuantEcon practice: kaleido v0 is deprecated by Plotly, so a future Plotly release could eventually drop it. Migrating to kaleido v1 with a system-provisioned Chrome (install
google-chrome/chromiumto a fixed path and point kaleido at it via env, independent ofHOME) is the durable path and is left as a follow-up.Notes
ubuntu:24.04base-image "high vulnerability" warning surfaced by the IDE is pre-existing and unrelated to this change.🤖 Generated with Claude Code