Skip to content

Commit

Permalink
perf: remove no-remote-cache execution requirements (#2043)
Browse files Browse the repository at this point in the history
These were introduced to reduce load on a remote-cache instance to avoid network saturation.
A month later, a feature was added in one remote-cache implementatation which provides a different fix:
buchgr/bazel-remote#440 rejects large input files on upload.

In practice, while these action do often produce huge outputs, they are also slow to re-execute.
In many cases it's worth it to use a remote-cache for RunAndCommitLayer in particular to avoid a local rebuild
even though it's a large network fetch.
Currently users can't configure this because we've hardcoded the values. If they do want to keep the
no-remote-cache execution requirement, they can do this via a tag (provided they opt-in to
experimental_allow_tags_propagation, see bazelbuild/bazel#8830)

#1856 (comment) is an example of a user
asking for these to be removed.
  • Loading branch information
alexeagle authored Mar 16, 2022
1 parent 0b1a033 commit 094a012
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 34 deletions.
5 changes: 0 additions & 5 deletions container/layer.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,6 @@ def build_layer(
input_manifests = xz_input_manifests,
tools = files + file_map.values() + tars + debs + [manifest_file] + xz_tools,
outputs = [layer],
execution_requirements = {
# This action produces large output files, so it's not
# economical to send this to the remote-cache
"no-remote-cache": "1",
},
use_default_shell_env = True,
mnemonic = "ImageLayer",
)
Expand Down
6 changes: 0 additions & 6 deletions container/layer_tools.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,6 @@ def assemble(
arguments = [args],
tools = inputs,
outputs = [output],
execution_requirements = {
# This action produces large output files, but doesn't require much CPU to compute.
# It's not economical to send this to the remote-cache, instead local cache misses
# should just run join_layers again.
"no-remote-cache": "1",
},
mnemonic = "JoinLayers",
)

Expand Down
5 changes: 0 additions & 5 deletions docker/package_managers/install_pkgs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,6 @@ def _impl(ctx, image_tar = None, installables_tar = None, installation_cleanup_c
installables_tar,
image_util,
],
execution_requirements = {
# This action produces large output files, and isn't economical to
# upload to a remote cache.
"no-remote-cache": "1",
},
mnemonic = "ExtractImageId",
tools = [ctx.executable._extract_image_id, ctx.executable._to_json_tool],
executable = script,
Expand Down
5 changes: 0 additions & 5 deletions docker/util/run.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -396,11 +396,6 @@ def _commit_layer_impl(
outputs = [output_layer_tar, output_diff_id],
inputs = runfiles,
executable = script,
execution_requirements = {
# This action produces large output files, and isn't economical to
# upload to a remote cache.
"no-remote-cache": "1",
},
mnemonic = "RunAndCommitLayer",
tools = [ctx.executable._extract_image_id, ctx.executable._last_layer_extractor_tool],
use_default_shell_env = True,
Expand Down
13 changes: 0 additions & 13 deletions skylib/zip.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,6 @@ def _gzip(ctx, artifact, out, decompress, options, mnemonic):
) + (options or []),
inputs = [artifact],
outputs = [out],
execution_requirements = {
# This action produces large output files, but doesn't require much CPU to compute.
# It's not economical to send this to the remote-cache, instead local cache misses
# should just run gzip again.
"no-remote-cache": "1",
},
mnemonic = mnemonic,
tools = ctx.attr._zipper[DefaultInfo].default_runfiles.files,
)
Expand All @@ -75,13 +69,6 @@ def _gzip(ctx, artifact, out, decompress, options, mnemonic):
input_manifests = input_manifests,
inputs = [artifact],
outputs = [out],
execution_requirements = {
# See comment above.
# In this case it's not guaranteed that the user's gzip implementation
# is actually faster than a network fetch, but we guess that any typical
# one should be.
"no-remote-cache": "1",
},
use_default_shell_env = True,
mnemonic = mnemonic,
tools = tools,
Expand Down

0 comments on commit 094a012

Please sign in to comment.