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(NA): enable bazel exports directories only at yarn_install #104180

Merged
merged 3 commits into from
Jul 1, 2021

Conversation

mistic
Copy link
Member

@mistic mistic commented Jul 1, 2021

One step forward on #69706

That PR enables a feature available in the last rules node js version called exports-directories-only. At the yarn install phase bazel generates build files for each node module. Previously it was considering each file as part of the content which sometimes generates problems at bootstrap (expected files are not there) and also includes a performance penalty. With the new feature on it only considers each node module as tree artifact no matter what files is inside of it. I've registered a ~40% performance improvement on a raw, clean and zero cache yarn kbn bootstrap (that can be simulated with the yarn kbn reset command).

@mistic mistic added chore Team:Operations Team label for Operations Team v8.0.0 release_note:skip Skip the PR/issue when compiling release notes auto-backport Deprecated - use backport:version if exact versions are needed v7.15.0 labels Jul 1, 2021
@mistic mistic requested a review from jbudz July 1, 2021 18:11
@mistic mistic requested a review from a team as a code owner July 1, 2021 18:11
@elasticmachine
Copy link
Contributor

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

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.

 info [bazel] build-runfiles error: CreateSymbolicLinkW failed:
 info [bazel] Bazel needs to create symlink for building runfiles tree.
 info [bazel] Creating symlink on Windows requires either of the following:
 info [bazel]     1. Program is running with elevated privileges (Admin rights).
 info [bazel]     2. The system version is Windows 10 Creators Update (1703) or later and developer mode is enabled.
 info [bazel]
 info [bazel] manifest file name: bazel-out/host/bin/external/npm/@bazel/typescript/bin/ts_project_options_validator.bat.runfiles_manifest
 info [bazel] runfiles base directory: bazel-out/host/bin/external/npm/@bazel/typescript/bin/ts_project_options_validator.bat.runfiles
 info [bazel] Target //packages:build failed to build
 info [bazel] Use --verbose_failures to see the command lines of failed build steps.
 info [bazel] ERROR: C:/users/jon/kibana/packages/kbn-ace/BUILD.bazel:72:8 Assembling npm package packages/kbn-ace/npm_module failed: build-runfiles.exe failed: error executing command
 info [bazel]   cd C:\users\jon\_bazel_jon\oha3m66j\execroot\kibana
 info [bazel]   SET PATH=C:\Program Files\Git\usr\bin;C:\Program Files\Git\bin;C:\Windows;C:\Windows\System32;C:\Windows\System32\WindowsPowerShell\v1.0
 info [bazel]   C:/users/jon/_bazel_jon/install/2892b90e19bb7ffd8c1021167002c944/build-runfiles.exe bazel-out/host/bin/external/npm/@bazel/typescript/bin/ts_project_options_validator.bat.runfiles_manifest bazel-out/host/bin/external/npm/@bazel/typescript/bin/ts_project_options_validator.bat.runfiles: Process exited with status 1: Process exited with status 1

I'll enable developer mode and report back.

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.

Developer mode on Windows worked - if we're okay requiring that change LGTM. I'm seeing similar performance improvements.

@mistic
Copy link
Member Author

mistic commented Jul 1, 2021

@tylersmalley
Copy link
Contributor

@mistic, yeah it's a big win and already in the docs. Glad to see they got the feature in!

@mistic
Copy link
Member Author

mistic commented Jul 1, 2021

@elasticmachine merge upstream

@mistic mistic enabled auto-merge (squash) July 1, 2021 23:14
@mistic mistic disabled auto-merge July 1, 2021 23:14
@mistic mistic merged commit 2b236b7 into elastic:master Jul 1, 2021
kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Jul 1, 2021
@kibanamachine
Copy link
Contributor

💚 Backport successful

Status Branch Result
7.x

This backport PR will be merged automatically after passing CI.

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

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

kibanamachine added a commit that referenced this pull request Jul 2, 2021
… performance (#104180) (#104234)

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

Co-authored-by: Tiago Costa <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed chore release_note:skip Skip the PR/issue when compiling release notes Team:Operations Team label for Operations Team v7.15.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants