Skip to content

Commit

Permalink
build/cpu: switch to Jammy
Browse files Browse the repository at this point in the history
  • Loading branch information
jbdalido committed Sep 12, 2024
1 parent 4f17608 commit 41b1c82
Show file tree
Hide file tree
Showing 7 changed files with 6,195 additions and 795 deletions.
6 changes: 5 additions & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ apt.install(
name = "focal_ubuntu",
manifest = "//base/focal:packages.yaml",
)
apt.install(
name = "jammy_ubuntu",
manifest = "//base/jammy:packages.yaml",
)
apt.install(
name = "rocm_ubuntu",
manifest = "//rocm:rocm_ubuntu.yaml",
Expand All @@ -62,7 +66,7 @@ apt.install(
manifest = "//cpu:cpu_ubuntu.yaml",
)

use_repo(apt, "rocm_ubuntu", "noble_ubuntu", "focal_ubuntu", "cuda_ubuntu", "cpu_ubuntu")
use_repo(apt, "rocm_ubuntu", "noble_ubuntu", "focal_ubuntu", "jammy_ubuntu", "cuda_ubuntu", "cpu_ubuntu")

bazelisk = use_extension("//utils/bazel/bazelisk:bazelisk.bzl", "bazelisk")
use_repo(
Expand Down
3,311 changes: 2,530 additions & 781 deletions MODULE.bazel.lock

Large diffs are not rendered by default.

104 changes: 104 additions & 0 deletions base/jammy/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
load("@aspect_bazel_lib//lib:tar.bzl", "tar")
load("@rules_pkg//pkg:tar.bzl", "pkg_tar")
load("@container_structure_test//:defs.bzl", "container_structure_test")
load("@rules_distroless//apt:defs.bzl", "dpkg_status")
load("@rules_distroless//distroless:defs.bzl", "group", "passwd", "flatten", "cacerts")
load("@rules_oci//oci:defs.bzl", "oci_image", "oci_load")
load("//utils/bazel/dedup_tar:defs.bzl", "dedupe_tar")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file")

passwd(
name = "passwd",
entries = [
{
"uid": 0,
"gid": 0,
"home": "/root",
"shell": "/bin/bash",
"username": "r00t",
},
{
"uid": 100,
"gid": 65534,
"home": "/home/_apt",
"shell": "/usr/sbin/nologin",
"username": "_apt",
},
],
visibility = ["//visibility:public"],
)

cacerts(
name = "cacerts",
package = "@jammy_ubuntu//ca-certificates/amd64:data",
visibility = ["//visibility:public"],
)

group(
name = "group",
entries = [
{
"name": "root",
"gid": 0,
},
{
"name": "_apt",
"gid": 65534,
},
],
visibility = ["//visibility:public"],
)


pkg_tar(
name = "bazelisk",
package_dir = "/usr/bin",
srcs = [
"@bazelisk//file",
],
visibility = ["//visibility:public"],
)

PACKAGES = [
"@jammy_ubuntu//wget",
"@jammy_ubuntu//apt",
"@jammy_ubuntu//bash",
"@jammy_ubuntu//ca-certificates",
"@jammy_ubuntu//coreutils" ,
"@jammy_ubuntu//dpkg",
"@jammy_ubuntu//gawk",
"@jammy_ubuntu//libncurses6",
"@jammy_ubuntu//perl",
"@jammy_ubuntu//python3",
"@jammy_ubuntu//tzdata",
"@jammy_ubuntu//strace",
"@jammy_ubuntu//grep",
"@jammy_ubuntu//openssl",
"@jammy_ubuntu//build-essential",
"@jammy_ubuntu//gcc",
"@jammy_ubuntu//g++",
"@jammy_ubuntu//gzip",
"@jammy_ubuntu//findutils",
"@jammy_ubuntu//sed",
"@jammy_ubuntu//libelf1",
"@jammy_ubuntu//libdrm2",
"@jammy_ubuntu//libdrm-amdgpu1",
"@jammy_ubuntu//libnuma1",
"@jammy_ubuntu//libxml2",
"@jammy_ubuntu//libexpat1",
"@jammy_ubuntu//libexpat1-dev",
]

flatten(
name = "flatten_packages",
tars = [
"%s/amd64" % package
for package in PACKAGES
],
)

dedupe_tar(
name = "packages",
src = ":flatten_packages",
visibility = ["//visibility:public"],
)
Loading

0 comments on commit 41b1c82

Please sign in to comment.