From 341a263906cc3ec5ede5ddd1f7ae22ae19ec665c Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Thu, 24 Oct 2024 14:32:24 -0500 Subject: [PATCH 1/7] Update bazel-lib --- WORKSPACE | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index c9906164adc..a31724160b6 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -101,9 +101,9 @@ http_archive( http_archive( name = "aspect_bazel_lib", - sha256 = "f5ea76682b209cc0bd90d0f5a3b26d2f7a6a2885f0c5f615e72913f4805dbb0d", - strip_prefix = "bazel-lib-2.5.0", - url = "https://github.com/aspect-build/bazel-lib/releases/download/v2.5.0/bazel-lib-v2.5.0.tar.gz", + sha256 = "a272d79bb0ac6b6965aa199b1f84333413452e87f043b53eca7f347a23a478e8", + strip_prefix = "bazel-lib-2.9.3", + url = "https://github.com/bazel-contrib/bazel-lib/releases/download/v2.9.3/bazel-lib-v2.9.3.tar.gz", ) load("@aspect_bazel_lib//lib:repositories.bzl", "aspect_bazel_lib_dependencies", "aspect_bazel_lib_register_toolchains") From 64200fb25e515c78e1d6d68be01a640508373d9d Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Thu, 24 Oct 2024 19:54:21 -0500 Subject: [PATCH 2/7] Update rules_oci --- WORKSPACE | 13 +++++-------- tools/prysm_image.bzl | 4 ++-- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index a31724160b6..f451ac756fe 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -114,21 +114,18 @@ aspect_bazel_lib_register_toolchains() http_archive( name = "rules_oci", - sha256 = "4a276e9566c03491649eef63f27c2816cc222f41ccdebd97d2c5159e84917c3b", - strip_prefix = "rules_oci-1.7.4", - url = "https://github.com/bazel-contrib/rules_oci/releases/download/v1.7.4/rules_oci-v1.7.4.tar.gz", + sha256 = "acbf8f40e062f707f8754e914dcb0013803c6e5e3679d3e05b571a9f5c7e0b43", + strip_prefix = "rules_oci-2.0.1", + url = "https://github.com/bazel-contrib/rules_oci/releases/download/v2.0.1/rules_oci-v2.0.1.tar.gz", ) load("@rules_oci//oci:dependencies.bzl", "rules_oci_dependencies") rules_oci_dependencies() -load("@rules_oci//oci:repositories.bzl", "LATEST_CRANE_VERSION", "oci_register_toolchains") +load("@rules_oci//oci:repositories.bzl", "oci_register_toolchains") -oci_register_toolchains( - name = "oci", - crane_version = LATEST_CRANE_VERSION, -) +oci_register_toolchains(name = "oci") http_archive( name = "io_bazel_rules_go", diff --git a/tools/prysm_image.bzl b/tools/prysm_image.bzl index fa98bb6b6d0..1ecf15e8503 100644 --- a/tools/prysm_image.bzl +++ b/tools/prysm_image.bzl @@ -1,4 +1,4 @@ -load("@rules_oci//oci:defs.bzl", "oci_image", "oci_image_index", "oci_push", "oci_tarball") +load("@rules_oci//oci:defs.bzl", "oci_image", "oci_image_index", "oci_push", "oci_load") load("@rules_pkg//:pkg.bzl", "pkg_tar") load("//tools:multi_arch.bzl", "multi_arch") @@ -75,7 +75,7 @@ def prysm_image_upload( tags = tags, ) - oci_tarball( + oci_load( name = "oci_image_tarball", image = ":oci_image", repo_tags = [repository+":latest"], From 0258c2ea65652a7595bfaa9fb67fe2f6a2c6847e Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Thu, 24 Oct 2024 20:07:29 -0500 Subject: [PATCH 3/7] Compress pkg_tar --- tools/prysm_image.bzl | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/prysm_image.bzl b/tools/prysm_image.bzl index 1ecf15e8503..8775c6abe60 100644 --- a/tools/prysm_image.bzl +++ b/tools/prysm_image.bzl @@ -14,6 +14,7 @@ def prysm_image_upload( srcs = [binary], symlinks = symlinks, tags = tags, + extension = "tar.gz", ) oci_image( From 72fba7a5ff5e8988b3f4d5da90807a7157308efe Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Thu, 24 Oct 2024 20:08:53 -0500 Subject: [PATCH 4/7] Add a note about 401 download for distroless/cc-debian11 --- WORKSPACE | 3 +++ 1 file changed, 3 insertions(+) diff --git a/WORKSPACE b/WORKSPACE index f451ac756fe..c93763dcc28 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -159,6 +159,9 @@ git_repository( load("@rules_oci//oci:pull.bzl", "oci_pull") # A multi-arch base image +# Note: Downloading this image from gcr.io requires docker credentials to be configured from a valid +# gcloud account. If you are seeing a 401 Unauthorized error, consider running the following: +# `gcloud auth configure-docker` oci_pull( name = "linux_debian11_multiarch_base", # Debian bullseye digest = "sha256:b82f113425c5b5c714151aaacd8039bc141821cdcd3c65202d42bdf9c43ae60b", # 2023-12-12 From 86b08dfe1a78892614acd1c5628bd2b689659fc8 Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Thu, 24 Oct 2024 20:14:04 -0500 Subject: [PATCH 5/7] Update CHANGELOG.md --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 48e15ab28b0..4e15f3ccd2e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,8 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve - Fixed mesh size by appending `gParams.Dhi = gossipSubDhi` - Fix skipping partial withdrawals count. +- Certain deb files were returning a 404 which made building new docker images without an existing + cache impossible. This has been fixed with updates to rules_oci and bazel-lib. ### Security From c3c3cd3972f69d24d0a9ac0fe73bdecfaeea9298 Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Thu, 24 Oct 2024 20:22:38 -0500 Subject: [PATCH 6/7] Re-upload distroless/cc-debian11 to prysmaticlabs/distroless/cc-debian11 such that the image is public. Ran the following command: gcrane cp 'gcr.io/distroless/cc-debian11@sha256:b82f113425c5b5c714151aaacd8039bc141821cdcd3c65202d42bdf9c43ae60b' gcr.io/prysmaticlabs/distroless/cc-debian11:latest --- WORKSPACE | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index c93763dcc28..93f66d42087 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -159,13 +159,10 @@ git_repository( load("@rules_oci//oci:pull.bzl", "oci_pull") # A multi-arch base image -# Note: Downloading this image from gcr.io requires docker credentials to be configured from a valid -# gcloud account. If you are seeing a 401 Unauthorized error, consider running the following: -# `gcloud auth configure-docker` oci_pull( name = "linux_debian11_multiarch_base", # Debian bullseye digest = "sha256:b82f113425c5b5c714151aaacd8039bc141821cdcd3c65202d42bdf9c43ae60b", # 2023-12-12 - image = "gcr.io/distroless/cc-debian11", + image = "gcr.io/prysmaticlabs/distroless/cc-debian11", platforms = [ "linux/amd64", "linux/arm64/v8", From af022b18d1c960cb95c720e564553e5142411399 Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Thu, 24 Oct 2024 21:17:03 -0500 Subject: [PATCH 7/7] Back out "Update rules_oci" This backs out commit 64200fb25e515c78e1d6d68be01a640508373d9d. --- WORKSPACE | 13 ++++++++----- tools/prysm_image.bzl | 4 ++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index 93f66d42087..9f52bbccf04 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -114,18 +114,21 @@ aspect_bazel_lib_register_toolchains() http_archive( name = "rules_oci", - sha256 = "acbf8f40e062f707f8754e914dcb0013803c6e5e3679d3e05b571a9f5c7e0b43", - strip_prefix = "rules_oci-2.0.1", - url = "https://github.com/bazel-contrib/rules_oci/releases/download/v2.0.1/rules_oci-v2.0.1.tar.gz", + sha256 = "4a276e9566c03491649eef63f27c2816cc222f41ccdebd97d2c5159e84917c3b", + strip_prefix = "rules_oci-1.7.4", + url = "https://github.com/bazel-contrib/rules_oci/releases/download/v1.7.4/rules_oci-v1.7.4.tar.gz", ) load("@rules_oci//oci:dependencies.bzl", "rules_oci_dependencies") rules_oci_dependencies() -load("@rules_oci//oci:repositories.bzl", "oci_register_toolchains") +load("@rules_oci//oci:repositories.bzl", "LATEST_CRANE_VERSION", "oci_register_toolchains") -oci_register_toolchains(name = "oci") +oci_register_toolchains( + name = "oci", + crane_version = LATEST_CRANE_VERSION, +) http_archive( name = "io_bazel_rules_go", diff --git a/tools/prysm_image.bzl b/tools/prysm_image.bzl index 8775c6abe60..44814784cec 100644 --- a/tools/prysm_image.bzl +++ b/tools/prysm_image.bzl @@ -1,4 +1,4 @@ -load("@rules_oci//oci:defs.bzl", "oci_image", "oci_image_index", "oci_push", "oci_load") +load("@rules_oci//oci:defs.bzl", "oci_image", "oci_image_index", "oci_push", "oci_tarball") load("@rules_pkg//:pkg.bzl", "pkg_tar") load("//tools:multi_arch.bzl", "multi_arch") @@ -76,7 +76,7 @@ def prysm_image_upload( tags = tags, ) - oci_load( + oci_tarball( name = "oci_image_tarball", image = ":oci_image", repo_tags = [repository+":latest"],