change microservice tags in CD workflow (#612)
Signed-off-by: Yingchun Guo <yingchun.guo@intel.com>
This commit is contained in:
1
.github/workflows/_example-workflow.yml
vendored
1
.github/workflows/_example-workflow.yml
vendored
@@ -146,4 +146,5 @@ jobs:
|
||||
example: ${{ inputs.example }}
|
||||
hardware: ${{ inputs.node }}
|
||||
tag: ${{ inputs.tag }}
|
||||
context: "CD"
|
||||
secrets: inherit
|
||||
|
||||
6
.github/workflows/_manifest-e2e.yml
vendored
6
.github/workflows/_manifest-e2e.yml
vendored
@@ -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:
|
||||
@@ -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
|
||||
|
||||
@@ -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" {} \;
|
||||
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" {} \;
|
||||
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
|
||||
|
||||
@@ -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" {} \;
|
||||
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" {} \;
|
||||
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
|
||||
|
||||
@@ -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" {} \;
|
||||
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" {} \;
|
||||
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
|
||||
|
||||
@@ -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" {} \;
|
||||
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" {} \;
|
||||
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
|
||||
|
||||
@@ -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" {} \;
|
||||
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" {} \;
|
||||
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
|
||||
|
||||
@@ -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" {} \;
|
||||
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" {} \;
|
||||
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
|
||||
|
||||
@@ -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" {} \;
|
||||
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" {} \;
|
||||
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
|
||||
|
||||
@@ -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" {} \;
|
||||
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" {} \;
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user