diff --git a/.github/workflows/_comps-workflow.yml b/.github/workflows/_comps-workflow.yml index 2a82110152..7335a40f97 100644 --- a/.github/workflows/_comps-workflow.yml +++ b/.github/workflows/_comps-workflow.yml @@ -124,5 +124,5 @@ jobs: tag: ${{ inputs.tag }} mode: ${{ inputs.mode }} service: ${{ inputs.service }} - hardware: ${{ inputs.node }} + hardware: ${{ inputs.hardware }} secrets: inherit diff --git a/.github/workflows/_run-helm-chart.yml b/.github/workflows/_run-helm-chart.yml index 79990e675d..3a5ffa3155 100644 --- a/.github/workflows/_run-helm-chart.yml +++ b/.github/workflows/_run-helm-chart.yml @@ -14,7 +14,7 @@ on: dockerhub: default: "false" required: false - type: string + type: boolean description: "Set to true if you want to use released docker images at dockerhub. By default using internal docker registry." tag: default: "latest" @@ -62,11 +62,12 @@ jobs: base_commit=${{ github.event.pull_request.base.sha }} merged_commit=$(git log -1 --format='%H') values_files=$(git diff --name-only ${base_commit} ${merged_commit} | \ - grep "kubernetes" | \ + grep "values.yaml" | \ + grep "${{ inputs.service }}" | \ sort -u ) echo $values_files elif [ "${{ inputs.mode }}" = "CD" ]; then - values_files=$(ls ${{ github.workspace }}/comps/"${{ inputs.service }}"/deployment/kubernetes/*values.yaml) + values_files=$(ls ${{ github.workspace }}/comps/${{ inputs.service }}/deployment/kubernetes/*values.yaml) fi value_files="[" for file in ${values_files}; do @@ -153,7 +154,15 @@ jobs: exit 0 fi - if ! helm install --create-namespace --namespace $NAMESPACE $RELEASE_NAME oci://ghcr.io/opea-project/charts/${CHART_NAME} --set global.HUGGINGFACEHUB_API_TOKEN=${HFTOKEN} --set global.modelUseHostPath=/home/sdp/.cache/huggingface/hub -f comps/${{ inputs.service }}/deployment/kubernetes/${value_file} --version 0-latest --wait; then + if ! helm install --create-namespace --namespace $NAMESPACE $RELEASE_NAME \ + oci://ghcr.io/opea-project/charts/${CHART_NAME} \ + --set global.HUGGINGFACEHUB_API_TOKEN=${HFTOKEN} \ + --set global.modelUseHostPath=/home/sdp/.cache/huggingface/hub \ + --set GOOGLE_API_KEY=${{ env.GOOGLE_API_KEY}} \ + --set GOOGLE_CSE_ID=${{ env.GOOGLE_CSE_ID}} \ + -f comps/${{ inputs.service }}/deployment/kubernetes/${value_file} \ + --version 0-latest \ + --wait; then echo "Failed to install chart ${{ inputs.service }}" echo "skip_validate=true" >> $GITHUB_ENV .github/workflows/scripts/k8s-utils.sh dump_pods_status $NAMESPACE @@ -200,7 +209,7 @@ jobs: - name: Helm uninstall if: always() run: | - if $should_cleanup; then + if [[ $should_cleanup ]]; then helm uninstall $RELEASE_NAME --namespace $NAMESPACE if ! kubectl delete ns $NAMESPACE --timeout=$KUBECTL_TIMEOUT_SECONDS; then kubectl delete pods --namespace $NAMESPACE --force --grace-period=0 --all diff --git a/.github/workflows/manual-comps-test.yml b/.github/workflows/manual-comps-test.yml index 8765a601f5..d785496a3a 100644 --- a/.github/workflows/manual-comps-test.yml +++ b/.github/workflows/manual-comps-test.yml @@ -56,7 +56,7 @@ jobs: services=($(echo ${{ inputs.services }} | tr ',' ' ')) services_json=$(printf '%s\n' "${services[@]}" | sort -u | jq -R '.' | jq -sc '.') echo "services=$services_json" >> $GITHUB_OUTPUT - if [ ${{ inputs.test_helmchart }} == "true" ]; then + if [ "${{ inputs.test_helmchart }}" == "true" ]; then nodes=($(echo ${{ inputs.nodes }} | tr ',' ' ')) nodes_json=$(printf '%s\n' "${nodes[@]}" | sort -u | jq -R '.' | jq -sc '.') echo "nodes=$nodes_json" >> $GITHUB_OUTPUT @@ -69,12 +69,12 @@ jobs: strategy: matrix: service: ${{ fromJson(needs.get-test-matrix.outputs.services) }} - nodes: ${{ fromJson(needs.get-test-matrix.outputs.nodes) }} + node: ${{ fromJson(needs.get-test-matrix.outputs.nodes) }} fail-fast: false uses: ./.github/workflows/_comps-workflow.yml with: service: ${{ matrix.service }} - hardware: ${{ matrix.nodes }} + hardware: ${{ matrix.node }} tag: ${{ inputs.tag }} mode: ${{ inputs.mode }} test_compose: ${{ inputs.test_compose }}