Skip to content

Commit

Permalink
update deploy_gmc logical in cd workflow (#627)
Browse files Browse the repository at this point in the history
* update deploy_gmc logical

Signed-off-by: chensuyue <[email protected]>

* bug fix

Signed-off-by: chensuyue <[email protected]>

* add always() for run-examples

Signed-off-by: chensuyue <[email protected]>

* bug fix

Signed-off-by: chensuyue <[email protected]>

---------

Signed-off-by: chensuyue <[email protected]>
  • Loading branch information
chensuyue authored Aug 19, 2024
1 parent 4fd3517 commit c016d82
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 15 deletions.
25 changes: 12 additions & 13 deletions .github/workflows/_gmc-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ on:
required: true
type: string
description: "Hardware to run test"
deploy:
default: true
required: true
type: boolean
description: 'Whether to deploy gmc'
opea_branch:
default: "main"
required: false
type: string
description: 'OPEA branch for image build'
workflow_call:
inputs:
tag:
Expand All @@ -33,11 +33,11 @@ on:
required: true
type: string
description: "Hardware to run test"
deploy:
default: true
required: true
type: boolean
description: 'Whether to deploy gmc'
opea_branch:
default: "main"
required: false
type: string
description: 'OPEA branch for image build'

jobs:
####################################################################################################
Expand All @@ -50,7 +50,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: opea-project/GenAIInfra
ref: ${{ inputs.tag }}
ref: ${{ inputs.opea_branch }}
path: GenAIInfra

- name: Set variables
Expand Down Expand Up @@ -113,14 +113,13 @@ jobs:
####################################################################################################
gmc-install:
needs: image-build
if: ${{ fromJSON(inputs.deploy) }}
runs-on: "k8s-${{ inputs.node }}"
steps:
- name: Checkout GenAIInfra repository
uses: actions/checkout@v4
with:
repository: opea-project/GenAIInfra
ref: ${{ inputs.tag }}
ref: ${{ inputs.opea_branch }}
path: GenAIInfra

- name: Set variables
Expand Down
13 changes: 11 additions & 2 deletions .github/workflows/manual-example-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ on:
description: 'Test examples with k8s'
required: false
type: boolean
test_gmc:
default: false
description: 'Test examples with gmc'
required: false
type: boolean
opea_branch:
default: "main"
description: 'OPEA branch for image build'
Expand All @@ -70,6 +75,8 @@ jobs:
echo "nodes=$nodes_json" >> $GITHUB_OUTPUT
build-deploy-gmc:
needs: [get-test-matrix]
if: ${{ fromJSON(inputs.deploy_gmc) }}
strategy:
matrix:
node: ${{ fromJson(needs.get-test-matrix.outputs.nodes) }}
Expand All @@ -78,11 +85,12 @@ jobs:
with:
node: ${{ matrix.node }}
tag: ${{ inputs.tag }}
deploy: ${{ fromJSON(inputs.deploy_gmc) }}
opea_branch: ${{ inputs.opea_branch }}
secrets: inherit

run-examples:
needs: [get-test-matrix]
needs: [get-test-matrix, build-deploy-gmc]
if: always()
strategy:
matrix:
example: ${{ fromJson(needs.get-test-matrix.outputs.examples) }}
Expand All @@ -97,5 +105,6 @@ jobs:
scan: ${{ fromJSON(inputs.scan) }}
test_compose: ${{ fromJSON(inputs.test_compose) }}
test_k8s: ${{ fromJSON(inputs.test_k8s) }}
test_gmc: ${{ fromJSON(inputs.test_gmc) }}
opea_branch: ${{ inputs.opea_branch }}
secrets: inherit

0 comments on commit c016d82

Please sign in to comment.