-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve cd workflows and add release document (#347)
* add release document Signed-off-by: Yingchun Guo <[email protected]> * improve cd workflows, add cd document Signed-off-by: Yingchun Guo <[email protected]> --------- Signed-off-by: Yingchun Guo <[email protected]>
- Loading branch information
1 parent
9480afc
commit a4398b0
Showing
6 changed files
with
94 additions
and
98 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
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
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 |
---|---|---|
|
@@ -14,22 +14,11 @@ on: | |
default: true | ||
required: false | ||
type: boolean | ||
scan: | ||
default: true | ||
required: false | ||
type: boolean | ||
test_gmc: | ||
default: true | ||
required: false | ||
type: boolean | ||
publish: | ||
default: false | ||
required: false | ||
type: boolean | ||
publish_tags: | ||
default: "latest" | ||
required: false | ||
type: string | ||
|
||
jobs: | ||
#################################################################################################### | ||
# Image Build | ||
|
@@ -41,40 +30,6 @@ jobs: | |
image_tag: ${{ inputs.tag }} | ||
runner_label: 'docker-build-xeon' | ||
|
||
#################################################################################################### | ||
# Trivy Scan | ||
#################################################################################################### | ||
scan-images: | ||
needs: [image-build] | ||
if: ${{ fromJSON(inputs.scan) }} | ||
strategy: | ||
matrix: | ||
image: ["gmcmanager", "gmcrouter"] | ||
runs-on: 'docker-build-xeon' | ||
steps: | ||
- name: Harden Runner | ||
uses: step-security/[email protected] | ||
with: | ||
egress-policy: audit | ||
|
||
- name: Pull Image | ||
run: docker pull ${OPEA_IMAGE_REPO}opea/${{ matrix.image }}:${{ inputs.tag }} | ||
|
||
- name: Scan Container | ||
uses: opea-project/validation/actions/trivy-scan@main | ||
with: | ||
image-ref: ${OPEA_IMAGE_REPO}opea/${{ matrix.image }}:${{ inputs.tag }} | ||
output: ${{ matrix.image }}-scan.txt | ||
|
||
- name: Cleanup | ||
if: always() | ||
run: docker rmi -f ${OPEA_IMAGE_REPO}opea/${{ matrix.image }}:${{ inputs.tag }} | ||
- uses: actions/[email protected] | ||
with: | ||
name: gmc-scan | ||
path: ${{ matrix.image }}-scan.txt | ||
overwrite: true | ||
|
||
#################################################################################################### | ||
# GMC Test | ||
#################################################################################################### | ||
|
@@ -86,22 +41,3 @@ jobs: | |
repo: ${{ needs.image-build.outputs.image_repo }} | ||
tag: ${{ needs.image-build.outputs.image_tag }} | ||
secrets: inherit | ||
|
||
|
||
#################################################################################################### | ||
# Publish | ||
#################################################################################################### | ||
publish: | ||
needs: [image-build, scan-images, test-gmc] | ||
if: ${{ fromJSON(inputs.publish) }} | ||
strategy: | ||
matrix: | ||
image: ["gmcmanager", "gmcrouter"] | ||
runs-on: "docker-build-xeon" | ||
steps: | ||
- name: Image Publish | ||
uses: opea-project/validation/actions/image-publish@main | ||
with: | ||
local_image_ref: ${OPEA_IMAGE_REPO}opea/${{ matrix.image }}:${{ inputs.tag }} | ||
image_name: opea/${{ matrix.image }} | ||
publish_tags: ${{ inputs.publish_tags }} |
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
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
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,72 @@ | ||
# Release Branches | ||
|
||
Release branches have a name of `v#.#` like `v0.9`. The branch with `v#.#rc` is the release candidate branch. This document describe how a release branch is created and how a release is made. All these steps have to be executed by release manager who has write permission. | ||
|
||
## 1. Create release candidate branch | ||
|
||
On the feature freeze day, a release candidate branch will be created. | ||
|
||
``` | ||
git clone https://github.com/opea-project/GenAIInfra.git | ||
cd GenAIInfra | ||
git checkout -b v0.9rc | ||
git push origin v0.9rc | ||
``` | ||
|
||
## 2. Create images with release tag | ||
|
||
This step is being executed under `GenAIExamples`. | ||
|
||
In the [Actions](https://github.com/opea-project/GenAIExamples/actions), select the workflow "Examples CD workflow on manual event", and manually trigger this workflow. (Refer to [github website](https://docs.github.com/en/actions/managing-workflow-runs-and-deployments/managing-workflow-runs/manually-running-a-workflow) to get how to manually run a workflow.) | ||
|
||
There will be a window promoted for your input. The inputs to the workflow are: | ||
| Description | Value | | ||
|-----------------------------|------------| | ||
|Use workflow from|Branch: v0.9rc| | ||
|Hardware to run test|"gaudi,xeon"| | ||
|List of examples to test|"AudioQnA,ChatQnA,CodeGen,CodeTrans,DocSum,FaqGen,SearchQnA,Translation"| | ||
|Tag to apply to images|"v0.9rc"| | ||
|Whether to deploy gmc|false| | ||
|Build test required images for Examples|true| | ||
|Scan all images with Trivy|false| | ||
|Test examples with docker compose|false| | ||
|Test examples with k8s|false| | ||
|Test examples with gmc|false| | ||
|OPEA branch for image build|"v0.9rc"| | ||
|
||
After this workflow executed, the images for GenAIExamples and GenAIComps with `v0.9` tag will be created and pushed to CI local image registries both in Gaudi and Xeon environment. | ||
|
||
## 3. Test helm charts | ||
|
||
This step is being executed under `GenAIInfra`. | ||
|
||
In the [Actions](https://github.com/opea-project/GenAIInfra/actions), select the workflow "GenAIInfra Helm CD workflow on manual event", and manually trigger this workflow. There will be a window promoted for your input. | ||
|
||
The inputs to the workflow are: | ||
| Description | Value | | ||
|-----------------------------|------------| | ||
|Use workflow from|Branch: v0.9rc| | ||
|workloads to test, empty for testing all helm charts|""| | ||
|Image tag to be tested|"v0.9"| | ||
|Hardwares used to run tests|"xeon,gaudi"| | ||
|
||
All the helm charts will be tested. Green ticks show helm charts pass the tests. | ||
|
||
## 4. Test GMC | ||
|
||
This step is being executed under `GenAIInfra`. The test will be executed in GMC CI K8s cluster, which is a KIND cluster for now. | ||
|
||
In the [Actions](https://github.com/opea-project/GenAIInfra/actions), select the workflow "GenAIInfra GMC CD workflow on manual event", and manually trigger this workflow. There will be a window promoted for your input. | ||
|
||
The inputs to the workflow are: | ||
| Description | Value | | ||
|-----------------------------|------------| | ||
|Use workflow from|Branch: v0.9rc| | ||
|Tag to apply to images|"v0.9"| | ||
|Whether to build test required images for GMC|true| | ||
|
||
GMC images will be built with v0.9rc branch. GMC test cases will be tested in KIND cluster on Xeon. Green ticks show helm charts pass the tests. | ||
|
||
## 5. Publish images | ||
|
||
The image pass action will be executed under `GenAIExamples` repo. After all previous tests pass and GenAIExamples release tests also pass, the images will be pushed through GenAIExample workflow [Examples publish docker image on manual event](https://github.com/opea-project/GenAIExamples/actions/workflows/manual-docker-publish.yml). |