-
Notifications
You must be signed in to change notification settings - Fork 149
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: ZePan110 <[email protected]>
- Loading branch information
Showing
2 changed files
with
100 additions
and
1 deletion.
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,99 @@ | ||
# Copyright (C) 2024 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
name: GenAIComps Helm CD workflow on manual event | ||
on: | ||
pull_request: | ||
branches: [main] | ||
types: [opened, reopened, ready_for_review, synchronize] # added `ready_for_review` since draft is skipped | ||
paths: | ||
- "**/deployment/kubernetes/**" | ||
# workflow_dispatch: | ||
# inputs: | ||
# workloads: | ||
# default: "" | ||
# required: false | ||
# type: string | ||
# description: "workloads to test, empty for testing all helm charts" | ||
# dockerhub: | ||
# default: "false" | ||
# required: false | ||
# type: string | ||
# description: "Set to true if you want to use released docker images at dockerhub. By default using internal docker registry." | ||
# tag: | ||
# default: "latest" | ||
# description: "Image tag to be tested" | ||
# required: true | ||
# type: string | ||
# opea_branch: | ||
# default: "main" | ||
# description: 'OPEA branch for image build' | ||
# required: false | ||
# type: string | ||
|
||
jobs: | ||
get-build-matrix: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
run_matrix: ${{ steps.get-services.outputs.run_matrix }} | ||
steps: | ||
- name: Checkout out Repo | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
ref: ${{ inputs.opea_branch }} | ||
# comps/agent/deployment/kubernetes | ||
- name: Get test Services | ||
id: get-services | ||
run: | | ||
set -x | ||
run_matrix="{\"include\":[" | ||
if [[ -z "${{ inputs.workloads }}" ]]; then | ||
ls ${{ github.workspace }}/comps | ||
for chart in ${{ github.workspace }}/comps/*; do | ||
if [[ -f $chart ]]; then | ||
continue | ||
fi | ||
service=$(echo "$chart"| awk -F'/' '{print $NF}') | ||
for file in "$chart"/deployment/kubernetes/*values.yaml; do | ||
if [ -f "$file" ]; then | ||
filename=$(basename "$file" .yaml) | ||
if [[ "$filename" == *"gaudi"* ]]; then | ||
run_matrix="${run_matrix}{\"example\":\"$service\",\"hardware\":\"gaudi\", \"valuefile\":\"${filename}\"}," | ||
else | ||
run_matrix="${run_matrix}{\"example\":\"$service\",\"hardware\":\"xeon\", \"valuefile\":\"${filename}\"}," | ||
fi | ||
fi | ||
done | ||
done | ||
else | ||
service_list=($(echo "${{ github.event.inputs.workloads }}" | tr ',' ' ')) | ||
for service in $service_list; do | ||
for file in comps/"$service"/deployment/kubernetes/*values.yaml; do | ||
if [ -f "$file" ]; then | ||
filename=$(basename "$file" .yaml) | ||
if [[ "$filename" == *"gaudi"* ]]; then | ||
run_matrix="${run_matrix}{\"example\":\"$service\",\"hardware\":\"gaudi\", \"valuefile\":\"${filename}\"}," | ||
else | ||
run_matrix="${run_matrix}{\"example\":\"$service\",\"hardware\":\"xeon\", \"valuefile\":\"${filename}\"}," | ||
fi | ||
fi | ||
done | ||
done | ||
fi | ||
run_matrix=$run_matrix"]}" | ||
echo "run_matrix=${run_matrix}" | ||
echo "run_matrix=${run_matrix}" >> $GITHUB_OUTPUT | ||
helm-release: | ||
needs: get-build-matrix | ||
strategy: | ||
matrix: ${{ fromJSON(needs.get-build-matrix.outputs.run_matrix) }} | ||
uses: ./.github/workflows/_helm-e2e.yaml | ||
with: | ||
tag: ${{ inputs.tag }} | ||
dockerhub: ${{ inputs.dockerhub }} | ||
workload: ${{ matrix.example }} | ||
hardware: ${{ matrix.hardware }} | ||
valuefile: ${{ matrix.valuefile }} | ||
secrets: inherit |
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