Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: skip puppeteer chromium download #22623

Merged
merged 2 commits into from
Jan 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ FROM node:16-slim AS superset-node

ARG NPM_BUILD_CMD="build"
ENV BUILD_CMD=${NPM_BUILD_CMD}
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we default this to false?

Suggested change
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=false

Copy link
Contributor

@EugeneTorap EugeneTorap Jan 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to add Chromium to the image?
For what do we use Puppeteer in the superset? For UI testing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Puppeteer is a dependency of Apitools - that runs a cron in github actions

Not actually needed in the docker image build - skipping the download in the dockerfile wont affect the apitools tests

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with you!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All our team also uses Mac M1 and we have problem with ´puppeteer´ lib on arm64 image build and we skip downloading of the lib.
@michael-s-molina @kgabryje Can we speed up downloading of the UI libs while building a docker image? For example: skip all libs for unit test when we run ´npn ci´?

Copy link
Contributor Author

@nisheldo nisheldo Jan 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@villebro - this is the error you get without the fix if you are on a m1 mac

[superset-node 7/8] RUN /frontend-mem-nag.sh && cd /app/superset-frontend && npm ci:
#18 0.141 Memory check Ok [12.1407 GB free]
#18 108.2 npm notice
#18 108.2 npm notice New major version of npm available! 7.24.2 -> 9.2.0
#18 108.2 npm notice Changelog: https://github.com/npm/cli/releases/tag/v9.2.0
#18 108.2 npm notice Run npm install -g [email protected] to update!
#18 108.2 npm notice
#18 108.2 npm ERR! code 1
#18 108.2 npm ERR! path /app/superset-frontend/node_modules/puppeteer
#18 108.2 npm ERR! command failed
#18 108.2 npm ERR! command sh -c node install.js
#18 108.2 npm ERR! The chromium binary is not available for arm64.
#18 108.2 npm ERR! If you are on Ubuntu, you can install with:
#18 108.2 npm ERR!
#18 108.2 npm ERR! sudo apt install chromium
#18 108.2 npm ERR!
#18 108.2 npm ERR!
#18 108.2 npm ERR! sudo apt install chromium-browser
#18 108.2 npm ERR!
#18 108.2 npm ERR! /app/superset-frontend/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserFetcher.js:115
#18 108.2 npm ERR! throw new Error();
#18 108.2 npm ERR! ^
#18 108.2 npm ERR!
#18 108.2 npm ERR! Error
#18 108.2 npm ERR! at /app/superset-frontend/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserFetcher.js:115:27
#18 108.2 npm ERR! at FSReqCallback.oncomplete (node:fs:202:21)
#18 108.3
#18 108.3 npm ERR! A complete log of this run can be found in:
#18 108.3 npm ERR! /root/.npm/_logs/2023-01-11T17_24_26_860Z-debug.log

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @nisheldo - can you add it to the description to improve discoverability?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Funny thing is, I'm on an M1, too, but haven't run into this, so I guess I'm not using the Dockerfile that much locally 😁

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@villebro - done


# NPM ci first, as to NOT invalidate previous steps except for when package.json changes
RUN mkdir -p /app/superset-frontend
Expand Down