Skip to content

Commit

Permalink
change microservice tags in CD workflow (opea-project#612)
Browse files Browse the repository at this point in the history
Signed-off-by: Yingchun Guo <yingchun.guo@intel.com>
  • Loading branch information
daisy-ycguo authored Aug 16, 2024
1 parent a39f23a commit 71363a6
Show file tree
Hide file tree
Showing 10 changed files with 63 additions and 16 deletions.
1 change: 1 addition & 0 deletions .github/workflows/_example-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,4 +146,5 @@ jobs:
example: ${{ inputs.example }}
hardware: ${{ inputs.node }}
tag: ${{ inputs.tag }}
context: "CD"
secrets: inherit
6 changes: 6 additions & 0 deletions .github/workflows/_manifest-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ on:
description: "Tag to apply to images, default is latest"
required: false
type: string
context:
default: "CI"
description: "CI or CD"
required: false
type: string

jobs:
manifest-test:
Expand Down Expand Up @@ -55,6 +60,7 @@ jobs:
echo "continue_test=true" >> $GITHUB_ENV
echo "should_cleanup=false" >> $GITHUB_ENV
echo "skip_validate=true" >> $GITHUB_ENV
echo "CONTEXT=${{ inputs.context }}" >> $GITHUB_ENV
echo "NAMESPACE=$NAMESPACE"
- name: Kubectl install
Expand Down
9 changes: 7 additions & 2 deletions ChatQnA/tests/test_manifest_on_gaudi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,13 @@ IMAGE_TAG=${IMAGE_TAG:-latest}
function init_chatqna() {
# replace the mount dir "path: /mnt/opea-models" with "path: $CHART_MOUNT"
find . -name '*.yaml' -type f -exec sed -i "s#path: /mnt/opea-models#path: $MOUNT_DIR#g" {} \;
# replace megaservice image tag
find . -name '*.yaml' -type f -exec sed -i "s#image: opea/chatqna:latest#image: opea/chatqna:${IMAGE_TAG}#g" {} \;
if [ $CONTEXT == "CI" ]; then
# replace megaservice image tag
find . -name '*.yaml' -type f -exec sed -i "s#image: \"opea/chatqna:latest#image: \"opea/chatqna:${IMAGE_TAG}#g" {} \;
else
# replace microservice image tag
find . -name '*.yaml' -type f -exec sed -i "s#image: \"opea/\(.*\):latest#image: \"opea/\1:${IMAGE_TAG}#g" {} \;
fi
# replace the repository "image: opea/*" with "image: $IMAGE_REPO/opea/"
find . -name '*.yaml' -type f -exec sed -i "s#image: \"opea/*#image: \"${IMAGE_REPO}opea/#g" {} \;
# set huggingface token
Expand Down
9 changes: 7 additions & 2 deletions ChatQnA/tests/test_manifest_on_xeon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,13 @@ IMAGE_TAG=${IMAGE_TAG:-latest}
function init_chatqna() {
# replace the mount dir "path: /mnt/opea-models" with "path: $CHART_MOUNT"
find . -name '*.yaml' -type f -exec sed -i "s#path: /mnt/opea-models#path: $MOUNT_DIR#g" {} \;
# replace megaservice image tag
find . -name '*.yaml' -type f -exec sed -i "s#image: opea/chatqna:latest#image: opea/chatqna:${IMAGE_TAG}#g" {} \;
if [ $CONTEXT == "CI" ]; then
# replace megaservice image tag
find . -name '*.yaml' -type f -exec sed -i "s#image: \"opea/chatqna:latest#image: \"opea/chatqna:${IMAGE_TAG}#g" {} \;
else
# replace microservice image tag
find . -name '*.yaml' -type f -exec sed -i "s#image: \"opea/\(.*\):latest#image: \"opea/\1:${IMAGE_TAG}#g" {} \;
fi
# replace the repository "image: opea/*" with "image: $IMAGE_REPO/opea/"
find . -name '*.yaml' -type f -exec sed -i "s#image: \"opea/*#image: \"${IMAGE_REPO}opea/#g" {} \;
# set huggingface token
Expand Down
9 changes: 7 additions & 2 deletions CodeGen/tests/test_manifest_on_gaudi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,13 @@ function init_codegen() {
# executed under path manifest/codegen/xeon
# replace the mount dir "path: /mnt/model" with "path: $CHART_MOUNT"
find . -name '*.yaml' -type f -exec sed -i "s#path: /mnt/opea-models#path: $MOUNT_DIR#g" {} \;
# replace megaservice image tag
find . -name '*.yaml' -type f -exec sed -i "s#image: opea/codegen:latest#image: opea/codegen:${IMAGE_TAG}#g" {} \;
if [ $CONTEXT == "CI" ]; then
# replace megaservice image tag
find . -name '*.yaml' -type f -exec sed -i "s#image: \"opea/codegen:latest#image: \"opea/codegen:${IMAGE_TAG}#g" {} \;
else
# replace microservice image tag
find . -name '*.yaml' -type f -exec sed -i "s#image: \"opea/\(.*\):latest#image: \"opea/\1:${IMAGE_TAG}#g" {} \;
fi
# replace the repository "image: opea/*" with "image: $IMAGE_REPO/opea/"
find . -name '*.yaml' -type f -exec sed -i "s#image: \"opea/*#image: \"${IMAGE_REPO}opea/#g" {} \;
# set huggingface token
Expand Down
9 changes: 7 additions & 2 deletions CodeGen/tests/test_manifest_on_xeon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,13 @@ function init_codegen() {
# executed under path manifest/codegen/xeon
# replace the mount dir "path: /mnt/model" with "path: $CHART_MOUNT"
find . -name '*.yaml' -type f -exec sed -i "s#path: /mnt/opea-models#path: $MOUNT_DIR#g" {} \;
# replace megaservice image tag
find . -name '*.yaml' -type f -exec sed -i "s#image: opea/codegen:latest#image: opea/codegen:${IMAGE_TAG}#g" {} \;
if [ $CONTEXT == "CI" ]; then
# replace megaservice image tag
find . -name '*.yaml' -type f -exec sed -i "s#image: \"opea/codegen:latest#image: \"opea/codegen:${IMAGE_TAG}#g" {} \;
else
# replace microservice image tag
find . -name '*.yaml' -type f -exec sed -i "s#image: \"opea/\(.*\):latest#image: \"opea/\1:${IMAGE_TAG}#g" {} \;
fi
# replace the repository "image: opea/*" with "image: $IMAGE_REPO/opea/"
find . -name '*.yaml' -type f -exec sed -i "s#image: \"opea/*#image: \"${IMAGE_REPO}opea/#g" {} \;
# set huggingface token
Expand Down
9 changes: 7 additions & 2 deletions CodeTrans/tests/test_manifest_on_gaudi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,13 @@ function init_codetrans() {
# executed under path manifest/codetrans/xeon
# replace the mount dir "path: /mnt/model" with "path: $CHART_MOUNT"
find . -name '*.yaml' -type f -exec sed -i "s#path: /mnt/opea-models#path: $MOUNT_DIR#g" {} \;
# replace megaservice image tag
find . -name '*.yaml' -type f -exec sed -i "s#image: opea/codetrans:latest#image: opea/codetrans:${IMAGE_TAG}#g" {} \;
if [ $CONTEXT == "CI" ]; then
# replace megaservice image tag
find . -name '*.yaml' -type f -exec sed -i "s#image: \"opea/codetrans:latest#image: \"opea/codetrans:${IMAGE_TAG}#g" {} \;
else
# replace microservice image tag
find . -name '*.yaml' -type f -exec sed -i "s#image: \"opea/\(.*\):latest#image: \"opea/\1:${IMAGE_TAG}#g" {} \;
fi
# replace the repository "image: opea/*" with "image: $IMAGE_REPO/opea/"
find . -name '*.yaml' -type f -exec sed -i "s#image: \"opea/*#image: \"${IMAGE_REPO}opea/#g" {} \;
# set huggingface token
Expand Down
9 changes: 7 additions & 2 deletions CodeTrans/tests/test_manifest_on_xeon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,13 @@ function init_codetrans() {
# executed under path manifest/codetrans/xeon
# replace the mount dir "path: /mnt/model" with "path: $CHART_MOUNT"
find . -name '*.yaml' -type f -exec sed -i "s#path: /mnt/opea-models#path: $MOUNT_DIR#g" {} \;
# replace megaservice image tag
find . -name '*.yaml' -type f -exec sed -i "s#image: opea/codetrans:latest#image: opea/codetrans:${IMAGE_TAG}#g" {} \;
if [ $CONTEXT == "CI" ]; then
# replace megaservice image tag
find . -name '*.yaml' -type f -exec sed -i "s#image: \"opea/codetrans:latest#image: \"opea/codetrans:${IMAGE_TAG}#g" {} \;
else
# replace microservice image tag
find . -name '*.yaml' -type f -exec sed -i "s#image: \"opea/\(.*\):latest#image: \"opea/\1:${IMAGE_TAG}#g" {} \;
fi
# replace the repository "image: opea/*" with "image: $IMAGE_REPO/opea/"
find . -name '*.yaml' -type f -exec sed -i "s#image: \"opea/*#image: \"${IMAGE_REPO}opea/#g" {} \;
# set huggingface token
Expand Down
9 changes: 7 additions & 2 deletions DocSum/tests/test_manifest_on_gaudi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,13 @@ function init_docsum() {
# executed under path manifest/docsum/xeon
# replace the mount dir "path: /mnt/model" with "path: $CHART_MOUNT"
find . -name '*.yaml' -type f -exec sed -i "s#path: /mnt/opea-models#path: $MOUNT_DIR#g" {} \;
# replace megaservice image tag
find . -name '*.yaml' -type f -exec sed -i "s#image: opea/docsum:latest#image: opea/docsum:${IMAGE_TAG}#g" {} \;
if [ $CONTEXT == "CI" ]; then
# replace megaservice image tag
find . -name '*.yaml' -type f -exec sed -i "s#image: \"opea/docsum:latest#image: \"opea/docsum:${IMAGE_TAG}#g" {} \;
else
# replace microservice image tag
find . -name '*.yaml' -type f -exec sed -i "s#image: \"opea/\(.*\):latest#image: \"opea/\1:${IMAGE_TAG}#g" {} \;
fi
# replace the repository "image: opea/*" with "image: $IMAGE_REPO/opea/"
find . -name '*.yaml' -type f -exec sed -i "s#image: \"opea/*#image: \"${IMAGE_REPO}opea/#g" {} \;
# set huggingface token
Expand Down
9 changes: 7 additions & 2 deletions DocSum/tests/test_manifest_on_xeon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,13 @@ function init_docsum() {
# executed under path manifest/docsum/xeon
# replace the mount dir "path: /mnt/model" with "path: $CHART_MOUNT"
find . -name '*.yaml' -type f -exec sed -i "s#path: /mnt/opea-models#path: $MOUNT_DIR#g" {} \;
# replace megaservice image tag
find . -name '*.yaml' -type f -exec sed -i "s#image: opea/docsum:latest#image: opea/docsum:${IMAGE_TAG}#g" {} \;
if [ $CONTEXT == "CI" ]; then
# replace megaservice image tag
find . -name '*.yaml' -type f -exec sed -i "s#image: \"opea/docsum:latest#image: \"opea/docsum:${IMAGE_TAG}#g" {} \;
else
# replace microservice image tag
find . -name '*.yaml' -type f -exec sed -i "s#image: \"opea/\(.*\):latest#image: \"opea/\1:${IMAGE_TAG}#g" {} \;
fi
# replace the repository "image: opea/*" with "image: $IMAGE_REPO/opea/"
find . -name '*.yaml' -type f -exec sed -i "s#image: \"opea/*#image: \"${IMAGE_REPO}opea/#g" {} \;
# set huggingface token
Expand Down

0 comments on commit 71363a6

Please sign in to comment.