ci: Enhance the GHA #11
Workflow file for this run
This file contains hidden or 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
name: CentralDashboard-Angular Integration Test | |
on: | |
pull_request: | |
paths: | |
- components/centraldashboard-angular/** | |
- releasing/version/VERSION | |
- .github/workflows/centraldb_angular_integration_test.yaml | |
branches: | |
- main | |
- v*-branch | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event.number }} | |
cancel-in-progress: true | |
env: | |
IMG: ghcr.io/kubeflow/kubeflow/centraldashboard-angular | |
TAG: integration-test | |
jobs: | |
integration-test: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install KinD | |
run: ./testing/gh-actions/install_kind.sh | |
- name: Create KinD Cluster | |
run: kind create cluster --config testing/gh-actions/kind-1-25.yaml | |
- name: Install kustomize | |
run: ./testing/gh-actions/install_kustomize.sh | |
- name: Install Istio | |
run: ./testing/gh-actions/install_istio.sh | |
- name: Create Kubeflow Namespace | |
run: kubectl create namespace kubeflow | |
- name: Make Scripts Executable | |
run: chmod +x testing/gh-actions/*.sh | |
- name: Deploy CentralDashboard-Angular Component | |
run: | | |
cd components/centraldashboard-angular | |
if [ -f "Makefile" ]; then | |
if grep -q "docker-build-multi-arch" Makefile; then | |
make docker-build-multi-arch IMG="${IMG}" TAG="${TAG}" | |
else | |
make docker-build IMG="${IMG}" TAG="${TAG}" | |
fi | |
fi | |
kind load docker-image "${IMG}:${TAG}" | |
cd manifests | |
export CD_NAMESPACE=kubeflow | |
export CD_CLUSTER_DOMAIN=cluster.local | |
export CURRENT_IMAGE="${IMG}" | |
export PR_IMAGE="${IMG}:${TAG}" | |
export CURRENT_IMAGE_ESCAPED=$(echo "$CURRENT_IMAGE" | sed 's|\.|\\.|g') | |
export PR_IMAGE_ESCAPED=$(echo "$PR_IMAGE" | sed 's|\.|\\.|g') | |
kustomize build overlays/kserve \ | |
| sed "s|${CURRENT_IMAGE_ESCAPED}:[a-zA-Z0-9_.-]*|${PR_IMAGE_ESCAPED}|g" \ | |
| sed "s|\$(CD_NAMESPACE)|${CD_NAMESPACE}|g" \ | |
| sed "s|\$(CD_CLUSTER_DOMAIN)|${CD_CLUSTER_DOMAIN}|g" \ | |
| kubectl apply -f - | |
- name: Wait for CentralDashboard-Angular to be Ready | |
run: | | |
kubectl wait --for=condition=Ready pods -n kubeflow -l app=centraldashboard-angular --timeout=300s | |
kubectl wait --for=condition=Available deployment -n kubeflow centraldashboard-angular --timeout=300s | |
- name: Validate Service | |
run: | | |
./testing/gh-actions/test_service.sh validate-service centraldashboard-angular kubeflow | |
- name: Start Port Forward for Dashboard Testing | |
run: | | |
./testing/gh-actions/test_service.sh port-forward centraldashboard-angular kubeflow 8080 80 | |
- name: Test Dashboard Health | |
run: | | |
./testing/gh-actions/test_service.sh test-health centraldashboard-angular kubeflow 8080 | |
- name: Test Dashboard Web Interface | |
run: | | |
curl -f "http://localhost:8080/" >/dev/null 2>&1 | |
curl -f "http://localhost:8080/healthz" >/dev/null 2>&1 | |
RESPONSE=$(curl -s "http://localhost:8080/" | head -c 100) | |
if [[ -n "$RESPONSE" ]]; then | |
echo "Dashboard is serving content: ${RESPONSE:0:50}..." | |
else | |
echo "Dashboard is not serving content" | |
exit 1 | |
fi | |
kubectl get service centraldashboard-angular -n kubeflow | |
kubectl get pods -n kubeflow -l app=centraldashboard-angular | |
- name: Test Dashboard Performance | |
run: | | |
./testing/gh-actions/test_service.sh performance-test centraldashboard-angular kubeflow 8080 80 8 | |
- name: Test Dashboard Metrics | |
run: | | |
./testing/gh-actions/test_service.sh test-metrics centraldashboard-angular kubeflow 8080 | |
- name: Check Dashboard Logs | |
run: | | |
./testing/gh-actions/test_service.sh check-logs centraldashboard-angular kubeflow 50 | |
- name: Check for Errors in Logs | |
run: | | |
./testing/gh-actions/test_service.sh check-errors centraldashboard-angular kubeflow | |
- name: Stop Port Forward | |
run: | | |
./testing/gh-actions/test_service.sh stop-port-forward centraldashboard-angular kubeflow 8080 |