From d89ad9dede99d701cf125eb501c8f4af6ed96e0d Mon Sep 17 00:00:00 2001 From: Javi Polo Date: Tue, 20 Aug 2024 11:34:55 +0200 Subject: [PATCH] RHELAI-969: Revert "Fix long container startup times" Signed-off-by: Javi Polo --- training/ilab-wrapper/ilab | 11 +---------- training/nvidia-bootc/Containerfile | 4 +--- training/nvidia-bootc/duplicated/ilab-wrapper/ilab | 11 +---------- 3 files changed, 3 insertions(+), 23 deletions(-) diff --git a/training/ilab-wrapper/ilab b/training/ilab-wrapper/ilab index 6cd232dd..afed6432 100755 --- a/training/ilab-wrapper/ilab +++ b/training/ilab-wrapper/ilab @@ -49,8 +49,7 @@ check_insights # Template values replaced by container build CONTAINER_DEVICE="__REPLACE_CONTAINER_DEVICE__" -SOURCE_IMAGE="__REPLACE_IMAGE_NAME__" -IMAGE_NAME="localhost/instructlab:__REPLACE_IMAGE_TAG__" +IMAGE_NAME="__REPLACE_IMAGE_NAME__" ENTRYPOINT="ilab" PARAMS=("$@") @@ -145,12 +144,4 @@ PODMAN_COMMAND=("sudo" "--preserve-env=$PRESERVE_ENV" "podman" "run" "--rm" "-it "--env" "HF_TOKEN" "${IMAGE_NAME}") -sudo podman image exists "$IMAGE_NAME" -if [ "$?" != "0" ]; then - echo "Initializing ilab container..." - id=$(sudo podman create "$SOURCE_IMAGE") - sudo podman commit "$id" "$IMAGE_NAME" - sudo podman rm "$id" -fi - exec "${PODMAN_COMMAND[@]}" "${PARAMS[@]}" diff --git a/training/nvidia-bootc/Containerfile b/training/nvidia-bootc/Containerfile index 95174a45..64a18716 100644 --- a/training/nvidia-bootc/Containerfile +++ b/training/nvidia-bootc/Containerfile @@ -173,12 +173,10 @@ RUN chmod +x /usr/bin/ilab ARG INSTRUCTLAB_IMAGE="quay.io/ai-lab/instructlab-nvidia:latest" ARG INSTRUCTLAB_IMAGE_PULL_SECRET="instructlab-nvidia-pull" -RUN export INSTRUCTLAB_TAG=$(echo ${INSTRUCTLAB_IMAGE} | cut -f 2 -d ':') && \ - for i in /usr/bin/ilab*; do \ +RUN for i in /usr/bin/ilab*; do \ sed -i 's/__REPLACE_TRAIN_DEVICE__/cuda/' $i; \ sed -i 's/__REPLACE_CONTAINER_DEVICE__/nvidia.com\/gpu=all/' $i; \ sed -i "s%__REPLACE_IMAGE_NAME__%${INSTRUCTLAB_IMAGE}%" $i; \ - sed -i "s%__REPLACE_IMAGE_TAG__%${INSTRUCTLAB_TAG}%" $i; \ done # Added for running as an OCI Container to prevent Overlay on Overlay issues. diff --git a/training/nvidia-bootc/duplicated/ilab-wrapper/ilab b/training/nvidia-bootc/duplicated/ilab-wrapper/ilab index 6cd232dd..afed6432 100755 --- a/training/nvidia-bootc/duplicated/ilab-wrapper/ilab +++ b/training/nvidia-bootc/duplicated/ilab-wrapper/ilab @@ -49,8 +49,7 @@ check_insights # Template values replaced by container build CONTAINER_DEVICE="__REPLACE_CONTAINER_DEVICE__" -SOURCE_IMAGE="__REPLACE_IMAGE_NAME__" -IMAGE_NAME="localhost/instructlab:__REPLACE_IMAGE_TAG__" +IMAGE_NAME="__REPLACE_IMAGE_NAME__" ENTRYPOINT="ilab" PARAMS=("$@") @@ -145,12 +144,4 @@ PODMAN_COMMAND=("sudo" "--preserve-env=$PRESERVE_ENV" "podman" "run" "--rm" "-it "--env" "HF_TOKEN" "${IMAGE_NAME}") -sudo podman image exists "$IMAGE_NAME" -if [ "$?" != "0" ]; then - echo "Initializing ilab container..." - id=$(sudo podman create "$SOURCE_IMAGE") - sudo podman commit "$id" "$IMAGE_NAME" - sudo podman rm "$id" -fi - exec "${PODMAN_COMMAND[@]}" "${PARAMS[@]}"