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

[Reporting] Switch Mac Chromium to the internally-hosted custom build #100165

Merged
merged 3 commits into from
May 17, 2021

Conversation

tsullivan
Copy link
Member

@tsullivan tsullivan commented May 14, 2021

Summary

As of #98688, the Reporting team has decided to no longer bundle custom builds of Chromium's headless_shell for Mac and Windows. This presented an unforeseen change for the Mac release cycle. Infra team signs and notarizes the Kibana build for Mac, to comply with Apple Gatekeeper requirements. Our signing scripts did not know how to handle Chromium.app bundled with Kibana.

This PR switches Mac to bundle a custom headless_shell binary for Mac, which is built to be compatible with Puppeteer 8.0.0.

Build log

~/src/chromium > vim chromium/src/headless/BUILD.gn
~/src/chromium > python ./build_chromium/build.py d163fd7c6905e456501aba914a24c20b62b4c6dc x64                                                                                      7m 56s
Building Chromium d163fd7c6905e456501aba914a24c20b62b4c6dc for x64 from /Users/sullivat/src/chromium/chromium/src
src path: /Users/sullivat/src/chromium/chromium/src
depot_tools path: /Users/sullivat/src/chromium/depot_tools
build_chromium_path: /Users/sullivat/src/chromium/build_chromium
args.gn file: /Users/sullivat/src/chromium/build_chromium/darwin/args.gn

Setting local tracking branch
 > cd /Users/sullivat/src/chromium/chromium/src
 > git checkout build-d163fd7
M       headless/BUILD.gn
Already on 'build-d163fd7'
Updating PATH for depot_tools: /Users/sullivat/src/chromium/depot_tools:/Users/sullivat/.nvm/versions/node/v14.16.1/bin:/Users/sullivat/bin:/usr/local/bin:/snap/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/Users/sullivat/.fzf/bin:/Users/sullivat/src/chromium/build_chromium/depot_tools
Updating all modules
 > gclient sync
Syncing projects: 100% (113/113), done.

WARNING: 'src/third_party/highway/src' is no longer part of this client.
It is recommended that you manually remove it or use 'gclient sync -D' next time.

WARNING: 'src/third_party/libjxl/src' is no longer part of this client.
It is recommended that you manually remove it or use 'gclient sync -D' next time.

WARNING: 'src/third_party/dawn/third_party/tint' is no longer part of this client.
It is recommended that you manually remove it or use 'gclient sync -D' next time.
Running hooks:  15% (15/97) mac_toolchain
________ running 'vpython src/build/mac_toolchain.py' in '/Users/sullivat/src/chromium/chromium'
Skipping Mac toolchain installation for mac
Running hooks: 100% (97/97), done.
Generating platform-specific args
 > mkdir -p out/headless
 > cp /Users/sullivat/src/chromium/build_chromium/darwin/args.gn /Users/sullivat/src/chromium/chromium/src/out/headless/args.gn
Adding target_cpu to args
 > gn gen out/headless
WARNING at build arg file (use "gn args <out_dir>" to edit):31:32: Build argument has no effect.
remove_webcore_debug_symbols = true
                               ^---
The variable "remove_webcore_debug_symbols" was set as a build argument
but never appeared in a declare_args() block in any buildfile.

To view all possible args, run "gn args --list <out_dir>"

The build continued as if that argument was unspecified.

Done. Made 15573 targets from 2598 files in 15470ms
Compiling... this will take a while
 > autoninja -C out/headless headless_shell
ninja: Entering directory `out/headless'
[9940/9940] LINK ./headless_shell
Optimizing headless_shell
 > strip -o out/headless/headless_shell out/headless/headless_shell_raw
Creating /Users/sullivat/src/chromium/chromium/src/out/headless/chromium-d163fd7-darwin_x64.zip
Creating /Users/sullivat/src/chromium/chromium/src/out/headless/chromium-d163fd7-darwin_x64.md5
~/src/chromium >                                                                                                                                                                 5h 2m 47s

Note about vim chromium/src/headless/BUILD.gn -- I had to edit this file to find a workaround for https://groups.google.com/a/chromium.org/g/chromium-dev/c/jYibDVPm5X0/m/lQ1yBL0wBAAJ

How to test on Mac

Testing can be automated with the functional tests:

node scripts/functional_tests.js --config x-pack/test/reporting_api_integration/reporting_and_security.config.ts --grep='PDF'
node scripts/functional_tests.js --config x-pack/test/functional/config.js --grep='downloads a PNG'

@tsullivan tsullivan added (Deprecated) Feature:Reporting Use Reporting:Screenshot, Reporting:CSV, or Reporting:Framework instead release_note:skip Skip the PR/issue when compiling release notes Team:AppServices v7.13.0 labels May 14, 2021
@tsullivan tsullivan marked this pull request as ready for review May 14, 2021 20:58
@elasticmachine
Copy link
Contributor

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

@tsullivan tsullivan changed the title [Reporting] Switch Mac chromium to using an internally-hosted custom build of headless_shell [Reporting] Switch Mac chromium to the internally-hosted custom build May 14, 2021
@tsullivan tsullivan changed the title [Reporting] Switch Mac chromium to the internally-hosted custom build [Reporting] Switch Mac Chromium to the internally-hosted custom build May 14, 2021
@tsullivan tsullivan requested review from mattkime and a team May 14, 2021 21:09
@tsullivan
Copy link
Member Author

tsullivan commented May 14, 2021

cc @Conky5 @tylersmalley

@tsullivan
Copy link
Member Author

@elasticmachine merge upstream

Copy link
Contributor

@mattkime mattkime left a comment

Choose a reason for hiding this comment

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

I was able to create PDF and PNG reports as expected, changes look good to me

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@tsullivan tsullivan merged commit 726abe8 into elastic:7.13 May 17, 2021
tsullivan added a commit to tsullivan/kibana that referenced this pull request May 17, 2021
…elastic#100165)

* switch mac chromium download location to kibana team gcs

* oops, fix the path to the binary

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
tsullivan added a commit to tsullivan/kibana that referenced this pull request May 17, 2021
…elastic#100165)

* switch mac chromium download location to kibana team gcs

* oops, fix the path to the binary

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
tsullivan added a commit that referenced this pull request May 17, 2021
…#100165) (#100233)

* switch mac chromium download location to kibana team gcs

* oops, fix the path to the binary

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
@tsullivan tsullivan deleted the reporting/mac-browser-7-13 branch May 18, 2021 16:32
tsullivan added a commit that referenced this pull request May 18, 2021
…#100165) (#100232)

* switch mac chromium download location to kibana team gcs

* oops, fix the path to the binary

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
yctercero pushed a commit to yctercero/kibana that referenced this pull request May 25, 2021
…elastic#100165) (elastic#100232)

* switch mac chromium download location to kibana team gcs

* oops, fix the path to the binary

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
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 release_note:skip Skip the PR/issue when compiling release notes v7.13.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants