Skip to content

Commit

Permalink
enable GMC helm installation test in CI (#250)
Browse files Browse the repository at this point in the history
Signed-off-by: Yingchun Guo <[email protected]>
  • Loading branch information
daisy-ycguo authored Aug 1, 2024
1 parent af47b3c commit 497ff61
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 0 deletions.
84 changes: 84 additions & 0 deletions .github/workflows/gmc-helm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

name: GMC Helm Installation Test on Xeon

on:
pull_request:
branches: [main]
types: [opened, reopened, ready_for_review, synchronize] # added `ready_for_review` since draft is skipped
paths:
- manifests/common/**
- microservices-connector/config/crd/bases/gmc.opea.io_gmconnectors.yaml
- microservices-connector/config/gmcrouter/gmc-router.yaml
- microservices-connector/helm/**
- "!**.md"
- "!**.txt"
- "!**.png"
workflow_dispatch:

# If there is a new commit, the previous jobs will be canceled
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-xeon
cancel-in-progress: true

env:
GOSRC_DIR: "microservices-connector"

jobs:
image-build:
uses: ./.github/workflows/reuse-gmc-image-build.yaml
with:
image_tag: ${{ github.event.pull_request.head.sha }}
runner_label: 'docker-build-xeon'

go-e2e:
runs-on: kind-xeon
needs: image-build
steps:
- name: Checkout out Repo
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set variables
run: |
echo "RELEASE_NAME=gmc$(date +%Y%m%d%H%M%S)" >> $GITHUB_ENV
echo "SYSTEM_NAMESPACE=opea-system-helm" >> $GITHUB_ENV
echo "APP_NAMESPACE=opea-app" >> $GITHUB_ENV
echo "DOCKER_REGISTRY=${{ needs.image-build.outputs.image_repo }}" >> $GITHUB_ENV
echo "VERSION=${{ needs.image-build.outputs.image_tag }}" >> $GITHUB_ENV
echo "should_cleanup=false" >> $GITHUB_ENV
echo "skip_validate=false" >> $GITHUB_ENV
echo "KIND_MOUNT_DIR=/mnt/huggingface/hub" >> $GITHUB_ENV
echo "ROLLOUT_TIMEOUT_SECONDS=600s" >> $GITHUB_ENV
- name: Install GMC
run: |
echo "should_cleanup=true" >> $GITHUB_ENV
## IMPORTANT NOTICE: need to replace gmc images with {{env.DOCKER_REGISTRY}} and {{env.VERSION}}
cd microservices-connector
if ! helm install --create-namespace --namespace {{ env.SYSTEM_NAMESPACE}} --wait \
--timeout "$ROLLOUT_TIMEOUT_SECONDS" \
$RELEASE_NAME helm ; then
echo "Failed to install GMC by helm"
echo "skip_validate=true" >> $GITHUB_ENV
.github/workflows/scripts/e2e/chart_test.sh dump_pods_status {{ env.SYSTEM_NAMESPACE}}
exit 1
fi
- name: Run e2e tests
run: |
if $skip_validate; then
echo "Skip validate"
else
.github/workflows/scripts/e2e/gmc_xeon_test.sh validate_gmc
fi
- name: Cleanup modules
if: always()
run: |
if $should_cleanup; then
.github/workflows/scripts/e2e/gmc_xeon_test.sh cleanup_apps
helm uninstall $RELEASE_NAME --namespace {{ env.SYSTEM_NAMESPACE}}
fi
1 change: 1 addition & 0 deletions .github/workflows/gmc-on-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
paths:
- microservices-connector/**
- manifests/common/**
- "!microservices-connector/helm/**"
- "!**.md"
- "!**.txt"
- "!**.png"
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/go-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ on:
paths:
- microservices-connector/**
- manifests/common/**
- "!microservices-connector/helm/**"
- "!**.md"
- "!**.txt"
- "!**.png"
- .github/workflows/scripts/e2e/gmc_xeon_test.sh
workflow_dispatch:

Expand Down

0 comments on commit 497ff61

Please sign in to comment.