Skip to content

Commit

Permalink
Add extra secrets for intel-bootc build
Browse files Browse the repository at this point in the history
Adds mount secret for using as auth/token for builds

Signed-off-by: Enrique Belarte Luque <[email protected]>
  • Loading branch information
enriquebelarte committed Sep 24, 2024
1 parent 569c2db commit 3b6232f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
11 changes: 5 additions & 6 deletions training/intel-bootc/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,10 @@ FROM ${DRIVER_TOOLKIT_IMAGE} as libbuilder
ARG DRIVER_VERSION
ARG HABANA_REPO
ARG ARTIFACTORY_URL="vault.habana.ai"
ARG REPO_TOKEN

USER root
COPY --chmod=755 scripts/os_dependencies.sh /tmp/
RUN /tmp/os_dependencies.sh \
RUN --mount=type=secret,id=extra-secrets-intel-bootc/BUILDERS_TOKEN /tmp/os_dependencies.sh \
&& mv /etc/selinux /etc/selinux.tmp \
&& dnf install -y --nodocs --allowerasing --best \
git \
Expand Down Expand Up @@ -70,7 +69,6 @@ RUN curl -L -o /tmp/main.zip https://github.com/HabanaAI/hccl_ofi_wrapper/archiv
FROM ${BASEIMAGE}
ARG DRIVER_VERSION="1.17.1-40"
ARG ARTIFACTORY_URL="vault.habana.ai"
ARG REPO_TOKEN

USER root
COPY --from=builder /home/builder/usr/src/habanalabs-${DRIVER_VERSION}/drivers/accel/habanalabs/habanalabs.ko /tmp/extra/habanalabs.ko
Expand All @@ -85,7 +83,8 @@ COPY --from=libbuilder /opt/habanalabs/libfabric-1.20.0 /opt/habanalabs/libfabri
COPY --chmod=755 scripts/os_dependencies.sh /tmp/

#Install python3.11 and other build stuff
RUN mv /etc/selinux /etc/selinux.tmp \
RUN --mount=type=secret,id=extra-secrets-intel-bootc/BUILDERS_TOKEN \
mv /etc/selinux /etc/selinux.tmp \
&& dnf install -y \
python3.11 \
python3.11-pip \
Expand Down Expand Up @@ -161,8 +160,8 @@ RUN grep -q /usr/lib/containers/storage /etc/containers/storage.conf || \
/etc/containers/storage.conf
COPY duplicated/ilab-wrapper/ilab /usr/bin/ilab
RUN chmod +x /usr/bin/ilab
ARG INSTRUCTLAB_IMAGE="quay.io/ai-lab/intel-instructlab"
ARG INSTRUCTLAB_IMAGE_PULL_SECRET="instructlab-intel-pull"
ARG INSTRUCTLAB_IMAGE="quay.io/ai-lab/intel-instructlab:latest"
ARG INSTRUCTLAB_IMAGE_PULL_SECRET="extra-secrets-intel-bootc"
RUN for i in /usr/bin/ilab*; do \
sed -i 's/__REPLACE_TRAIN_DEVICE__/hpu/' $i; \
sed -i "s%__REPLACE_IMAGE_NAME__%${INSTRUCTLAB_IMAGE}%" $i; \
Expand Down
2 changes: 1 addition & 1 deletion training/intel-bootc/scripts/os_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ OS=$(grep -w ID /etc/os-release)
echo "OS line is $OS"
if [[ "$OS" == *"rhel"* ]]; then \
mkdir -p /tmp/git && cd /tmp/git && \
git clone https://dummy_user:${REPO_TOKEN}@gitlab.com/${REPOS_REPO} && \
git clone https://dummy_user:${BUILDERS_TOKEN}@gitlab.com/${REPOS_REPO} && \
cd builder/repos && \
cp redhat.repo rhelai.repo habanalabs.repo /etc/yum.repos.d/ && \
cp RPM-GPG-KEY-HABANALABS /etc/pki/rpm-gpg/ && \
Expand Down

0 comments on commit 3b6232f

Please sign in to comment.