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

[Build Chromium] Improve git checkout #83225

Merged
merged 5 commits into from
Dec 29, 2020

Conversation

tsullivan
Copy link
Member

@tsullivan tsullivan commented Nov 11, 2020

Summary

This PR attempts to expand on the guide to building Chromium for Kibana Reporting. It emphasizes the steps to building locally and guides the reader more to understanding the Google build tools for Chromium.

This PR updates the Python scripts for building. The goal is to require the user to run init.py once, and then allow them to run build.py as many times as they want. Running build.py multiple times will not repeat expensive work that happened when running init.py

Some shortcuts were added to the scripts so that same work doesn't get repeated, and avoid syncing any code the working directory repo more than is necessary. For example, instead of fetching the entire git repo when initializing the Chromium code, the script only fetches the code for the commit hash that is already known.

@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:AppArch v8.0.0 labels Nov 11, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-arch (Team:AppArch)

@elasticmachine
Copy link
Contributor

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

@tsullivan tsullivan force-pushed the chore/build_chromium/improvements branch 3 times, most recently from 1f1bc2c to 58300c9 Compare November 11, 2020 23:48
@tsullivan tsullivan marked this pull request as draft November 11, 2020 23:48
@spalger spalger added v7.11.0 and removed v7.11 labels Nov 12, 2020
@tsullivan tsullivan force-pushed the chore/build_chromium/improvements branch 3 times, most recently from acaff5b to 4885f9d Compare November 12, 2020 22:56
@tsullivan
Copy link
Member Author

@elasticmachine merge upstream

commit e817796d107d554504870cdb8e6dd10db1079a1e
Merge: 19e6b300260 61b4e05
Author: Timothy Sullivan <[email protected]>
Date:   Thu Nov 12 13:25:09 2020 -0700

    Merge branch 'chore/build_chromium/improvements' of github.com:tsullivan/kibana into chore/build_chromium/improvements

commit 19e6b300260822418cea4dc594bdfdf621a331e0
Author: Timothy Sullivan <[email protected]>
Date:   Thu Nov 12 13:23:01 2020 -0700

    fixes

commit 9de24ec298792a46e88207f41c9f6aff1997dbf1
Author: Timothy Sullivan <[email protected]>
Date:   Thu Nov 12 13:22:52 2020 -0700

    add instructions to build local

commit 872c0f68e0077ad50c541b605a87253befd1a891
Author: Timothy Sullivan <[email protected]>
Date:   Thu Nov 12 11:58:25 2020 -0700

    simplify

commit 8dae9484efcdc483ad20ceab32cae4e97735ab1c
Author: Timothy Sullivan <[email protected]>
Date:   Thu Nov 12 10:28:18 2020 -0700

    fixes

commit 492f5cfe25e2c7ccffce55a8733383a30aae1cb6
Author: Timothy Sullivan <[email protected]>
Date:   Wed Nov 11 20:15:43 2020 -0700

    --wip-- [skip ci]

commit acba359b121f7be8e6c353f90e938bc5d88658a1
Author: Timothy Sullivan <[email protected]>
Date:   Wed Nov 11 15:47:50 2020 -0700

    [Build Chromium] Improve git checkout

commit 61b4e05
Author: Timothy Sullivan <[email protected]>
Date:   Wed Nov 11 20:15:43 2020 -0700

    --wip-- [skip ci]

commit 58300c9
Author: Timothy Sullivan <[email protected]>
Date:   Wed Nov 11 15:47:50 2020 -0700

    [Build Chromium] Improve git checkout
@tsullivan tsullivan force-pushed the chore/build_chromium/improvements branch from db6c869 to d3d16c4 Compare December 14, 2020 16:31
@tsullivan tsullivan marked this pull request as ready for review December 14, 2020 16:40
@elasticmachine
Copy link
Contributor

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


As of this writing, there is an officially supported headless Chromium build args file for Linux: `build/args/headless.gn`. This does not work on Windows or Mac, so we have taken that as our starting point, and modified it until the Windows / Mac builds succeeded.
To get a list of the build arguments that are enabled, install `depot_tools` and run
Copy link
Member Author

Choose a reason for hiding this comment

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

This is a big improvement to the README: how to get the list of build arguments

checked_out = runcmdsilent('git checkout build-' + base_version)
if checked_out != 0:
print('Syncing remote version')
runcmd('git fetch origin ' + source_version)
Copy link
Member Author

Choose a reason for hiding this comment

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

This is a big improvement to initializing the working directory: only fetch the source version of the commit ID that we passed into the script

Copy link
Contributor

@joelgriffith joelgriffith left a comment

Choose a reason for hiding this comment

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

Minor MD changes, code LGTM. Full-disclaimer: not a python expert.

@tsullivan
Copy link
Member Author

@elasticmachine merge upstream

@tsullivan
Copy link
Member Author

@elasticmachine merge upstream

Copy link
Contributor

@joelgriffith joelgriffith left a comment

Choose a reason for hiding this comment

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

LGTM thanks for the python changes!

@tsullivan
Copy link
Member Author

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Distributable file count

id before after diff
default 47267 48027 +760

History

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

Copy link
Member

@jbudz jbudz left a comment

Choose a reason for hiding this comment

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

py and readme changes LGTM. I haven't run a full build, if you want me to do another loop can do.

@tsullivan tsullivan merged commit e699d91 into elastic:master Dec 29, 2020
tsullivan added a commit to tsullivan/kibana that referenced this pull request Dec 29, 2020
* [Build Chromium] Document steps for local build, improve checkout

commit e817796d107d554504870cdb8e6dd10db1079a1e
Merge: 19e6b300260 61b4e05
Author: Timothy Sullivan <[email protected]>
Date:   Thu Nov 12 13:25:09 2020 -0700

    Merge branch 'chore/build_chromium/improvements' of github.com:tsullivan/kibana into chore/build_chromium/improvements

commit 19e6b300260822418cea4dc594bdfdf621a331e0
Author: Timothy Sullivan <[email protected]>
Date:   Thu Nov 12 13:23:01 2020 -0700

    fixes

commit 9de24ec298792a46e88207f41c9f6aff1997dbf1
Author: Timothy Sullivan <[email protected]>
Date:   Thu Nov 12 13:22:52 2020 -0700

    add instructions to build local

commit 872c0f68e0077ad50c541b605a87253befd1a891
Author: Timothy Sullivan <[email protected]>
Date:   Thu Nov 12 11:58:25 2020 -0700

    simplify

commit 8dae9484efcdc483ad20ceab32cae4e97735ab1c
Author: Timothy Sullivan <[email protected]>
Date:   Thu Nov 12 10:28:18 2020 -0700

    fixes

commit 492f5cfe25e2c7ccffce55a8733383a30aae1cb6
Author: Timothy Sullivan <[email protected]>
Date:   Wed Nov 11 20:15:43 2020 -0700

    --wip-- [skip ci]

commit acba359b121f7be8e6c353f90e938bc5d88658a1
Author: Timothy Sullivan <[email protected]>
Date:   Wed Nov 11 15:47:50 2020 -0700

    [Build Chromium] Improve git checkout

commit 61b4e05
Author: Timothy Sullivan <[email protected]>
Date:   Wed Nov 11 20:15:43 2020 -0700

    --wip-- [skip ci]

commit 58300c9
Author: Timothy Sullivan <[email protected]>
Date:   Wed Nov 11 15:47:50 2020 -0700

    [Build Chromium] Improve git checkout

* Apply suggestions from code review

Co-authored-by: Joel Griffith <[email protected]>

Co-authored-by: Joel Griffith <[email protected]>
Co-authored-by: Kibana Machine <[email protected]>
tsullivan added a commit to tsullivan/kibana that referenced this pull request Dec 29, 2020
* [Build Chromium] Document steps for local build, improve checkout

commit e817796d107d554504870cdb8e6dd10db1079a1e
Merge: 19e6b300260 61b4e05
Author: Timothy Sullivan <[email protected]>
Date:   Thu Nov 12 13:25:09 2020 -0700

    Merge branch 'chore/build_chromium/improvements' of github.com:tsullivan/kibana into chore/build_chromium/improvements

commit 19e6b300260822418cea4dc594bdfdf621a331e0
Author: Timothy Sullivan <[email protected]>
Date:   Thu Nov 12 13:23:01 2020 -0700

    fixes

commit 9de24ec298792a46e88207f41c9f6aff1997dbf1
Author: Timothy Sullivan <[email protected]>
Date:   Thu Nov 12 13:22:52 2020 -0700

    add instructions to build local

commit 872c0f68e0077ad50c541b605a87253befd1a891
Author: Timothy Sullivan <[email protected]>
Date:   Thu Nov 12 11:58:25 2020 -0700

    simplify

commit 8dae9484efcdc483ad20ceab32cae4e97735ab1c
Author: Timothy Sullivan <[email protected]>
Date:   Thu Nov 12 10:28:18 2020 -0700

    fixes

commit 492f5cfe25e2c7ccffce55a8733383a30aae1cb6
Author: Timothy Sullivan <[email protected]>
Date:   Wed Nov 11 20:15:43 2020 -0700

    --wip-- [skip ci]

commit acba359b121f7be8e6c353f90e938bc5d88658a1
Author: Timothy Sullivan <[email protected]>
Date:   Wed Nov 11 15:47:50 2020 -0700

    [Build Chromium] Improve git checkout

commit 61b4e05
Author: Timothy Sullivan <[email protected]>
Date:   Wed Nov 11 20:15:43 2020 -0700

    --wip-- [skip ci]

commit 58300c9
Author: Timothy Sullivan <[email protected]>
Date:   Wed Nov 11 15:47:50 2020 -0700

    [Build Chromium] Improve git checkout

* Apply suggestions from code review

Co-authored-by: Joel Griffith <[email protected]>

Co-authored-by: Joel Griffith <[email protected]>
Co-authored-by: Kibana Machine <[email protected]>
@tsullivan tsullivan deleted the chore/build_chromium/improvements branch December 29, 2020 19:19
tsullivan added a commit that referenced this pull request Dec 29, 2020
* [Build Chromium] Document steps for local build, improve checkout

commit e817796d107d554504870cdb8e6dd10db1079a1e
Merge: 19e6b300260 61b4e05
Author: Timothy Sullivan <[email protected]>
Date:   Thu Nov 12 13:25:09 2020 -0700

    Merge branch 'chore/build_chromium/improvements' of github.com:tsullivan/kibana into chore/build_chromium/improvements

commit 19e6b300260822418cea4dc594bdfdf621a331e0
Author: Timothy Sullivan <[email protected]>
Date:   Thu Nov 12 13:23:01 2020 -0700

    fixes

commit 9de24ec298792a46e88207f41c9f6aff1997dbf1
Author: Timothy Sullivan <[email protected]>
Date:   Thu Nov 12 13:22:52 2020 -0700

    add instructions to build local

commit 872c0f68e0077ad50c541b605a87253befd1a891
Author: Timothy Sullivan <[email protected]>
Date:   Thu Nov 12 11:58:25 2020 -0700

    simplify

commit 8dae9484efcdc483ad20ceab32cae4e97735ab1c
Author: Timothy Sullivan <[email protected]>
Date:   Thu Nov 12 10:28:18 2020 -0700

    fixes

commit 492f5cfe25e2c7ccffce55a8733383a30aae1cb6
Author: Timothy Sullivan <[email protected]>
Date:   Wed Nov 11 20:15:43 2020 -0700

    --wip-- [skip ci]

commit acba359b121f7be8e6c353f90e938bc5d88658a1
Author: Timothy Sullivan <[email protected]>
Date:   Wed Nov 11 15:47:50 2020 -0700

    [Build Chromium] Improve git checkout

commit 61b4e05
Author: Timothy Sullivan <[email protected]>
Date:   Wed Nov 11 20:15:43 2020 -0700

    --wip-- [skip ci]

commit 58300c9
Author: Timothy Sullivan <[email protected]>
Date:   Wed Nov 11 15:47:50 2020 -0700

    [Build Chromium] Improve git checkout

* Apply suggestions from code review

Co-authored-by: Joel Griffith <[email protected]>

Co-authored-by: Joel Griffith <[email protected]>
Co-authored-by: Kibana Machine <[email protected]>

Co-authored-by: Joel Griffith <[email protected]>
Co-authored-by: Kibana Machine <[email protected]>
tsullivan added a commit that referenced this pull request Dec 29, 2020
* [Build Chromium] Document steps for local build, improve checkout

commit e817796d107d554504870cdb8e6dd10db1079a1e
Merge: 19e6b300260 61b4e05
Author: Timothy Sullivan <[email protected]>
Date:   Thu Nov 12 13:25:09 2020 -0700

    Merge branch 'chore/build_chromium/improvements' of github.com:tsullivan/kibana into chore/build_chromium/improvements

commit 19e6b300260822418cea4dc594bdfdf621a331e0
Author: Timothy Sullivan <[email protected]>
Date:   Thu Nov 12 13:23:01 2020 -0700

    fixes

commit 9de24ec298792a46e88207f41c9f6aff1997dbf1
Author: Timothy Sullivan <[email protected]>
Date:   Thu Nov 12 13:22:52 2020 -0700

    add instructions to build local

commit 872c0f68e0077ad50c541b605a87253befd1a891
Author: Timothy Sullivan <[email protected]>
Date:   Thu Nov 12 11:58:25 2020 -0700

    simplify

commit 8dae9484efcdc483ad20ceab32cae4e97735ab1c
Author: Timothy Sullivan <[email protected]>
Date:   Thu Nov 12 10:28:18 2020 -0700

    fixes

commit 492f5cfe25e2c7ccffce55a8733383a30aae1cb6
Author: Timothy Sullivan <[email protected]>
Date:   Wed Nov 11 20:15:43 2020 -0700

    --wip-- [skip ci]

commit acba359b121f7be8e6c353f90e938bc5d88658a1
Author: Timothy Sullivan <[email protected]>
Date:   Wed Nov 11 15:47:50 2020 -0700

    [Build Chromium] Improve git checkout

commit 61b4e05
Author: Timothy Sullivan <[email protected]>
Date:   Wed Nov 11 20:15:43 2020 -0700

    --wip-- [skip ci]

commit 58300c9
Author: Timothy Sullivan <[email protected]>
Date:   Wed Nov 11 15:47:50 2020 -0700

    [Build Chromium] Improve git checkout

* Apply suggestions from code review

Co-authored-by: Joel Griffith <[email protected]>

Co-authored-by: Joel Griffith <[email protected]>
Co-authored-by: Kibana Machine <[email protected]>

Co-authored-by: Joel Griffith <[email protected]>
Co-authored-by: Kibana Machine <[email protected]>
gmmorris added a commit to gmmorris/kibana that referenced this pull request Dec 30, 2020
* master: (108 commits)
  [DOCS] Refreshes Data Visualizer screenshot (elastic#87017)
  [Security Solution] Change 'anti-virus' text to 'antivirus' (elastic#87001)
  [securitySolution/cypress] temporarily limit to PRs
  [AppServices/Examples] Add the example for Reporting integration (elastic#82091)
  [Build Chromium] Improve git checkout (elastic#83225)
  Deprecate `services.callCluster` in alerts and actions executors (elastic#86474)
  [Security Solution] Use system node version for Cypress and increase exec command timeout (elastic#86985)
  [Lens] Add more chart editor tests based on the debug state (elastic#86750)
  [Lens] Integrate searchSessionId into Lens app (elastic#86297)
  skip "pagination updates results and page number" elastic#86975
  skip "Custom detection rules" elastic#83772
  [logging/json] use merge from kbn/std (elastic#86330)
  skip network and timeline inspection. elastic#85677, elastic#85678
  skip "adds correctly a filter to the global search bar" elastic#86552
  [ftr/flags] improve help text (elastic#86971)
  skip "Fields Browser rendering. elastic#60209
  skip "Closes and opens alerts" elastic#83773
  [Security Solution] Skip failing Cypress tests (elastic#86967)
  Removes archives (elastic#86537)
  [ML] Fix charts grid on the Anomaly Explorer page (elastic#86904)
  ...
gmmorris added a commit to gmmorris/kibana that referenced this pull request Dec 30, 2020
* master: (72 commits)
  [DOCS] Refreshes Data Visualizer screenshot (elastic#87017)
  [Security Solution] Change 'anti-virus' text to 'antivirus' (elastic#87001)
  [securitySolution/cypress] temporarily limit to PRs
  [AppServices/Examples] Add the example for Reporting integration (elastic#82091)
  [Build Chromium] Improve git checkout (elastic#83225)
  Deprecate `services.callCluster` in alerts and actions executors (elastic#86474)
  [Security Solution] Use system node version for Cypress and increase exec command timeout (elastic#86985)
  [Lens] Add more chart editor tests based on the debug state (elastic#86750)
  [Lens] Integrate searchSessionId into Lens app (elastic#86297)
  skip "pagination updates results and page number" elastic#86975
  skip "Custom detection rules" elastic#83772
  [logging/json] use merge from kbn/std (elastic#86330)
  skip network and timeline inspection. elastic#85677, elastic#85678
  skip "adds correctly a filter to the global search bar" elastic#86552
  [ftr/flags] improve help text (elastic#86971)
  skip "Fields Browser rendering. elastic#60209
  skip "Closes and opens alerts" elastic#83773
  [Security Solution] Skip failing Cypress tests (elastic#86967)
  Removes archives (elastic#86537)
  [ML] Fix charts grid on the Anomaly Explorer page (elastic#86904)
  ...
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.11.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants