From 42176068321a1d9f68a6e2ec913ee350a942eb03 Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Mon, 24 May 2021 08:18:18 -0700 Subject: [PATCH] More fixes for actions that shouldn't upload to remote-cache Similar to #1856. I found these by patching that PR and running through a big monorepo and searching execution log for more remote cache uploads over 10MB --- container/layer.bzl | 5 +++++ docker/package_managers/install_pkgs.bzl | 6 ++++++ docker/util/run.bzl | 6 ++++++ 3 files changed, 17 insertions(+) diff --git a/container/layer.bzl b/container/layer.bzl index 5b85e2520..0268d3912 100644 --- a/container/layer.bzl +++ b/container/layer.bzl @@ -151,6 +151,11 @@ def build_layer( arguments = [args], tools = files + file_map.values() + tars + debs + [manifest_file], 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", ) diff --git a/docker/package_managers/install_pkgs.bzl b/docker/package_managers/install_pkgs.bzl index 6e3bf1e66..5fba31224 100644 --- a/docker/package_managers/install_pkgs.bzl +++ b/docker/package_managers/install_pkgs.bzl @@ -126,6 +126,12 @@ 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, use_default_shell_env = True, diff --git a/docker/util/run.bzl b/docker/util/run.bzl index 181856eb8..17106de06 100644 --- a/docker/util/run.bzl +++ b/docker/util/run.bzl @@ -386,6 +386,12 @@ 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, )