-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Yingchun Guo <[email protected]>
- Loading branch information
1 parent
6296e9f
commit 6ee11f5
Showing
1 changed file
with
130 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
# Copyright (C) 2024 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
name: Build and upgrade GMC system on call and manual | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
tag: | ||
default: "latest" | ||
required: false | ||
type: string | ||
workflow_call: | ||
inputs: | ||
tag: | ||
default: "latest" | ||
required: false | ||
type: string | ||
pull_request: | ||
branches: [main] | ||
types: [opened, reopened, ready_for_review, synchronize] # added `ready_for_review` since draft is skipped | ||
paths: | ||
- .github/workflows/_gmc-workflow.yml | ||
|
||
jobs: | ||
#################################################################################################### | ||
# Image Build and Scan | ||
#################################################################################################### | ||
image-build: | ||
strategy: | ||
matrix: | ||
platform: [docker-build-xeon] | ||
runs-on: ${{ matrix.platform }} | ||
steps: | ||
- name: Checkout GenAIInfra repository | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: opea-project/GenAIInfra | ||
#ref: ${{ inputs.tag }} | ||
path: GenAIInfra | ||
|
||
- name: Set variables | ||
id: set_variables | ||
run: | | ||
echo "DOCKER_REGISTRY=${OPEA_IMAGE_REPO}opea" >> $GITHUB_ENV | ||
echo "IMAGE_REPO=${OPEA_IMAGE_REPO}" >> $GITHUB_OUTPUT | ||
# echo "VERSION=${{ inputs.tag }}" >> $GITHUB_ENV | ||
# echo "VERSION=${{ inputs.tag }}" >> $GITHUB_OUTPUT | ||
echo "VERSION=latest" >> $GITHUB_ENV | ||
echo "VERSION=latest" >> $GITHUB_OUTPUT | ||
- name: Build image and push | ||
run: | | ||
cd ${{github.workspace}}/GenAIInfra/microservices-connector | ||
make docker.build | ||
make docker.push | ||
- name: Scan gmcmanager | ||
uses: opea-project/validation/actions/trivy-scan@main | ||
with: | ||
image-ref: ${{ env.DOCKER_REGISTRY }}/gmcmanager:${{ env.VERSION }} | ||
output: gmcmanager-scan.txt | ||
|
||
- uses: actions/[email protected] | ||
with: | ||
name: gmcmanager-scan | ||
path: gmcmanager-scan.txt | ||
overwrite: true | ||
|
||
- name: Scan gmcrouter | ||
uses: opea-project/validation/actions/trivy-scan@main | ||
with: | ||
image-ref: ${{ env.DOCKER_REGISTRY }}/gmcrouter:${{ env.VERSION }} | ||
output: gmcrouter-scan.txt | ||
|
||
- uses: actions/[email protected] | ||
with: | ||
name: gmcrouter-scan | ||
path: gmcrouter-scan.txt | ||
overwrite: true | ||
|
||
- name: Clean up images | ||
if: always() | ||
run: | | ||
docker rmi ${{ env.DOCKER_REGISTRY }}/gmcrouter:${{ env.VERSION }} | ||
docker rmi ${{ env.DOCKER_REGISTRY }}/gmcmanager:${{ env.VERSION }} | ||
- name: Clean up GenAIInfra source codes | ||
run: | | ||
rm -rf ${{github.workspace}}/GenAIInfra | ||
#################################################################################################### | ||
# GMC Install | ||
#################################################################################################### | ||
gmc-install: | ||
strategy: | ||
matrix: | ||
platform: [k8s-xeon] | ||
needs: image-build | ||
runs-on: ${{ matrix.platform }} | ||
steps: | ||
- name: Checkout GenAIInfra repository | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: opea-project/GenAIInfra | ||
#ref: ${{ inputs.tag }} | ||
path: GenAIInfra | ||
|
||
- name: Set variables | ||
run: | | ||
echo "SYSTEM_NAMESPACE=opea-system" >> $GITHUB_ENV | ||
#echo "VERSION=${{ inputs.tag }}" >> $GITHUB_ENV | ||
echo "VERSION=latest" >> $GITHUB_ENV | ||
echo "SET_VERSION=true" >> $GITHUB_ENV | ||
- name: Cleanup existing GMC | ||
run: | | ||
cd GenAIInfra | ||
.github/workflows/scripts/e2e/gmc_install.sh cleanup_gmc | ||
cd .. | ||
- name: Install GMC | ||
run: | | ||
cd GenAIInfra | ||
.github/workflows/scripts/e2e/gmc_install.sh install_gmc | ||
cd .. | ||
- name: Clean up GenAIInfra source codes | ||
run: | | ||
rm -rf ${{github.workspace}}/GenAIInfra |