Skip to content

Commit 71363a6

Browse files
authored
change microservice tags in CD workflow (#612)
Signed-off-by: Yingchun Guo <yingchun.guo@intel.com>
1 parent a39f23a commit 71363a6

File tree

10 files changed

+63
-16
lines changed

10 files changed

+63
-16
lines changed

.github/workflows/_example-workflow.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,4 +146,5 @@ jobs:
146146
example: ${{ inputs.example }}
147147
hardware: ${{ inputs.node }}
148148
tag: ${{ inputs.tag }}
149+
context: "CD"
149150
secrets: inherit

.github/workflows/_manifest-e2e.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ on:
2020
description: "Tag to apply to images, default is latest"
2121
required: false
2222
type: string
23+
context:
24+
default: "CI"
25+
description: "CI or CD"
26+
required: false
27+
type: string
2328

2429
jobs:
2530
manifest-test:
@@ -55,6 +60,7 @@ jobs:
5560
echo "continue_test=true" >> $GITHUB_ENV
5661
echo "should_cleanup=false" >> $GITHUB_ENV
5762
echo "skip_validate=true" >> $GITHUB_ENV
63+
echo "CONTEXT=${{ inputs.context }}" >> $GITHUB_ENV
5864
echo "NAMESPACE=$NAMESPACE"
5965
6066
- name: Kubectl install

ChatQnA/tests/test_manifest_on_gaudi.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,13 @@ IMAGE_TAG=${IMAGE_TAG:-latest}
1212
function init_chatqna() {
1313
# replace the mount dir "path: /mnt/opea-models" with "path: $CHART_MOUNT"
1414
find . -name '*.yaml' -type f -exec sed -i "s#path: /mnt/opea-models#path: $MOUNT_DIR#g" {} \;
15-
# replace megaservice image tag
16-
find . -name '*.yaml' -type f -exec sed -i "s#image: opea/chatqna:latest#image: opea/chatqna:${IMAGE_TAG}#g" {} \;
15+
if [ $CONTEXT == "CI" ]; then
16+
# replace megaservice image tag
17+
find . -name '*.yaml' -type f -exec sed -i "s#image: \"opea/chatqna:latest#image: \"opea/chatqna:${IMAGE_TAG}#g" {} \;
18+
else
19+
# replace microservice image tag
20+
find . -name '*.yaml' -type f -exec sed -i "s#image: \"opea/\(.*\):latest#image: \"opea/\1:${IMAGE_TAG}#g" {} \;
21+
fi
1722
# replace the repository "image: opea/*" with "image: $IMAGE_REPO/opea/"
1823
find . -name '*.yaml' -type f -exec sed -i "s#image: \"opea/*#image: \"${IMAGE_REPO}opea/#g" {} \;
1924
# set huggingface token

ChatQnA/tests/test_manifest_on_xeon.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,13 @@ IMAGE_TAG=${IMAGE_TAG:-latest}
1212
function init_chatqna() {
1313
# replace the mount dir "path: /mnt/opea-models" with "path: $CHART_MOUNT"
1414
find . -name '*.yaml' -type f -exec sed -i "s#path: /mnt/opea-models#path: $MOUNT_DIR#g" {} \;
15-
# replace megaservice image tag
16-
find . -name '*.yaml' -type f -exec sed -i "s#image: opea/chatqna:latest#image: opea/chatqna:${IMAGE_TAG}#g" {} \;
15+
if [ $CONTEXT == "CI" ]; then
16+
# replace megaservice image tag
17+
find . -name '*.yaml' -type f -exec sed -i "s#image: \"opea/chatqna:latest#image: \"opea/chatqna:${IMAGE_TAG}#g" {} \;
18+
else
19+
# replace microservice image tag
20+
find . -name '*.yaml' -type f -exec sed -i "s#image: \"opea/\(.*\):latest#image: \"opea/\1:${IMAGE_TAG}#g" {} \;
21+
fi
1722
# replace the repository "image: opea/*" with "image: $IMAGE_REPO/opea/"
1823
find . -name '*.yaml' -type f -exec sed -i "s#image: \"opea/*#image: \"${IMAGE_REPO}opea/#g" {} \;
1924
# set huggingface token

CodeGen/tests/test_manifest_on_gaudi.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,13 @@ function init_codegen() {
1313
# executed under path manifest/codegen/xeon
1414
# replace the mount dir "path: /mnt/model" with "path: $CHART_MOUNT"
1515
find . -name '*.yaml' -type f -exec sed -i "s#path: /mnt/opea-models#path: $MOUNT_DIR#g" {} \;
16-
# replace megaservice image tag
17-
find . -name '*.yaml' -type f -exec sed -i "s#image: opea/codegen:latest#image: opea/codegen:${IMAGE_TAG}#g" {} \;
16+
if [ $CONTEXT == "CI" ]; then
17+
# replace megaservice image tag
18+
find . -name '*.yaml' -type f -exec sed -i "s#image: \"opea/codegen:latest#image: \"opea/codegen:${IMAGE_TAG}#g" {} \;
19+
else
20+
# replace microservice image tag
21+
find . -name '*.yaml' -type f -exec sed -i "s#image: \"opea/\(.*\):latest#image: \"opea/\1:${IMAGE_TAG}#g" {} \;
22+
fi
1823
# replace the repository "image: opea/*" with "image: $IMAGE_REPO/opea/"
1924
find . -name '*.yaml' -type f -exec sed -i "s#image: \"opea/*#image: \"${IMAGE_REPO}opea/#g" {} \;
2025
# set huggingface token

CodeGen/tests/test_manifest_on_xeon.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,13 @@ function init_codegen() {
1313
# executed under path manifest/codegen/xeon
1414
# replace the mount dir "path: /mnt/model" with "path: $CHART_MOUNT"
1515
find . -name '*.yaml' -type f -exec sed -i "s#path: /mnt/opea-models#path: $MOUNT_DIR#g" {} \;
16-
# replace megaservice image tag
17-
find . -name '*.yaml' -type f -exec sed -i "s#image: opea/codegen:latest#image: opea/codegen:${IMAGE_TAG}#g" {} \;
16+
if [ $CONTEXT == "CI" ]; then
17+
# replace megaservice image tag
18+
find . -name '*.yaml' -type f -exec sed -i "s#image: \"opea/codegen:latest#image: \"opea/codegen:${IMAGE_TAG}#g" {} \;
19+
else
20+
# replace microservice image tag
21+
find . -name '*.yaml' -type f -exec sed -i "s#image: \"opea/\(.*\):latest#image: \"opea/\1:${IMAGE_TAG}#g" {} \;
22+
fi
1823
# replace the repository "image: opea/*" with "image: $IMAGE_REPO/opea/"
1924
find . -name '*.yaml' -type f -exec sed -i "s#image: \"opea/*#image: \"${IMAGE_REPO}opea/#g" {} \;
2025
# set huggingface token

CodeTrans/tests/test_manifest_on_gaudi.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,13 @@ function init_codetrans() {
1313
# executed under path manifest/codetrans/xeon
1414
# replace the mount dir "path: /mnt/model" with "path: $CHART_MOUNT"
1515
find . -name '*.yaml' -type f -exec sed -i "s#path: /mnt/opea-models#path: $MOUNT_DIR#g" {} \;
16-
# replace megaservice image tag
17-
find . -name '*.yaml' -type f -exec sed -i "s#image: opea/codetrans:latest#image: opea/codetrans:${IMAGE_TAG}#g" {} \;
16+
if [ $CONTEXT == "CI" ]; then
17+
# replace megaservice image tag
18+
find . -name '*.yaml' -type f -exec sed -i "s#image: \"opea/codetrans:latest#image: \"opea/codetrans:${IMAGE_TAG}#g" {} \;
19+
else
20+
# replace microservice image tag
21+
find . -name '*.yaml' -type f -exec sed -i "s#image: \"opea/\(.*\):latest#image: \"opea/\1:${IMAGE_TAG}#g" {} \;
22+
fi
1823
# replace the repository "image: opea/*" with "image: $IMAGE_REPO/opea/"
1924
find . -name '*.yaml' -type f -exec sed -i "s#image: \"opea/*#image: \"${IMAGE_REPO}opea/#g" {} \;
2025
# set huggingface token

CodeTrans/tests/test_manifest_on_xeon.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,13 @@ function init_codetrans() {
1313
# executed under path manifest/codetrans/xeon
1414
# replace the mount dir "path: /mnt/model" with "path: $CHART_MOUNT"
1515
find . -name '*.yaml' -type f -exec sed -i "s#path: /mnt/opea-models#path: $MOUNT_DIR#g" {} \;
16-
# replace megaservice image tag
17-
find . -name '*.yaml' -type f -exec sed -i "s#image: opea/codetrans:latest#image: opea/codetrans:${IMAGE_TAG}#g" {} \;
16+
if [ $CONTEXT == "CI" ]; then
17+
# replace megaservice image tag
18+
find . -name '*.yaml' -type f -exec sed -i "s#image: \"opea/codetrans:latest#image: \"opea/codetrans:${IMAGE_TAG}#g" {} \;
19+
else
20+
# replace microservice image tag
21+
find . -name '*.yaml' -type f -exec sed -i "s#image: \"opea/\(.*\):latest#image: \"opea/\1:${IMAGE_TAG}#g" {} \;
22+
fi
1823
# replace the repository "image: opea/*" with "image: $IMAGE_REPO/opea/"
1924
find . -name '*.yaml' -type f -exec sed -i "s#image: \"opea/*#image: \"${IMAGE_REPO}opea/#g" {} \;
2025
# set huggingface token

DocSum/tests/test_manifest_on_gaudi.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,13 @@ function init_docsum() {
1313
# executed under path manifest/docsum/xeon
1414
# replace the mount dir "path: /mnt/model" with "path: $CHART_MOUNT"
1515
find . -name '*.yaml' -type f -exec sed -i "s#path: /mnt/opea-models#path: $MOUNT_DIR#g" {} \;
16-
# replace megaservice image tag
17-
find . -name '*.yaml' -type f -exec sed -i "s#image: opea/docsum:latest#image: opea/docsum:${IMAGE_TAG}#g" {} \;
16+
if [ $CONTEXT == "CI" ]; then
17+
# replace megaservice image tag
18+
find . -name '*.yaml' -type f -exec sed -i "s#image: \"opea/docsum:latest#image: \"opea/docsum:${IMAGE_TAG}#g" {} \;
19+
else
20+
# replace microservice image tag
21+
find . -name '*.yaml' -type f -exec sed -i "s#image: \"opea/\(.*\):latest#image: \"opea/\1:${IMAGE_TAG}#g" {} \;
22+
fi
1823
# replace the repository "image: opea/*" with "image: $IMAGE_REPO/opea/"
1924
find . -name '*.yaml' -type f -exec sed -i "s#image: \"opea/*#image: \"${IMAGE_REPO}opea/#g" {} \;
2025
# set huggingface token

DocSum/tests/test_manifest_on_xeon.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,13 @@ function init_docsum() {
1313
# executed under path manifest/docsum/xeon
1414
# replace the mount dir "path: /mnt/model" with "path: $CHART_MOUNT"
1515
find . -name '*.yaml' -type f -exec sed -i "s#path: /mnt/opea-models#path: $MOUNT_DIR#g" {} \;
16-
# replace megaservice image tag
17-
find . -name '*.yaml' -type f -exec sed -i "s#image: opea/docsum:latest#image: opea/docsum:${IMAGE_TAG}#g" {} \;
16+
if [ $CONTEXT == "CI" ]; then
17+
# replace megaservice image tag
18+
find . -name '*.yaml' -type f -exec sed -i "s#image: \"opea/docsum:latest#image: \"opea/docsum:${IMAGE_TAG}#g" {} \;
19+
else
20+
# replace microservice image tag
21+
find . -name '*.yaml' -type f -exec sed -i "s#image: \"opea/\(.*\):latest#image: \"opea/\1:${IMAGE_TAG}#g" {} \;
22+
fi
1823
# replace the repository "image: opea/*" with "image: $IMAGE_REPO/opea/"
1924
find . -name '*.yaml' -type f -exec sed -i "s#image: \"opea/*#image: \"${IMAGE_REPO}opea/#g" {} \;
2025
# set huggingface token

0 commit comments

Comments
 (0)