-
Notifications
You must be signed in to change notification settings - Fork 950
feat(ci): add comprehensive Helm integration tests with JobSet dependency fix #2783
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 9 commits
d3a73f3
eb623e7
ca6d760
b356099
50fbeac
716a0f9
519e66b
00360b8
6fa4375
4c76c56
5c02086
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| --- | ||
| # Chart testing configuration for kubeflow-trainer | ||
|
|
||
| # Directories containing charts to test | ||
| chart-dirs: | ||
| - charts | ||
|
|
||
| # Charts to exclude from testing (if any) | ||
| excluded-charts: [] | ||
|
|
||
| # Target branch for comparison (used for detecting changes) | ||
| target-branch: main | ||
|
|
||
| # Remote repository for comparison | ||
| remote: origin | ||
|
|
||
| # Version increment checking | ||
| # Set to false for initial setup, enable later for strict versioning | ||
| check-version-increment: false | ||
|
|
||
| # Schema validation settings | ||
| validate-chart-schema: true | ||
| validate-maintainers: true | ||
| validate-yaml: true | ||
|
|
||
| # Helm configuration - increase timeout for slow installations | ||
| helm-extra-args: --timeout 600s --wait --debug | ||
|
|
||
| # Helm extra set args for testing | ||
| # Note: jobset.install=false because we install JobSet manually | ||
| helm-extra-set-args: --set=jobset.install=false --set=replicaCount=1 --set=image.pullPolicy=IfNotPresent --set=resources.limits.cpu=100m --set=resources.limits.memory=128Mi | ||
|
|
||
| # Debug settings | ||
| debug: true | ||
|
|
||
| # Skip cleanup after testing for debugging (will be cleaned up in workflow) | ||
| skip-clean-up: true | ||
|
|
||
| # Test upgrades (install chart, then upgrade) | ||
| upgrade: false | ||
|
|
||
| # Print config for debugging | ||
| print-config: true | ||
|
|
||
| # Skip dependency build since we handle JobSet manually | ||
| helm-dependency-extra-args: --skip-refresh | ||
|
|
||
| # Test configuration with increased verbosity | ||
| test-extra-args: --logs --debug | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,195 @@ | ||||||||||||||||||||||||||
| --- | ||||||||||||||||||||||||||
| name: Unit and Integration Test - Helm | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||
| pull_request: | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||
| generate: | ||||||||||||||||||||||||||
| name: Generate | ||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||
| - name: Checkout Code | ||||||||||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||
| fetch-depth: 0 | ||||||||||||||||||||||||||
|
ombhojane marked this conversation as resolved.
Outdated
|
||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| - name: Set up Helm | ||||||||||||||||||||||||||
| uses: azure/setup-helm@v4 | ||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||
| version: 'latest' | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| - name: Run make generate | ||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||
| if make help 2>/dev/null | grep -q "generate"; then | ||||||||||||||||||||||||||
| make generate | ||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||
| echo "No generate target found, skipping..." | ||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| - name: Run make helm-unittest | ||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||
| if make help 2>/dev/null | grep -q "helm-unittest"; then | ||||||||||||||||||||||||||
| make helm-unittest | ||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||
| echo "No helm-unittest target found, skipping..." | ||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||
|
ombhojane marked this conversation as resolved.
Outdated
|
||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| test: | ||||||||||||||||||||||||||
| name: Test | ||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||
| needs: generate | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||
| - name: Checkout Code | ||||||||||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||
| fetch-depth: 0 | ||||||||||||||||||||||||||
|
ombhojane marked this conversation as resolved.
Outdated
|
||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| - name: Set up Helm | ||||||||||||||||||||||||||
| uses: azure/setup-helm@v4 | ||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||
| version: 'latest' | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| - name: Set up chart-testing | ||||||||||||||||||||||||||
| uses: helm/chart-testing-action@v2.7.0 | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| - name: Set up Kind | ||||||||||||||||||||||||||
| uses: helm/kind-action@v1.10.0 | ||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||
| cluster_name: chart-testing | ||||||||||||||||||||||||||
| wait: 300s | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| - name: Run chart-testing (lint) | ||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||
| ct lint \ | ||||||||||||||||||||||||||
| --config .github/ct.yaml \ | ||||||||||||||||||||||||||
| --all \ | ||||||||||||||||||||||||||
| --debug | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| - name: Install JobSet dependency manually | ||||||||||||||||||||||||||
|
ombhojane marked this conversation as resolved.
Outdated
|
||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||
| JOBSET_VERSION="v0.8.1" | ||||||||||||||||||||||||||
| echo "Installing JobSet $JOBSET_VERSION..." | ||||||||||||||||||||||||||
| helm install jobset oci://registry.k8s.io/jobset/charts/jobset \ | ||||||||||||||||||||||||||
| --version $JOBSET_VERSION \ | ||||||||||||||||||||||||||
| --create-namespace \ | ||||||||||||||||||||||||||
| --namespace=jobset-system \ | ||||||||||||||||||||||||||
| --wait \ | ||||||||||||||||||||||||||
| --timeout=300s | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| echo "JobSet installed successfully" | ||||||||||||||||||||||||||
| kubectl get pods -n jobset-system | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| # Wait for JobSet to be ready | ||||||||||||||||||||||||||
| kubectl wait --for=condition=ready pod -l app.kubernetes.io/name=jobset --timeout=300s -n jobset-system | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| - name: Create test values file for chart testing | ||||||||||||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we leverage the I think, the steps are similar, and we should just deploy it with Helm Charts instead of Kustomize manifests.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree with @andreyvelich this should ideally not be duplicated.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. resolved!
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. leveraged e2e-setup-cluster-helm.sh
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ombhojane As I can see, you still build and load images as part of your trainer/hack/e2e-setup-cluster.sh Lines 43 to 54 in 5c02086
In that case, you don't need to maintain separate script just for Helm deployment. |
||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||
| mkdir -p charts/kubeflow-trainer/ci | ||||||||||||||||||||||||||
| cat > charts/kubeflow-trainer/ci/ci-values.yaml << 'EOF' | ||||||||||||||||||||||||||
| # CI-specific values for chart testing | ||||||||||||||||||||||||||
| replicaCount: 1 | ||||||||||||||||||||||||||
| image: | ||||||||||||||||||||||||||
| pullPolicy: IfNotPresent | ||||||||||||||||||||||||||
| jobset: | ||||||||||||||||||||||||||
| install: false # We install JobSet manually | ||||||||||||||||||||||||||
| resources: | ||||||||||||||||||||||||||
| limits: | ||||||||||||||||||||||||||
| cpu: 100m | ||||||||||||||||||||||||||
| memory: 128Mi | ||||||||||||||||||||||||||
| requests: | ||||||||||||||||||||||||||
| cpu: 50m | ||||||||||||||||||||||||||
| memory: 64Mi | ||||||||||||||||||||||||||
| # Minimal configuration for testing | ||||||||||||||||||||||||||
| controller: | ||||||||||||||||||||||||||
| replicas: 1 | ||||||||||||||||||||||||||
|
ombhojane marked this conversation as resolved.
Outdated
|
||||||||||||||||||||||||||
| EOF | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| - name: Run chart-testing (install) with better error handling | ||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||
| set -e | ||||||||||||||||||||||||||
| echo "Starting chart installation tests..." | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| # Run with more verbose output and longer timeout | ||||||||||||||||||||||||||
| ct install \ | ||||||||||||||||||||||||||
| --config .github/ct.yaml \ | ||||||||||||||||||||||||||
| --all \ | ||||||||||||||||||||||||||
| --debug \ | ||||||||||||||||||||||||||
| --helm-extra-args "--timeout=600s --debug" \ | ||||||||||||||||||||||||||
| --skip-clean-up || { | ||||||||||||||||||||||||||
| echo "Chart testing failed, checking cluster state..." | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| echo "=== Cluster Nodes ===" | ||||||||||||||||||||||||||
| kubectl get nodes -o wide || true | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| echo "=== All Namespaces ===" | ||||||||||||||||||||||||||
| kubectl get namespaces || true | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| echo "=== All Pods ===" | ||||||||||||||||||||||||||
| kubectl get pods --all-namespaces -o wide || true | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| echo "=== Events ===" | ||||||||||||||||||||||||||
| kubectl get events --all-namespaces --sort-by='.lastTimestamp' || true | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| echo "=== Helm Releases ===" | ||||||||||||||||||||||||||
| helm list --all-namespaces || true | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| # Still exit with error | ||||||||||||||||||||||||||
| exit 1 | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| - name: Verify Helm installation | ||||||||||||||||||||||||||
| if: success() | ||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||
| echo "=== Cluster Status ===" | ||||||||||||||||||||||||||
| kubectl get nodes -o wide | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| echo "=== Namespaces ===" | ||||||||||||||||||||||||||
| kubectl get namespaces | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| echo "=== All Pods ===" | ||||||||||||||||||||||||||
| kubectl get pods --all-namespaces -o wide | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| echo "=== Training Operator Pods ===" | ||||||||||||||||||||||||||
| kubectl get pods --all-namespaces \ | ||||||||||||||||||||||||||
| -l app.kubernetes.io/name=kubeflow-trainer || true | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| echo "=== JobSet Pods ===" | ||||||||||||||||||||||||||
| kubectl get pods -n jobset-system || true | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| echo "=== Services ===" | ||||||||||||||||||||||||||
| kubectl get svc --all-namespaces | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| echo "=== CRDs ===" | ||||||||||||||||||||||||||
| kubectl get crd | grep -E "(training|jobset)" || \ | ||||||||||||||||||||||||||
| echo "No training/jobset CRDs found" | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| echo "=== Helm Releases ===" | ||||||||||||||||||||||||||
| helm list --all-namespaces | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| - name: Run basic functionality tests | ||||||||||||||||||||||||||
|
ombhojane marked this conversation as resolved.
Outdated
|
||||||||||||||||||||||||||
| if: success() | ||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||
| echo "=== Chart Testing Completed Successfully ===" | ||||||||||||||||||||||||||
| echo "The chart has been installed, tested, and validated by chart-testing tool." | ||||||||||||||||||||||||||
| echo "All components are running properly as shown in the verification step above." | ||||||||||||||||||||||||||
| echo "Chart validation successful!" | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| - name: Cleanup | ||||||||||||||||||||||||||
| if: always() | ||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||
| echo "Cleaning up resources..." | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| # Clean up any helm releases first | ||||||||||||||||||||||||||
| helm list --all-namespaces -q | xargs -I {} helm uninstall {} --ignore-not-found || true | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| # Clean up namespaces | ||||||||||||||||||||||||||
| kubectl delete namespace kubeflow-system \ | ||||||||||||||||||||||||||
| --ignore-not-found=true --timeout=60s || true | ||||||||||||||||||||||||||
| kubectl delete namespace jobset-system \ | ||||||||||||||||||||||||||
| --ignore-not-found=true --timeout=60s || true | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| # Clean up any remaining test namespaces | ||||||||||||||||||||||||||
| kubectl get namespaces -o name | grep -E "(kubeflow-trainer|test-)" | xargs kubectl delete --timeout=60s || true | ||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| FROM python:3.11-alpine | ||
| FROM python:3.11-slim-bookworm | ||
|
|
||
| WORKDIR /app | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.