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

[Discuss] Re-evaluate the argument for custom Chromium build #92313

Closed
tsullivan opened this issue Feb 22, 2021 · 12 comments
Closed

[Discuss] Re-evaluate the argument for custom Chromium build #92313

tsullivan opened this issue Feb 22, 2021 · 12 comments
Labels
(Deprecated) Feature:Reporting Use Reporting:Screenshot, Reporting:CSV, or Reporting:Framework instead discuss impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:medium Medium Level of Effort Team:Operations Team label for Operations Team

Comments

@tsullivan
Copy link
Member

tsullivan commented Feb 22, 2021

This issue is to list the pros and cons of having a custom build of Chromium shipped with Kibana to support PDF/PNG reporting.

Background

PhantomJS was the original headless browser used by Kibana to support screenshot reports since Kibana 5.0. That had its share of issues that were hard to reproduce and diagnose. Eventually, the Chromium project released headless support for its browser and Kibana switched to using it as our Reporting browser. As a reaction to Chromium supporting headless, the PhantomJS project deprecated itself. Using Chromium goes back to 6.3, and for the first 2 minors, chrome-remote-interface drove the integration. In 6.5, we switched to Puppeteer.

In first switching away from Phantom, we had the option to use a "stock" Chromium installation from the node module. Instead, we chose the alternative which is to supply our own Chromium installation. The Kibana team created build scripts that compile Chromium from source, using our own arguments files.

There is one main reason why we chose to ship a custom binary rather than use the default Chromium: in Linux, the default Chromium requires x11 which is not normally installed on a Linux server, and has a huge impact on how a server is provisioned in a self-deploy setup. (Note: even with the custom binary, Kibana Reporting imposes a few system requirements for the Linux server, such as fontconfig and nss )

Reasons to re-evaluate

Kibana Reporting has worked the way it has since version 6.3. Versions 6.3 and 6.4 used chrome-remote-interface rather than Puppeteer, but the custom build process. was the same. Looking at the question now, there are unanswered questions:

  1. Why is the size of the custom binary shipped with the Kibana distro larger than Linux's default binary for Chromium?
  2. How would using the Puppeteer defaults affect the size of the Kibana Docker image?
  3. How would using Puppeteer defaults affect general stability of Kibana Reporting?
@tsullivan tsullivan added discuss Team:Operations Team label for Operations Team (Deprecated) Feature:Reporting Use Reporting:Screenshot, Reporting:CSV, or Reporting:Framework instead Team:AppServices labels Feb 22, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-operations (Team:Operations)

@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-services (Team:AppServices)

@tsullivan
Copy link
Member Author

ping @tylersmalley @kobelb @stacey-gammon

@kobelb
Copy link
Contributor

kobelb commented Feb 22, 2021

Why is the size of the custom binary shipped with the Kibana distro larger than Linux's default binary for Chromium?

I'm assuming it's because we statically link everything we can when building the Kibana distro version so that as few as possible dependencies need to be installed on the server. The default binary is dynamically linked, resulting in a smaller binary but more dependencies on system libraries that we would have to instruct customers how to install.

How much would the Reporting team be freed to work on other things?

It's my understanding that we haven't automated the building of Chromium, yet. If we were to do so, wouldn't this free the Reporting team up to work on other things?

@tsullivan
Copy link
Member Author

tsullivan commented Feb 23, 2021

It's my understanding that we haven't automated the building of Chromium, yet. If we were to do so, wouldn't this free the Reporting team up to work on other things?

Yes. I'm glad you brought it up, but I want to explore that idea separately. If there isn't enough of a reason to continue our custom build, then we don't need to automate it.

(I edited the topic and removed the last bullet point)

@tsullivan
Copy link
Member Author

What is driving this question: we want to see if updating Chromium will help with certain bugs in Reporting. Creating a new build just to see if bugs are fixed is a big ask.

@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-reporting-services (Team:Reporting Services)

@tsullivan
Copy link
Member Author

@kobelb I understand the argument for continuing the custom Linux build, and it is good to statically link everything we can.

For Windows and Mac, I think the arguments don't apply. There really aren't extra system dependencies that an admin would need to install for Windows and Mac, correct?

@kobelb
Copy link
Contributor

kobelb commented Mar 24, 2021

@tsullivan to be honest, I don't recall.

@tsullivan
Copy link
Member Author

The plan for the next update of Puppeteer in 7.14 will be to ship the "stock" build of Chromium for Mac and Windows. Linux will still require a custom build to lower the barrier of getting started for server OSes.

We'll try to work in a way that developers are not blocked on waiting for the build process while working on change to Kibana that use Puppeteer: we should develop and write tests using the stock build no matter what OS the developer works with.

@tsullivan tsullivan changed the title [Discuss] Re-evaluate the argument for custom Chromium build [Reporting] Update Puppeteer dependency Apr 22, 2021
@tsullivan tsullivan changed the title [Reporting] Update Puppeteer dependency [Discuss] Re-evaluate the argument for custom Chromium build Apr 23, 2021
@tsullivan
Copy link
Member Author

Closing for #90496

@exalate-issue-sync exalate-issue-sync bot added impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:small Small Level of Effort labels Apr 26, 2021
@tsullivan
Copy link
Member Author

An observation has come up while working through the next Chromium upgrade. There are a few reasons to continue custom building our own headless Chromium:

  1. No builds are easily available for the "headless_shell" application. This application is generated from a build target in Chromium source code that seems almost like a proof-of-concept. Google does not provide any downloads to this application, and it seems that it is not even built regularly nor automatically tested for regressions. (This is a reason to stop using Chromium headless_shell completely)
  2. If we use the "stock" builds of Chromium (that is, "full" Chromium), we could end up bundling a LOT of files, especially for Mac. See chore(NA): assure puppeteer_skip_chromium_download is applied across every yarn install situation #88346
  3. Our custom build arguments disable kerberos, which seems to have security implications:

@exalate-issue-sync exalate-issue-sync bot added loe:medium Medium Level of Effort and removed loe:small Small Level of Effort labels May 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
(Deprecated) Feature:Reporting Use Reporting:Screenshot, Reporting:CSV, or Reporting:Framework instead discuss impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:medium Medium Level of Effort Team:Operations Team label for Operations Team
Projects
None yet
Development

No branches or pull requests

4 participants