Skip to content

Commit

Permalink
Remove broken tar, change http_archive deps to debian_archive, remove…
Browse files Browse the repository at this point in the history
… http mirrors in favor of snapshot
  • Loading branch information
prestonvanloon committed Feb 1, 2024
1 parent 795a3ee commit b63a6c7
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 64 deletions.
36 changes: 0 additions & 36 deletions tools/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -33,39 +33,3 @@ pkg_tar(
visibility = ["//visibility:public"],
)

# Create a bash tar layer for docker images. This allows docker images to have access to the "bash"
# command and improves debugging abilities on the image.
genrule(
name = "bash_tar",
srcs = select({
"@platforms//cpu:x86_64": ["@bash_amd64//file"],
"@platforms//cpu:arm64": ["@bash_arm64//file"],
}),
outs = ["bash.tar"],
cmd = "ar x $< && xz -d data.tar.xz -c >> $@",
visibility = ["//visibility:public"],
)

# libtinfo6 is required for terminal activity and contains terminfo library.
genrule(
name = "libtinfo6_tar",
srcs = select({
"@platforms//cpu:x86_64": ["@libtinfo6_amd64//file"],
"@platforms//cpu:arm64": ["@libtinfo6_arm64//file"],
}),
outs = ["libtinfo6.tar"],
cmd = "ar x $< && xz -d data.tar.xz -c >> $@",
visibility = ["//visibility:public"],
)

# coreutils provides common helpful utlities and is often expected in docker images.
genrule(
name = "coreutils_tar",
srcs = select({
"@platforms//cpu:x86_64": ["@coreutils_amd64//file"],
"@platforms//cpu:arm64": ["@coreutils_arm64//file"],
}),
outs = ["coreutils.tar"],
cmd = "ar x $< && xz -d data.tar.xz -c >> $@",
visibility = ["//visibility:public"],
)
43 changes: 17 additions & 26 deletions tools/image_deps.bzl
Original file line number Diff line number Diff line change
@@ -1,54 +1,45 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file")
load("@distroless//private/remote:debian_archive.bzl", "debian_archive")

def prysm_image_deps():
"""
These dependencies are pulled from https://debian.pkgs.org and support Debian 11.
"""
http_file(
name = "bash_amd64",
debian_archive(
name = "amd64_debian11_bash",
package_name = "bash",
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",
"https://snapshot.debian.org/archive/debian/20231214T085654Z/pool/main/b/bash/bash_5.1-2+deb11u1_amd64.deb",
"https://prysmaticlabs.com/uploads/bash_5.1-2+deb11u1_amd64.deb",
],
)

http_file(
name = "bash_arm64",
debian_archive(
name = "arm64_debian11_bash",
package_name = "bash",
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",
"https://snapshot.debian.org/archive/debian/20231214T085654Z/pool/main/b/bash/bash_5.1-2+deb11u1_arm64.deb",
"https://prysmaticlabs.com/uploads/bash_5.1-2+deb11u1_arm64.deb",
],
)

http_file(
name = "libtinfo6_amd64",
debian_archive(
name = "amd64_debian11_libtinfo6",
package_name = "libtinfo6",
sha256 = "96ed58b8fd656521e08549c763cd18da6cff1b7801a3a22f29678701a95d7e7b",
urls = [
"http://ftp.us.debian.org/debian/pool/main/n/ncurses/libtinfo6_6.2+20201114-2+deb11u2_amd64.deb",
"http://http.us.debian.org/debian/pool/main/n/ncurses/libtinfo6_6.2+20201114-2+deb11u2_amd64.deb",
"http://ftp.uk.debian.org/debian/pool/main/n/ncurses/libtinfo6_6.2+20201114-2+deb11u2_amd64.deb",
"http://ftp.au.debian.org/debian/pool/main/n/ncurses/libtinfo6_6.2+20201114-2+deb11u2_amd64.deb",
"https://snapshot.debian.org/archive/debian/20231214T085654Z/pool/main/n/ncurses/libtinfo6_6.2+20201114-2+deb11u2_amd64.deb",
"https://prysmaticlabs.com/uploads/libtinfo6_6.2+20201114-2+deb11u2_amd64.deb",
],
)

http_file(
name = "libtinfo6_arm64",
debian_archive(
name = "arm64_debian11_libtinfo6",
package_name = "libtinfo6",
sha256 = "58027c991756930a2abb2f87a829393d3fdbfb76f4eca9795ef38ea2b0510e27",
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",
"https://snapshot.debian.org/archive/debian/20231214T085654Z/pool/main/n/ncurses/libtinfo6_6.2+20201114-2+deb11u1_arm64.deb",
"https://prysmaticlabs.com/uploads/libtinfo6_6.2+20201114-2+deb11u2_arm64.deb",
],
)
Expand Down Expand Up @@ -151,4 +142,4 @@ def prysm_image_deps():
"https://snapshot.debian.org/archive/debian/20231214T085654Z/pool/main/a/acl/libacl1_2.2.53-10_arm64.deb",
"https://prysmaticlabs.com/uploads/libacl1_2.2.53-10_arm64.deb",
],
)
)
6 changes: 4 additions & 2 deletions tools/prysm_image.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,24 @@ def prysm_image_upload(
"//tools:passwd_tar",
] + select({
"@platforms//cpu:x86_64": [
"@amd64_debian11_bash",
"@amd64_debian11_libtinfo6",
"@amd64_debian11_coreutils",
"@amd64_debian11_libacl1",
"@amd64_debian11_libattr1",
"@amd64_debian11_libselinux",
"@amd64_debian11_libpcre2",
],
"@platforms//cpu:arm64": [
"@arm64_debian11_bash",
"@arm64_debian11_libtinfo6",
"@arm64_debian11_coreutils",
"@arm64_debian11_libacl1",
"@arm64_debian11_libattr1",
"@arm64_debian11_libselinux",
"@arm64_debian11_libpcre2",
],
}) + [
"//tools:libtinfo6_tar",
"//tools:bash_tar",
":binary_tar",
],
labels = {
Expand Down

0 comments on commit b63a6c7

Please sign in to comment.