Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions .github/workflows/_comps-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
service:
required: true
type: string
image_build_nodes:
required: true
type: string
tag:
default: "comps"
required: false
Expand Down Expand Up @@ -43,8 +46,10 @@ jobs:
# Image Build
####################################################################################################
build-images:
if: ${{ !(fromJSON(inputs.test_helmchart)) }}
runs-on: "docker-build-gaudi"
strategy:
matrix:
image_build_node: ${{ fromJson(inputs.image_build_nodes) }}
runs-on: "docker-build-${{ matrix.image_build_node }}"
continue-on-error: true
outputs:
file_exists: ${{ steps.get-yaml-path.outputs.file_exists }}
Expand Down Expand Up @@ -110,7 +115,6 @@ jobs:
# Docker Compose Test
####################################################################################################
test-service-compose:
needs: [build-images]
if: ${{ fromJSON(inputs.test_compose) }}
uses: ./.github/workflows/_run-docker-compose.yml
with:
Expand All @@ -127,6 +131,5 @@ jobs:
uses: ./.github/workflows/_run-helm-chart.yml
with:
tag: ${{ inputs.tag }}
mode: ${{ inputs.mode }}
service: ${{ inputs.service }}
secrets: inherit
15 changes: 6 additions & 9 deletions .github/workflows/_run-helm-chart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ on:
default: "latest"
required: false
type: string
mode:
default: "CD"
description: "Whether the test range is CI, CD or CICD"
required: false
type: string
version:
default: "0-latest"
required: false
Expand Down Expand Up @@ -58,17 +53,18 @@ jobs:
id: get-test-files
run: |
set -x
if [ "${{ inputs.mode }}" = "CI" ]; then
if [ "${{ github.ref_name }}" == "main" ]; then
values_files=$(ls ${{ github.workspace }}/comps/${{ inputs.service }}/deployment/kubernetes/*values.yaml)
else
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 "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)
fi

run_matrix="["
run_matrix="{\"include\":["
for file in ${values_files}; do
Expand Down Expand Up @@ -97,9 +93,10 @@ jobs:

helm-test:
needs: [get-test-case]
# if: ${{ needs.get-test-case.outputs.run_matrix != '[]' }}
if: ${{ fromJson(needs.get-test-case.outputs.run_matrix).include[0] }}
strategy:
matrix: ${{ fromJSON(needs.get-test-case.outputs.run_matrix) }}
if: ${{ needs.get-test-case.outputs.run_matrix != '[]' }}
runs-on: k8s-${{ matrix.hardware }}
continue-on-error: true
steps:
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/manual-comps-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ on:
description: "Build test required images for Comps"
required: false
type: boolean
image_build_nodes:
default: "gaudi,xeon"
description: "Build test required images for Comps on gaudi,xeon"
required: true
type: string
test_compose:
default: true
description: "Test comps with docker compose"
Expand Down Expand Up @@ -48,13 +53,17 @@ jobs:
runs-on: ubuntu-latest
outputs:
services: ${{ steps.get-matrix.outputs.services }}
image_build_nodes: ${{ steps.get-matrix.outputs.image_build_nodes }}
steps:
- name: Create Matrix
id: get-matrix
run: |
services=($(echo ${{ inputs.services }} | tr ',' ' '))
services_json=$(printf '%s\n' "${services[@]}" | sort -u | jq -R '.' | jq -sc '.')
echo "services=$services_json" >> $GITHUB_OUTPUT
image_build_nodes=($(echo ${{ inputs.image_build_nodes }} | tr ',' ' '))
image_build_nodes_json=$(printf '%s\n' "${image_build_nodes[@]}" | sort -u | jq -R '.' | jq -sc '.')
echo "image_build_nodes=$image_build_nodes_json" >> $GITHUB_OUTPUT

run-services:
needs: [get-test-matrix]
Expand All @@ -65,6 +74,7 @@ jobs:
uses: ./.github/workflows/_comps-workflow.yml
with:
service: ${{ matrix.service }}
image_build_nodes: ${{ needs.get-test-matrix.outputs.image_build_nodes }}
tag: ${{ inputs.tag }}
mode: ${{ inputs.mode }}
test_compose: ${{ inputs.test_compose }}
Expand Down