Skip to content

Commit

Permalink
testing CUDA packages
Browse files Browse the repository at this point in the history
  • Loading branch information
jjmaestro committed Oct 28, 2024
1 parent c578ca9 commit 1ca19a3
Show file tree
Hide file tree
Showing 6 changed files with 4,677 additions and 0 deletions.
11 changes: 11 additions & 0 deletions WORKSPACE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,17 @@ load("@nvidia_ubuntu2404_cuda//:packages.bzl", "nvidia_ubuntu2404_cuda_packages"

nvidia_ubuntu2404_cuda_packages()

# bazel run @cuda//:lock
deb_index(
name = "cuda",
lock = "//examples/cuda:cuda.lock.json",
manifest = "//examples/cuda:cuda.yaml",
)

load("@cuda//:packages.bzl", "cuda_packages")

cuda_packages()

deb_index(
name = "apt_security",
manifest = "//examples/debian_snapshot_security:security.yaml",
Expand Down
68 changes: 68 additions & 0 deletions examples/cuda/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
load("@container_structure_test//:defs.bzl", "container_structure_test")
load("@rules_distroless//apt:defs.bzl", "dpkg_status")
load("@rules_oci//oci:defs.bzl", "oci_image", "oci_load")

PACKAGES = [
"@cuda//dpkg",
"@cuda//apt",
"@cuda//cuda-11-8",
]

# Creates /var/lib/dpkg/status with installed package information.
dpkg_status(
name = "dpkg_status",
controls = select({
"@platforms//cpu:x86_64": [
"%s/amd64:control" % package
for package in PACKAGES
],
"@platforms//cpu:arm64": [
"%s/arm64:control" % package
for package in PACKAGES
],
}),
)

oci_image(
name = "apt",
architecture = select({
"@platforms//cpu:x86_64": "amd64",
"@platforms//cpu:arm64": "arm64",
}),
os = "linux",
tars = [
":dpkg_status",
] + select({
"@platforms//cpu:x86_64": [
"%s/amd64" % package
for package in PACKAGES
],
"@platforms//cpu:arm64": [
"%s/arm64" % package
for package in PACKAGES
],
}),
)

oci_load(
name = "tarball",
image = ":apt",
repo_tags = [
"distroless/test:latest",
],
)

container_structure_test(
name = "test",
configs = select({
"@platforms//cpu:x86_64": ["test_linux_amd64.yaml"],
"@platforms//cpu:arm64": ["test_linux_arm64.yaml"],
}),
image = ":apt",
target_compatible_with = select({
"@platforms//cpu:x86_64": ["@platforms//cpu:x86_64"],
"@platforms//cpu:arm64": ["@platforms//cpu:arm64"],
}) + [
"@platforms//os:linux",
],
)
Loading

0 comments on commit 1ca19a3

Please sign in to comment.