Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: download RPM metadata in build stage to lower bandwidth usage in final stage #65

Merged
merged 1 commit into from
Mar 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,19 +131,30 @@ A container build can be invoked by simply running:

```
$ podman build \
--file Containerfile \
--file build.Containerfile \
--tag build-test:latest
$ podman build \
--file install.Containerfile \
--tag install-test:latest
```

Or to specify the version of Fedora and/or Nvidia driver:

```
$ podman build \
--build-arg IMAGE_NAME=silverblue \
--build-arg SOURCE_IMAGE=silverblue \
--build-arg FEDORA_MAJOR_VERSION=37 \
--build-arg NVIDIA_MAJOR_VERSION=525 \
--file Containerfile \
--file build.Containerfile \
--tag build-test:37-525

$ podman build \
--build-arg IMAGE_NAME=silverblue \
--build-arg FEDORA_MAJOR_VERSION=37 \
--build-arg NVIDIA_MAJOR_VERSION=525 \
--build-arg AKMODS_CACHE=build-test \
--build-arg AKMODS_VERSION=37 \
--file install.Containerfile \
--tag build-test:latest
```

Expand Down
3 changes: 3 additions & 0 deletions build.Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ ADD ublue-os-nvidia-addons.spec /tmp/ublue-os-nvidia-addons/ublue-os-nvidia-addo
ADD https://nvidia.github.io/nvidia-docker/rhel9.0/nvidia-docker.repo \
/tmp/ublue-os-nvidia-addons/rpmbuild/SOURCES/nvidia-container-runtime.repo

ADD https://nvidia.github.io/nvidia-docker/rhel9.0/nvidia-docker.repo \
/etc/yum.repos.d/nvidia-container-runtime.repo

ADD files/etc/nvidia-container-runtime/config-rootless.toml \
/tmp/ublue-os-nvidia-addons/rpmbuild/SOURCES/config-rootless.toml
ADD https://raw.githubusercontent.com/NVIDIA/dgx-selinux/master/bin/RHEL9/nvidia-container.pp \
Expand Down
18 changes: 7 additions & 11 deletions install.Containerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
ARG IMAGE_NAME="${IMAGE_NAME:-silverblue}"
ARG BASE_IMAGE="ghcr.io/ublue-os/${IMAGE_NAME}-main"
ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION:-37}"
ARG NVIDIA_MAJOR_VERSION="${NVIDIA_MAJOR_VERSION:-525}"
ARG AKMODS_VERSION="${AKMODS_VERSION:-37}"
ARG IMAGE_NAME=silverblue
ARG BASE_IMAGE=ghcr.io/ublue-os/${IMAGE_NAME}-main
ARG FEDORA_MAJOR_VERSION=37

FROM ${BASE_IMAGE}:${FEDORA_MAJOR_VERSION}

ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION}"
ARG NVIDIA_MAJOR_VERSION="${NVIDIA_MAJOR_VERSION}"
ARG AKMODS_VERSION="${AKMODS_VERSION}"

ARG BUILDER_IMAGE="ghcr.io/ublue-os/akmods-nvidia:${AKMODS_VERSION}-${NVIDIA_MAJOR_VERSION}"
ARG IMAGE_NAME="${IMAGE_NAME}"
ARG AKMODS_CACHE="ghcr.io/ublue-os/akmods-nvidia"
ARG AKMODS_VERSION="37"
ARG NVIDIA_MAJOR_VERSION="525"

COPY --from=${BUILDER_IMAGE} / .
COPY --from=${AKMODS_CACHE}:${AKMODS_VERSION}-${NVIDIA_MAJOR_VERSION} / .

COPY install.sh /tmp/install.sh
COPY post-install.sh /tmp/post-install.sh
Expand Down