Skip to content

Commit

Permalink
Merge pull request #433 from javipolo/rpm_extra_packages
Browse files Browse the repository at this point in the history
Add EXTRA_RPM_PACKAGES to image Containerfile
  • Loading branch information
rhatdan authored May 2, 2024
2 parents 0150674 + b73c3fa commit c05ecc3
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 2 deletions.
1 change: 1 addition & 0 deletions training/Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ IMAGE_TAG ?= latest

CONTAINER_TOOL ?= podman
CONTAINER_TOOL_EXTRA_ARGS ?=
EXTRA_RPM_PACKAGES ?=

ARCH ?=

Expand Down
6 changes: 5 additions & 1 deletion training/amd-bootc/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ FROM quay.io/centos-bootc/centos-bootc:stream9

ADD rocm.repo /etc/yum.repos.d/rocm.repo

RUN dnf install -y rocm-smi && dnf clean all
ARG EXTRA_RPM_PACKAGES=''
RUN dnf install -y \
rocm-smi \
${EXTRA_RPM_PACKAGES} \
&& dnf clean all

ARG INSTRUCTLAB_IMAGE="quay.io/ai-lab/instructlab-amd:latest"

Expand Down
1 change: 1 addition & 0 deletions training/amd-bootc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ bootc: prepare-files
--tag "${REGISTRY}/${REGISTRY_ORG}/${IMAGE_NAME}:${IMAGE_TAG}" \
--build-arg "INSTRUCTLAB_IMAGE=$(INSTRUCTLAB_IMAGE)" \
--build-arg "INSTRUCTLAB_IMAGE_ID=$(INSTRUCTLAB_IMAGE_ID)" \
$(EXTRA_RPM_PACKAGES:%=--build-arg EXTRA_RPM_PACKAGES=%) \
$(FROM:%=--from=%) \
${CONTAINER_TOOL_EXTRA_ARGS} .
5 changes: 4 additions & 1 deletion training/intel-bootc/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ RUN if [ "${OS_VERSION_MAJOR}" == "" ]; then \
FROM ${BASEIMAGE}

ARG KERNEL_VERSION=''
ARG EXTRA_RPM_PACKAGES=''

COPY --from=builder --chown=0:0 /tmp/habanalabs/lib/firmware/habanalabs/gaudi /lib/firmware/habanalabs/gaudi
COPY --from=builder --chown=0:0 /tmp/habanalabs/lib/firmware/habanalabs/gaudi2 /lib/firmware/habanalabs/gaudi2
Expand All @@ -65,4 +66,6 @@ RUN if [ "${KERNEL_VERSION}" == "" ]; then \
&& mkdir -p /lib/modules/${KERNEL_VERSION}.${TARGET_ARCH}/extra/ \
&& mv /tmp/*.xz /lib/modules/${KERNEL_VERSION}.${TARGET_ARCH}/extra/ \
&& chown root:root /lib/modules/${KERNEL_VERSION}.${TARGET_ARCH}/extra/habanalabs*.xz \
&& depmod -a ${KERNEL_VERSION}.${TARGET_ARCH}
&& depmod -a ${KERNEL_VERSION}.${TARGET_ARCH} \
&& xargs --no-run-if-empty dnf install -y <<< "${EXTRA_RPM_PACKAGES}" \
&& dnf clean all
1 change: 1 addition & 0 deletions training/intel-bootc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ bootc:
--file Containerfile \
--tag "${REGISTRY}/${REGISTRY_ORG}/${IMAGE_NAME}:${IMAGE_TAG}" \
-v ${OUTDIR}:/run/.input:ro \
$(EXTRA_RPM_PACKAGES:%=--build-arg EXTRA_RPM_PACKAGES=%) \
$(FROM:%=--build-arg BASEIMAGE=%) \
$(DRIVER_VERSION:%=--build-arg DRIVER_VERSION=%) \
$(KERNEL_VERSION:%=--build-arg KERNEL_VERSION=%) \
Expand Down
3 changes: 3 additions & 0 deletions training/nvidia-bootc/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ ARG CUDA_VERSION='12.3.2'
ARG TARGET_ARCH=''
ENV TARGETARCH=${TARGET_ARCH}

ARG EXTRA_RPM_PACKAGES=''

# Disable vGPU version compability check by default
ARG DISABLE_VGPU_VERSION_CHECK=true
ENV DISABLE_VGPU_VERSION_CHECK=$DISABLE_VGPU_VERSION_CHECK
Expand Down Expand Up @@ -118,6 +120,7 @@ RUN if [ "${TARGET_ARCH}" == "" ]; then \
cuda-cudart-${CUDA_DASHED_VERSION} \
nvidia-persistenced-${DRIVER_VERSION} \
nvidia-container-toolkit \
${EXTRA_RPM_PACKAGES} \
&& if [ "$DRIVER_TYPE" != "vgpu" ] && [ "$TARGET_ARCH" != "arm64" ]; then \
versionArray=(${DRIVER_VERSION//./ }); \
DRIVER_BRANCH=${versionArray[0]}; \
Expand Down
1 change: 1 addition & 0 deletions training/nvidia-bootc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ bootc: dtk check-sshkey prepare-files
$(KERNEL_VERSION:%=--build-arg KERNEL_VERSION=%) \
$(OS_VERSION_MAJOR:%=--build-arg OS_VERSION_MAJOR=%) \
$(FROM:%=--build-arg BASEIMAGE=%) \
$(EXTRA_RPM_PACKAGES:%=--build-arg EXTRA_RPM_PACKAGES=%) \
--build-arg DRIVER_TOOLKIT_IMAGE=${DRIVER_TOOLKIT_IMAGE} \
$(DRIVER_VERSION:%=--label driver-version=%) \
$(DRIVER_VERSION:%=--build-arg DRIVER_VERSION=%) \
Expand Down

0 comments on commit c05ecc3

Please sign in to comment.