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

Update bazel and other CI improvements #13246

Merged
merged 7 commits into from
Dec 1, 2023
Merged

Conversation

prestonvanloon
Copy link
Member

@prestonvanloon prestonvanloon commented Dec 1, 2023

What type of PR is this?

Other

What does this PR do? Why is it needed?

Updates bazel to v6.4.0, which has various improvements including using BLAKE3 for the digest function. Although it is not supported by some remote caches at this time (see: buchgr/bazel-remote#710).

In CI, the following flags are applied:

  • Use remote_download_minimal to decrease the cache fetches, whenever possible
  • Give the JVM a bit more memory (helps with OOM issues, maybe)
  • Only build runfile links when required. The runfile SymlinkTree forest is a large part of the execution phase.

The race detection test targets have been deleted. These will be discovered and run in a separate step in CI as follows:

bazel query "attr(tags, '\\bCI_race_detection\\b', //...)" | xargs bazel test --@io_bazel_rules_go//go/config:race

Which issues(s) does this PR fix?

Slight improvements to CI

Other notes for review

Build stats on a clean, expunged repo, without caching, 32 cores linux amd64.

Before:


=== PHASE SUMMARY INFORMATION ===

Total launch phase time                              0.649 s    0.09%
Total init phase time                                1.955 s    0.28%
Total target pattern evaluation phase time           9.234 s    1.32%
Total interleaved loading-and-analysis phase time   28.392 s    4.07%
Total preparation phase time                         0.017 s    0.00%
Total execution phase time                         657.912 s   94.23%
Total finish phase time                              0.064 s    0.01%
---------------------------------------------------------------------
Total run time                                     698.226 s  100.00%

Critical path (117.392 s):
       Time Percentage   Description
   28.600 s   24.36%   action 'GoToolchainBinaryBuild external/go_sdk/builder [for tool]'
    0.58 ms    0.00%   action 'Creating symlink bazel-out/k8-opt-exec-2B5CBBC6-ST-cef3ee1797e4/bin/external/go_sdk/builder_reset/builder [for tool]'
   31.155 s   26.54%   action 'GoStdlib external/io_bazel_rules_go/stdlib_/pkg [for tool]'
     695 ms    0.59%   action 'GoCompilePkg external/org_golang_x_tools/internal/typeparams/typeparams.a [for tool]'
     517 ms    0.44%   action 'GoCompilePkg external/org_golang_x_tools/go/ast/astutil/astutil.a [for tool]'
     118 ms    0.10%   action 'GoCompilePkg external/org_golang_x_tools/go/types/typeutil/typeutil.a [for tool]'
     928 ms    0.79%   action 'GoCompilePkg external/org_golang_x_tools/go/ssa/ssa.a [for tool]'
     132 ms    0.11%   action 'GoCompilePkg external/org_golang_x_tools/go/analysis/passes/buildssa/buildssa.a [for tool]'
     101 ms    0.09%   action 'GoCompilePkg external/org_golang_x_tools/go/analysis/passes/nilness/nilness.a [for tool]'
     767 ms    0.65%   action 'GoCompilePkg nogo_actual~nogo.a [for tool]'
    1.621 s    1.38%   action 'GoLink nogo_actual_/nogo_actual [for tool]'
   10.510 s    8.95%   action 'GoCompilePkg external/com_github_ethereum_go_ethereum/crypto/secp256k1/secp256k1.a'
     671 ms    0.57%   action 'GoCompilePkg external/com_github_ethereum_go_ethereum/crypto/crypto.a'
     692 ms    0.59%   action 'GoCompilePkg external/com_github_ethereum_go_ethereum/core/types/types.a'
     631 ms    0.54%   action 'GoCompilePkg proto/engine/v1/go_default_library.a'
    4.987 s    4.25%   action 'GoCompilePkg proto/prysm/v1alpha1/go_default_library.a'
     247 ms    0.21%   action 'GoCompilePkg container/trie/go_default_library.a'
     357 ms    0.30%   action 'GoCompilePkg encoding/ssz/go_default_library.a'
     223 ms    0.19%   action 'GoCompilePkg beacon-chain/state/stateutil/go_default_library.a'
     810 ms    0.69%   action 'GoCompilePkg beacon-chain/state/fieldtrie/go_default_library.a'
     956 ms    0.81%   action 'GoCompilePkg beacon-chain/state/state-native/go_default_library.a'
     524 ms    0.45%   action 'GoCompilePkg encoding/ssz/detect/go_default_library.a'
     684 ms    0.58%   action 'GoCompilePkg beacon-chain/db/kv/go_default_library.a'
     593 ms    0.51%   action 'GoCompilePkg beacon-chain/db/go_default_library.a'
     214 ms    0.18%   action 'GoCompilePkg beacon-chain/sync/backfill/go_default_library.a'
     491 ms    0.42%   action 'GoCompilePkg beacon-chain/state/stategen/go_default_library.a'
    1.004 s    0.86%   action 'GoCompilePkg beacon-chain/execution/go_default_library.a'
    1.199 s    1.02%   action 'GoCompilePkg beacon-chain/blockchain/go_default_library.a'
    1.431 s    1.22%   action 'GoCompilePkg beacon-chain/sync/go_default_library.a'
    1.131 s    0.96%   action 'GoCompilePkg beacon-chain/rpc/eth/shared/go_default_library.a'
    1.275 s    1.09%   action 'GoCompilePkg api/client/builder/go_default_library.a'
     341 ms    0.29%   action 'GoCompilePkg beacon-chain/builder/go_default_library.a'
     717 ms    0.61%   action 'GoCompilePkg beacon-chain/rpc/prysm/v1alpha1/validator/go_default_library.a'
     712 ms    0.61%   action 'GoCompilePkg beacon-chain/rpc/go_default_library.a'
    1.007 s    0.86%   action 'GoCompilePkg beacon-chain/node/go_default_library.a'
     480 ms    0.41%   action 'GoCompilePkg cmd/beacon-chain/sync/checkpoint/go_default_library.a'
     785 ms    0.67%   action 'GoCompilePkg cmd/beacon-chain/sync/genesis/go_default_library.a'
     402 ms    0.34%   action 'GoCompilePkg cmd/beacon-chain/beacon-chain.a'
    7.544 s    6.43%   action 'GoLink cmd/beacon-chain/beacon-chain_/beacon-chain'
     859 ms    0.73%   action 'Writing  bazel-out/k8-fastbuild/bin/beacon-chain/package/beacon-chain-bin.tar'
   10.778 s    9.18%   action 'Writing  bazel-out/k8-fastbuild/bin/beacon-chain/package/debian-data.tar.gz'
     501 ms    0.43%   action 'MakeDeb beacon-chain/package/prysm-beacon-chain__amd64.deb'
    0.37 ms    0.00%   action 'Creating symlink bazel-out/k8-fastbuild/bin/beacon-chain/package/deb.deb'

After


=== PHASE SUMMARY INFORMATION ===

Total launch phase time                              0.953 s    0.18%
Total init phase time                                1.789 s    0.34%
Total target pattern evaluation phase time           8.397 s    1.57%
Total interleaved loading-and-analysis phase time   24.626 s    4.61%
Total preparation phase time                         0.014 s    0.00%
Total execution phase time                         498.057 s   93.29%
Total finish phase time                              0.024 s    0.00%
---------------------------------------------------------------------
Total run time                                     533.862 s  100.00%

Critical path (97.498 s):
       Time Percentage   Description
   27.333 s   28.04%   action 'GoToolchainBinaryBuild external/go_sdk/builder [for tool]'
    0.49 ms    0.00%   action 'Creating symlink bazel-out/k8-opt-exec-2B5CBBC6-ST-cef3ee1797e4/bin/external/go_sdk/builder_reset/builder [for tool]'
   30.027 s   30.80%   action 'GoStdlib external/io_bazel_rules_go/stdlib_/pkg [for tool]'
    81.4 ms    0.08%   action 'GoCompilePkg external/org_golang_x_tools/internal/typeparams/typeparams.a [for tool]'
     538 ms    0.55%   action 'GoCompilePkg external/org_golang_x_tools/go/ast/astutil/astutil.a [for tool]'
     105 ms    0.11%   action 'GoCompilePkg external/org_golang_x_tools/go/types/typeutil/typeutil.a [for tool]'
    1.149 s    1.18%   action 'GoCompilePkg external/org_golang_x_tools/go/ssa/ssa.a [for tool]'
     516 ms    0.53%   action 'GoCompilePkg external/org_golang_x_tools/go/analysis/passes/buildssa/buildssa.a [for tool]'
    88.0 ms    0.09%   action 'GoCompilePkg external/org_golang_x_tools/go/analysis/passes/nilness/nilness.a [for tool]'
     285 ms    0.29%   action 'GoCompilePkg nogo_actual~nogo.a [for tool]'
    1.869 s    1.92%   action 'GoLink nogo_actual_/nogo_actual [for tool]'
     155 ms    0.16%   action 'GoCompilePkg external/org_golang_google_protobuf/internal/detrand/detrand.a'
    92.5 ms    0.09%   action 'GoCompilePkg external/org_golang_google_protobuf/internal/errors/errors.a'
     116 ms    0.12%   action 'GoCompilePkg external/org_golang_google_protobuf/encoding/protowire/protowire.a'
     784 ms    0.80%   action 'GoCompilePkg external/org_golang_google_protobuf/reflect/protoreflect/protoreflect.a'
     447 ms    0.46%   action 'GoCompilePkg external/org_golang_google_protobuf/internal/strs/strs.a'
     237 ms    0.24%   action 'GoCompilePkg external/org_golang_google_protobuf/internal/encoding/text/text.a'
     257 ms    0.26%   action 'GoCompilePkg external/org_golang_google_protobuf/internal/encoding/defval/defval.a'
     720 ms    0.74%   action 'GoCompilePkg external/org_golang_google_protobuf/internal/filedesc/filedesc.a'
     104 ms    0.11%   action 'GoCompilePkg external/org_golang_google_protobuf/internal/encoding/tag/tag.a'
    1.163 s    1.19%   action 'GoCompilePkg external/org_golang_google_protobuf/internal/impl/impl.a'
     252 ms    0.26%   action 'GoCompilePkg external/org_golang_google_protobuf/internal/filetype/filetype.a'
     172 ms    0.18%   action 'GoCompilePkg external/org_golang_google_protobuf/runtime/protoimpl/protoimpl.a'
     500 ms    0.51%   action 'GoCompilePkg external/org_golang_google_protobuf/types/descriptorpb/descriptorpb.a'
     768 ms    0.79%   action 'GoCompilePkg external/org_golang_google_protobuf/reflect/protodesc/protodesc.a'
     530 ms    0.54%   action 'GoCompilePkg external/com_github_golang_protobuf/proto/proto.a'
     243 ms    0.25%   action 'GoCompilePkg external/com_github_prometheus_client_model/go/go.a'
     972 ms    1.00%   action 'GoCompilePkg external/com_github_prometheus_common/expfmt/expfmt.a'
     462 ms    0.47%   action 'GoCompilePkg external/com_github_prometheus_client_golang/prometheus/prometheus.a'
     139 ms    0.14%   action 'GoCompilePkg external/com_github_prometheus_client_golang/prometheus/promauto/promauto.a'
    94.6 ms    0.10%   action 'GoCompilePkg runtime/version/go_default_library.a'
     424 ms    0.43%   action 'GoCompilePkg config/params/go_default_library.a'
     196 ms    0.20%   action 'GoCompilePkg proto/engine/v1/go_default_library.a'
    2.053 s    2.11%   action 'GoCompilePkg proto/prysm/v1alpha1/go_default_library.a'
     407 ms    0.42%   action 'GoCompilePkg proto/prysm/v1alpha1/validator-client/go_default_library.a'
     109 ms    0.11%   action 'GoCompilePkg consensus-types/interfaces/go_default_library.a'
     483 ms    0.49%   action 'GoCompilePkg beacon-chain/state/go_default_library.a'
     415 ms    0.43%   action 'GoCompilePkg beacon-chain/core/time/go_default_library.a'
     507 ms    0.52%   action 'GoCompilePkg beacon-chain/core/helpers/go_default_library.a'
     219 ms    0.22%   action 'GoCompilePkg beacon-chain/core/validators/go_default_library.a'
     324 ms    0.33%   action 'GoCompilePkg beacon-chain/core/blocks/go_default_library.a'
     619 ms    0.64%   action 'GoCompilePkg beacon-chain/db/kv/go_default_library.a'
     258 ms    0.27%   action 'GoCompilePkg beacon-chain/db/go_default_library.a'
     284 ms    0.29%   action 'GoCompilePkg beacon-chain/sync/backfill/go_default_library.a'
     896 ms    0.92%   action 'GoCompilePkg beacon-chain/state/stategen/go_default_library.a'
    1.122 s    1.15%   action 'GoCompilePkg beacon-chain/execution/go_default_library.a'
    1.102 s    1.13%   action 'GoCompilePkg beacon-chain/blockchain/go_default_library.a'
    1.399 s    1.44%   action 'GoCompilePkg beacon-chain/sync/go_default_library.a'
     788 ms    0.81%   action 'GoCompilePkg beacon-chain/rpc/eth/shared/go_default_library.a'
    1.190 s    1.22%   action 'GoCompilePkg beacon-chain/rpc/eth/helpers/go_default_library.a'
     595 ms    0.61%   action 'GoCompilePkg beacon-chain/rpc/eth/beacon/go_default_library.a'
     760 ms    0.78%   action 'GoCompilePkg api/client/beacon/go_default_library.a'
     617 ms    0.63%   action 'GoCompilePkg beacon-chain/sync/genesis/go_default_library.a'
    1.474 s    1.51%   action 'GoCompilePkg beacon-chain/node/go_default_library.a'
     553 ms    0.57%   action 'GoCompilePkg cmd/beacon-chain/sync/checkpoint/go_default_library.a'
     289 ms    0.30%   action 'GoCompilePkg cmd/beacon-chain/sync/genesis/go_default_library.a'
     301 ms    0.31%   action 'GoCompilePkg cmd/beacon-chain/beacon-chain.a'
    3.653 s    3.75%   action 'GoLink cmd/beacon-chain/beacon-chain_/beacon-chain'
     276 ms    0.28%   action 'Writing  bazel-out/k8-fastbuild/bin/beacon-chain/package/beacon-chain-bin.tar'
    5.862 s    6.01%   action 'Writing  bazel-out/k8-fastbuild/bin/beacon-chain/package/debian-data.tar.gz'
     125 ms    0.13%   action 'MakeDeb beacon-chain/package/prysm-beacon-chain__amd64.deb'
    0.41 ms    0.00%   action 'Creating symlink bazel-out/k8-fastbuild/bin/beacon-chain/package/deb.deb'

There is a reduction of 164 seconds (~23%) to build all targets.

@prestonvanloon prestonvanloon added Ready For Review A pull request ready for code review CI Continuous integration related items OK to merge labels Dec 1, 2023
Copy link
Contributor

@kasey kasey left a comment

Choose a reason for hiding this comment

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

my hero <3

@prylabs-bulldozer prylabs-bulldozer bot merged commit b68a4e1 into develop Dec 1, 2023
17 checks passed
@prylabs-bulldozer prylabs-bulldozer bot deleted the update-bazel branch December 1, 2023 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Continuous integration related items Ready For Review A pull request ready for code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants