From 20d00fcaae7fa2653c550e8f4ab13d371571a938 Mon Sep 17 00:00:00 2001 From: Christian Kadner Date: Tue, 9 Jan 2024 15:14:14 -0800 Subject: [PATCH 1/3] fix: Install fails with int commit hash Resolves #472 Signed-off-by: Christian Kadner --- .github/workflows/fvt-base.yml | 5 ++++- scripts/install.sh | 23 +++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/.github/workflows/fvt-base.yml b/.github/workflows/fvt-base.yml index 2707fcb8..154c6ff1 100644 --- a/.github/workflows/fvt-base.yml +++ b/.github/workflows/fvt-base.yml @@ -56,7 +56,10 @@ jobs: kubectl get pods -n kube-system - name: Set controller image tag - run: echo "IMAGE_TAG=$(date +'%Y%m%dT%H%M%S%Z')" >> $GITHUB_ENV + run: | + # TODO: remove this next line and reinstate the original line after that + echo "IMAGE_TAG=7284872" >> $GITHUB_ENV + # echo "IMAGE_TAG=$(date +'%Y%m%dT%H%M%S%Z')" >> $GITHUB_ENV - name: Update configs # Update the image tag and reduce some resource request amounts to allow FVTs to run diff --git a/scripts/install.sh b/scripts/install.sh index aa09f9ba..b285e045 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -338,6 +338,29 @@ if [[ $enable_self_signed_ca == "true" ]]; then rm default/kustomization.yaml.bak fi +# watch out when newTag has no non-numeric characters, and gets interpreted as an int, rather than srting +# sed -i.bak 's/newTag:.*$/newTag: '"$GIT_COMMIT_SHORT"'/' config/manager/kustomization.yaml +# ++ sed -i.bak 's/newTag:.*$/newTag: 7284872/' config/manager/kustomization.yaml +# Error: accumulating resources from '../manager': +# '/config/manager' must resolve to a file': +# couldn't make target for path '/config/manager': +# invalid Kustomization: +# json: cannot unmarshal number into Go struct field +# Image.images.newTag of type string +# error: no objects passed to apply +# CLI check: +# git log -1 --format=%h --abbrev=7 +# 7284872 +# This happened 7 times as of 2023/12/02: +# git log --format=%h --abbrev=7 | grep -E "^[0-9]+$" +# 7284872 +# 4808804 +# 4746079 +# 0281170 +# 1631706 +# 5293579 +# 4207065 +info "kustomize build default" kustomize build default | kubectl apply -f - if [[ $dev_mode_logging == "true" ]]; then From 349274eae0e1c948e6018caaa941a062e7168564 Mon Sep 17 00:00:00 2001 From: Christian Kadner Date: Tue, 9 Jan 2024 15:40:17 -0800 Subject: [PATCH 2/3] enclose commit short hash in quotes Signed-off-by: Christian Kadner --- .github/workflows/fvt-base.yml | 6 ++---- scripts/deploy/iks/deploy-mm-serving.sh | 3 ++- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/fvt-base.yml b/.github/workflows/fvt-base.yml index 154c6ff1..8c20711a 100644 --- a/.github/workflows/fvt-base.yml +++ b/.github/workflows/fvt-base.yml @@ -57,9 +57,7 @@ jobs: - name: Set controller image tag run: | - # TODO: remove this next line and reinstate the original line after that - echo "IMAGE_TAG=7284872" >> $GITHUB_ENV - # echo "IMAGE_TAG=$(date +'%Y%m%dT%H%M%S%Z')" >> $GITHUB_ENV + echo "IMAGE_TAG=$(date +'%Y%m%dT%H%M%S%Z')" >> $GITHUB_ENV - name: Update configs # Update the image tag and reduce some resource request amounts to allow FVTs to run @@ -67,7 +65,7 @@ jobs: # is also adjusted for these environments. # Disable the torchserve ServingRuntime for now (insufficient resources to run them all). run: | - sed -i 's/newTag:.*$/newTag: '"${{ env.IMAGE_TAG }}"'/' config/manager/kustomization.yaml + sed -i 's/newTag:.*$/newTag: "'${{ env.IMAGE_TAG }}'"/' config/manager/kustomization.yaml sed -i '0,/cpu:.*$/s/cpu:.*$/cpu: 100m/' \ config/default/config-defaults.yaml \ config/runtimes/mlserver-1.x.yaml \ diff --git a/scripts/deploy/iks/deploy-mm-serving.sh b/scripts/deploy/iks/deploy-mm-serving.sh index 7f7627b9..da46dc8f 100644 --- a/scripts/deploy/iks/deploy-mm-serving.sh +++ b/scripts/deploy/iks/deploy-mm-serving.sh @@ -76,7 +76,8 @@ curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack mv kustomize /usr/local/bin/kustomize # Update target tag and namespace/organization -sed -i.bak 's/newTag:.*$/newTag: '"$GIT_COMMIT_SHORT"'/' config/manager/kustomization.yaml +# enclose commit short hash in quotes to avoid it being interpreted as an int +sed -i.bak 's/newTag:.*$/newTag: "'${GIT_COMMIT_SHORT}'"/' config/manager/kustomization.yaml sed -i.bak 's/newName:.*$/newName: '"$DOCKERSANDBOX_NAMESPACE\/modelmesh-controller"'/' config/manager/kustomization.yaml rm config/manager/kustomization.yaml.bak From 947e0e660bb94a670cd7a0e690f9abf8536b7097 Mon Sep 17 00:00:00 2001 From: Christian Kadner Date: Tue, 9 Jan 2024 15:42:01 -0800 Subject: [PATCH 3/3] remove verbose error comment Signed-off-by: Christian Kadner --- scripts/install.sh | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/scripts/install.sh b/scripts/install.sh index b285e045..b66facb0 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -338,28 +338,6 @@ if [[ $enable_self_signed_ca == "true" ]]; then rm default/kustomization.yaml.bak fi -# watch out when newTag has no non-numeric characters, and gets interpreted as an int, rather than srting -# sed -i.bak 's/newTag:.*$/newTag: '"$GIT_COMMIT_SHORT"'/' config/manager/kustomization.yaml -# ++ sed -i.bak 's/newTag:.*$/newTag: 7284872/' config/manager/kustomization.yaml -# Error: accumulating resources from '../manager': -# '/config/manager' must resolve to a file': -# couldn't make target for path '/config/manager': -# invalid Kustomization: -# json: cannot unmarshal number into Go struct field -# Image.images.newTag of type string -# error: no objects passed to apply -# CLI check: -# git log -1 --format=%h --abbrev=7 -# 7284872 -# This happened 7 times as of 2023/12/02: -# git log --format=%h --abbrev=7 | grep -E "^[0-9]+$" -# 7284872 -# 4808804 -# 4746079 -# 0281170 -# 1631706 -# 5293579 -# 4207065 info "kustomize build default" kustomize build default | kubectl apply -f -