Skip to content

Commit

Permalink
Merge pull request #7 from rh-ecosystem-edge/add-rpm-gen
Browse files Browse the repository at this point in the history
Add rpmtools and container label
  • Loading branch information
enriquebelarte authored Jan 21, 2025
2 parents db8fd6d + 1999d81 commit c3ac3dc
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
20 changes: 15 additions & 5 deletions Containerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
ARG DTK_IMAGE
ARG SIGNER_SDK_IMAGE
ARG DRIVER_IMAGE
ARG DRIVER_VERSION
ARG AWS_AUTH_SECRET

FROM ${DTK_IMAGE} as dtk
USER root
ARG DRIVER_REPO
ARG DRIVER_VERSION
ARG ADDITIONAL_BUILD_DEPS

WORKDIR /home/builder
COPY --chmod=0755 scripts/build-commands.sh /home/builder/build-commands.sh
RUN if [ -n "$ADDITIONAL_BUILD_DEPS" ]; then \
dnf -y install -- $ADDITIONAL_BUILD_DEPS && \
dnf clean all && \
rm -rf /var/cache/yum; \
fi
COPY --chmod=0755 build/build-commands.sh /home/builder/build-commands.sh
RUN source /etc/driver-toolkit-release.sh && \
echo $KERNEL_VERSION > /tmp/BUILD_KERNEL_VER && \
git clone --depth 1 --branch $DRIVER_VERSION $DRIVER_REPO && \
Expand Down Expand Up @@ -66,8 +68,16 @@ RUN source /tmp/envfile && \
"$file" \
"$signedfile"; \
done
FROM ${DRIVER_IMAGE}
# Install kmod just for testing purposes
RUN dnf -y install kmod && dnf clean all && rm -rf /var/cache/yum
COPY --from=signer /opt/drivers /opt/drivers
FROM ${DRIVER_IMAGE} as rpmbuilder
ARG DRIVER_VERSION
ARG KERNEL_VERSION

COPY --from=signer /opt/drivers /opt/drivers
COPY --from=signer /tmp/BUILD_KERNEL_VER /tmp/BUILD_KERNEL_VER
RUN dnf -y install rpmdevtools rpmlint kmod && \
dnf clean all && \
rm -rf /var/cache/yum
WORKDIR /home/rpmbuilder
RUN KERNEL_VERSION=$(cat /tmp/BUILD_KERNEL_VER)
LABEL DRIVER_VERSION=$DRIVER_VERSION
LABEL KERNEL_VERSION=$KERNEL_VERSION
2 changes: 1 addition & 1 deletion argfile.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
DRIVER_REPO=https://github.com/NVIDIA/open-gpu-kernel-modules.git
DRIVER_VERSION=565.77
ADDITIONAL_BUILD_DEPS=gcc-c++
DTK_IMAGE=quay.io/redhat-user-workloads/partners-kmod-accel-tenant/pa-driver-toolkit:426b6f6d9e9347cbb3e1223b3b64f92447f50777
DTK_IMAGE=quay.io/redhat-user-workloads/partners-kmod-accel-tenant/pa-driver-toolkit:ee183d162f9f41f83be39c4b362165e0eec8051f
DRIVER_IMAGE=registry.redhat.io/ubi9/ubi@sha256:b632d0cc6263372a90e9097dcac0a369e456b144a66026b9eac029a22f0f6e07
SIGNER_SDK_IMAGE=quay.io/redhat-user-workloads/partners-kmod-accel-tenant/klerk:75ad7b90c81b5056b69ff5407a3a2e218d4bbdbc
AWS_DEFAULT_REGION=us-east-1
Expand Down
File renamed without changes.

0 comments on commit c3ac3dc

Please sign in to comment.