Docker: Add "manual" build tag to reduce build times in CI (#12967)

* Add manual tags to oci images. This reduces build times for build and test in CI.

* Ran buildifier on tools dir
This commit is contained in:
Preston Van Loon
2023-09-28 12:49:26 -05:00
committed by GitHub
parent 02ee6897bb
commit a7361cd5ab
9 changed files with 71 additions and 66 deletions

View File

@@ -137,4 +137,5 @@ prysm_image_upload(
# Backwards compatiability for images that depended on the old filepath.
"/app/cmd/beacon-chain/beacon-chain": "/beacon-chain",
},
tags = ["manual"],
)

View File

@@ -99,4 +99,5 @@ prysm_image_upload(
# Backwards compatiability for images that depended on the old filepath.
"/app/cmd/prysmctl/prysmctl": "/prysmctl",
},
tags = ["manual"],
)

View File

@@ -132,4 +132,5 @@ prysm_image_upload(
# Backwards compatiability for images that depended on the old filepath.
"/app/cmd/validator/validator": "/validator",
},
tags = ["manual"],
)

View File

@@ -5,11 +5,11 @@ load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
go_library(
name = "go_default_library",
srcs = ["main.go"],
importpath = "github.com/prysmaticlabs/prysm/v4/tools/beacon-fuzz",
visibility = ["//visibility:private"],
deps = [
"//io/file:go_default_library",
],
importpath = "github.com/prysmaticlabs/prysm/v4/tools/beacon-fuzz",
visibility = ["//visibility:private"],
)
go_binary(

View File

@@ -34,7 +34,6 @@ def cc_autoconf_toolchains_impl(repository_ctx):
else:
repository_ctx.file("BUILD", "# C++ toolchain autoconfiguration was disabled by BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN env variable.")
def cc_autoconf_impl(repository_ctx, overriden_tools = dict()):
"""Generate BUILD file with 'cc_toolchain' targets for the local host C++ toolchain.
@@ -46,7 +45,7 @@ def cc_autoconf_impl(repository_ctx, overriden_tools = dict()):
if cpu_value.startswith("darwin"):
print("Configuring local C++ toolchain for Darwin. This is non-hermetic and builds may " +
"not be reproducible. Consider building on linux for a hermetic build.")
"not be reproducible. Consider building on linux for a hermetic build.")
configure_unix_toolchain(repository_ctx, cpu_value, overriden_tools)
else:
paths = resolve_labels(repository_ctx, [

View File

@@ -1,48 +1,46 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file")
def prysm_image_deps():
http_file(
name = "bash_amd64",
sha256 = "f702ef058e762d7208a9c83f6f6bbf02645533bfd615c54e8cdcce842cd57377",
urls = [
"http://ftp.us.debian.org/debian/pool/main/b/bash/bash_5.1-2+deb11u1_amd64.deb",
"http://http.us.debian.org/debian/pool/main/b/bash/bash_5.1-2+deb11u1_amd64.deb",
"http://ftp.uk.debian.org/debian/pool/main/b/bash/bash_5.1-2+deb11u1_amd64.deb",
"http://ftp.au.debian.org/debian/pool/main/b/bash/bash_5.1-2+deb11u1_amd64.deb",
],
)
http_file(
name = "bash_amd64",
sha256 = "f702ef058e762d7208a9c83f6f6bbf02645533bfd615c54e8cdcce842cd57377",
urls = [
"http://ftp.us.debian.org/debian/pool/main/b/bash/bash_5.1-2+deb11u1_amd64.deb",
"http://http.us.debian.org/debian/pool/main/b/bash/bash_5.1-2+deb11u1_amd64.deb",
"http://ftp.uk.debian.org/debian/pool/main/b/bash/bash_5.1-2+deb11u1_amd64.deb",
"http://ftp.au.debian.org/debian/pool/main/b/bash/bash_5.1-2+deb11u1_amd64.deb",
],
)
http_file(
name = "bash_arm64",
sha256 = "d7c7af5d86f43a885069408a89788f67f248e8124c682bb73936f33874e0611b",
urls = [
"http://ftp.us.debian.org/debian/pool/main/b/bash/bash_5.1-2+deb11u1_arm64.deb",
"http://http.us.debian.org/debian/pool/main/b/bash/bash_5.1-2+deb11u1_arm64.deb",
"http://ftp.uk.debian.org/debian/pool/main/b/bash/bash_5.1-2+deb11u1_arm64.deb",
"http://ftp.au.debian.org/debian/pool/main/b/bash/bash_5.1-2+deb11u1_arm64.deb",
],
)
http_file(
name = "libtinfo6_amd64",
sha256 = "92ac8a8c12f02a6fe08c47f33ea6fb313e1b9480484e26eab34e2058ea59fdb4",
urls = [
"http://ftp.us.debian.org/debian/pool/main/n/ncurses/libtinfo6_6.2+20201114-2+deb11u1_amd64.deb",
"http://http.us.debian.org/debian/pool/main/n/ncurses/libtinfo6_6.2+20201114-2+deb11u1_amd64.deb",
"http://ftp.uk.debian.org/debian/pool/main/n/ncurses/libtinfo6_6.2+20201114-2+deb11u1_amd64.deb",
"http://ftp.au.debian.org/debian/pool/main/n/ncurses/libtinfo6_6.2+20201114-2+deb11u1_amd64.deb",
],
)
http_file(
name = "libtinfo6_arm64",
sha256 = "8282a785437b305bca7758aba19252bd81b5d0d2a54b709af97e682516f1cf4e",
urls = [
"http://ftp.us.debian.org/debian/pool/main/n/ncurses/libtinfo6_6.2+20201114-2+deb11u1_arm64.deb",
"http://http.us.debian.org/debian/pool/main/n/ncurses/libtinfo6_6.2+20201114-2+deb11u1_arm64.deb",
"http://ftp.uk.debian.org/debian/pool/main/n/ncurses/libtinfo6_6.2+20201114-2+deb11u1_arm64.deb",
"http://ftp.au.debian.org/debian/pool/main/n/ncurses/libtinfo6_6.2+20201114-2+deb11u1_arm64.deb",
],
)
http_file(
name = "bash_arm64",
sha256 = "d7c7af5d86f43a885069408a89788f67f248e8124c682bb73936f33874e0611b",
urls = [
"http://ftp.us.debian.org/debian/pool/main/b/bash/bash_5.1-2+deb11u1_arm64.deb",
"http://http.us.debian.org/debian/pool/main/b/bash/bash_5.1-2+deb11u1_arm64.deb",
"http://ftp.uk.debian.org/debian/pool/main/b/bash/bash_5.1-2+deb11u1_arm64.deb",
"http://ftp.au.debian.org/debian/pool/main/b/bash/bash_5.1-2+deb11u1_arm64.deb",
],
)
http_file(
name = "libtinfo6_amd64",
sha256 = "92ac8a8c12f02a6fe08c47f33ea6fb313e1b9480484e26eab34e2058ea59fdb4",
urls = [
"http://ftp.us.debian.org/debian/pool/main/n/ncurses/libtinfo6_6.2+20201114-2+deb11u1_amd64.deb",
"http://http.us.debian.org/debian/pool/main/n/ncurses/libtinfo6_6.2+20201114-2+deb11u1_amd64.deb",
"http://ftp.uk.debian.org/debian/pool/main/n/ncurses/libtinfo6_6.2+20201114-2+deb11u1_amd64.deb",
"http://ftp.au.debian.org/debian/pool/main/n/ncurses/libtinfo6_6.2+20201114-2+deb11u1_amd64.deb",
],
)
http_file(
name = "libtinfo6_arm64",
sha256 = "8282a785437b305bca7758aba19252bd81b5d0d2a54b709af97e682516f1cf4e",
urls = [
"http://ftp.us.debian.org/debian/pool/main/n/ncurses/libtinfo6_6.2+20201114-2+deb11u1_arm64.deb",
"http://http.us.debian.org/debian/pool/main/n/ncurses/libtinfo6_6.2+20201114-2+deb11u1_arm64.deb",
"http://ftp.uk.debian.org/debian/pool/main/n/ncurses/libtinfo6_6.2+20201114-2+deb11u1_arm64.deb",
"http://ftp.au.debian.org/debian/pool/main/n/ncurses/libtinfo6_6.2+20201114-2+deb11u1_arm64.deb",
],
)

View File

@@ -3,16 +3,17 @@ load("@rules_pkg//:pkg.bzl", "pkg_tar")
load("//tools:multi_arch.bzl", "multi_arch")
def prysm_image_upload(
name,
binary,
entrypoint,
symlinks,
repository):
name,
binary,
entrypoint,
symlinks,
repository,
tags):
pkg_tar(
name = "binary_tar",
srcs = [binary],
symlinks=symlinks,
symlinks = symlinks,
tags = tags,
)
oci_image(
@@ -25,6 +26,7 @@ def prysm_image_upload(
"//tools:bash_tar",
":binary_tar",
],
tags = tags,
)
multi_arch(
@@ -34,6 +36,7 @@ def prysm_image_upload(
"@io_bazel_rules_go//go/toolchain:linux_amd64_cgo",
"@io_bazel_rules_go//go/toolchain:linux_arm64_cgo",
],
tags = tags,
)
oci_image_index(
@@ -41,10 +44,12 @@ def prysm_image_upload(
images = [
":oci_multiarch",
],
tags = tags,
)
oci_push(
name = name,
image = ":oci_image_index",
repository = repository,
tags = tags,
)

View File

@@ -1,8 +1,8 @@
def moved_targets(targets, new_package):
for target in targets:
native.alias(
name=target[1:],
actual=new_package+target,
deprecation="This target has moved to %s%s"%(new_package,target),
tags = ["manual"],
)
for target in targets:
native.alias(
name = target[1:],
actual = new_package + target,
deprecation = "This target has moved to %s%s" % (new_package, target),
tags = ["manual"],
)