Skip to content

Commit

Permalink
feat(nvidia-bootc): Introduce INSTRUCTLAB_IMAGE_PULL_SECRET as build-…
Browse files Browse the repository at this point in the history
…arg for Konflux build

Signed-off-by: Matthieu Bernardin <mbernard@redhat.com>
  • Loading branch information
pastequo committed Jul 25, 2024
1 parent f6ed0b3 commit bc2b1c0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion training/nvidia-bootc/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ RUN grep -q /usr/lib/containers/storage /etc/containers/storage.conf || \
&& chmod +x /usr/bin/ilab

ARG INSTRUCTLAB_IMAGE="quay.io/ai-lab/instructlab-nvidia:latest"
ARG INSTRUCTLAB_IMAGE_PULL_SECRET="instructlab-nvidia-pull"

RUN for i in /usr/bin/ilab*; do \
sed -i 's/__REPLACE_TRAIN_DEVICE__/cuda/' $i; \
Expand All @@ -206,11 +207,12 @@ RUN for i in /usr/bin/ilab*; do \
# Added for running as an OCI Container to prevent Overlay on Overlay issues.
VOLUME /var/lib/containers


RUN --mount=type=secret,id=instructlab-nvidia-pull/.dockerconfigjson \
if [ -f "/run/.input/instructlab-nvidia/oci-layout" ]; then \
IID=$(podman --root /usr/lib/containers/storage pull oci:/run/.input/instructlab-nvidia) && \
podman --root /usr/lib/containers/storage image tag ${IID} ${INSTRUCTLAB_IMAGE}; \
elif [ -f "/run/secrets/instructlab-nvidia-pull/.dockerconfigjson" ]; then \
elif [ -f "/run/secrets/${INSTRUCTLAB_IMAGE_PULL_SECRET}/.dockerconfigjson" ]; then \
IID=$(sudo podman --root /usr/lib/containers/storage pull --authfile /run/secrets/instructlab-nvidia-pull/.dockerconfigjson ${INSTRUCTLAB_IMAGE}); \
else \
IID=$(sudo podman --root /usr/lib/containers/storage pull ${INSTRUCTLAB_IMAGE}); \
Expand Down

0 comments on commit bc2b1c0

Please sign in to comment.