Skip to content

Commit

Permalink
Create a oak_containers_nvidia_system_image rule in justfile
Browse files Browse the repository at this point in the history
...and some more infrastructure that should yield us a proper system
image.

Hopefully this is all that's needed to actually generate a system image
that we can start playing around with.

Bug: 289334314
Change-Id: I91012bc77b7cdfbabcda4733c75bce7695cb5929
  • Loading branch information
andrisaar committed Jun 5, 2024
1 parent 366b315 commit 8ea5abe
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
6 changes: 6 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,12 @@ oci_pull(
image = "europe-west2-docker.pkg.dev/oak-ci/oak-containers-sysimage-base/oak-containers-sysimage-base",
)

oci_pull(
name = "oak_containers_nvidia_sysimage_base",
digest = "sha256:9c5c0385c9c9902aa21ef4206729dfebb7b4d1b17ae1fc849de14d80d7c20482",
image = "europe-west2-docker.pkg.dev/oak-ci/oak-containers-sysimage-base/oak-containers-nvidia-sysimage-base",
)

load("@aspect_bazel_lib//lib:repositories.bzl", "register_expand_template_toolchains")

register_expand_template_toolchains()
Expand Down
7 changes: 7 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,13 @@ oak_containers_system_image: oak_containers_orchestrator oak_containers_syslogd
oak_containers_system_image/target/image.tar
xz --force oak_containers_system_image/target/image.tar

oak_containers_nvidia_system_image: oak_containers_system_image
bazel build $BAZEL_CONFIG_FLAG oak_containers_system_image:oak_containers_nvidia_system_image --build_tag_filters=+noci
cp --preserve=timestamps \
bazel-bin/oak_containers_system_image/oak_containers_nvidia_system_image.tar \
oak_containers_system_image/target/nvidia_image.tar
xz --force oak_containers_system_image/target/nvidia_image.tar

oak_containers_orchestrator:
env --chdir=oak_containers_orchestrator \
cargo build --profile=release-lto --target=x86_64-unknown-linux-musl \
Expand Down
6 changes: 4 additions & 2 deletions oak_containers_system_image/build-base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ rm -rf -- "$sandbox"

set +o xtrace
printf "\n\nIf you want to push this newly created base, run:\n"
printf "\nbazel run oak_containers_system_image:push_base\n\n"
printf "\nbazel run oak_containers_system_image:push_base\n"
printf "(and/or) bazel run oak_containers_system_image:push_nvidia_base\n\n"
printf "If you want to use the newly created base, update the hash for\n"
printf "the oak_containers_sysimage_base oci_pull target in WORKSPACE\n\n"
printf "the oak_containers_sysimage_base oci_pull target (or the nvidia flavour\n"
printf "if needed) in WORKSPACE\n\n"

0 comments on commit 8ea5abe

Please sign in to comment.