|
| 1 | +name: e2e |
| 2 | +on: |
| 3 | + pull_request: |
| 4 | + branches: [main] |
| 5 | + push: |
| 6 | + branches: [main] |
| 7 | +concurrency: |
| 8 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 9 | + cancel-in-progress: true |
| 10 | + |
| 11 | +env: |
| 12 | + KIND_VERSION: v0.32.0 |
| 13 | + IMAGE: ghcr.io/converged-computing/fluence:latest |
| 14 | + |
| 15 | +jobs: |
| 16 | + e2e: |
| 17 | + runs-on: ubuntu-latest |
| 18 | + steps: |
| 19 | + - name: Checkout |
| 20 | + uses: actions/checkout@v4 |
| 21 | + |
| 22 | + #- name: Set up Docker Buildx |
| 23 | + # uses: docker/setup-buildx-action@v3 |
| 24 | + |
| 25 | + # - name: Build fluence image |
| 26 | + # uses: docker/build-push-action@v6 |
| 27 | + # with: |
| 28 | + # context: . |
| 29 | + # file: ./Dockerfile |
| 30 | + # push: false |
| 31 | + # load: true |
| 32 | + # tags: ${{ env.IMAGE }} |
| 33 | + # cache-from: type=gha |
| 34 | + # cache-to: type=gha,mode=max |
| 35 | + - name: Create k8s Kind Cluster |
| 36 | + uses: helm/kind-action@v1.10.0 |
| 37 | + with: |
| 38 | + version: v0.32.0 # Define your custom KinD CLI version here |
| 39 | + node_image: kindest/node:v1.36.1 |
| 40 | + config: ./deploy/kind-config.yaml |
| 41 | + |
| 42 | + - name: Free Disk Space (Ubuntu) |
| 43 | + run: | |
| 44 | + echo "=== Disk space before cleanup ===" |
| 45 | + df -h |
| 46 | + |
| 47 | + # Remove large software runtimes and tools |
| 48 | + sudo rm -rf /usr/share/dotnet |
| 49 | + sudo rm -rf /usr/local/lib/android |
| 50 | + sudo rm -rf /opt/ghc |
| 51 | + sudo rm -rf /opt/hostedtoolcache/CodeQL |
| 52 | + |
| 53 | + # Clean package caches |
| 54 | + sudo apt-get clean |
| 55 | + echo "=== Disk space after cleanup ===" |
| 56 | + df -h |
| 57 | +
|
| 58 | + - name: Deploy fluence (base) |
| 59 | + run: | |
| 60 | + kubectl apply -f deploy/fluence-test.yaml |
| 61 | + kubectl rollout status -n kube-system deployment/fluence --timeout=180s |
| 62 | + POD=$(kubectl -n kube-system get pods -l app=fluence -o name | head -1) |
| 63 | + kubectl -n kube-system exec "${POD#pod/}" -- ls /tmp/ |
| 64 | + kubectl -n kube-system logs "${POD#pod/}" |
| 65 | + kubectl -n kube-system exec "${POD#pod/}" -- /bin/bash -c "cat /tmp/fluence-graph-*.json" |
| 66 | + kubectl get nodes -o jsonpath='{range .items[*]}{.metadata.name}{": cpu="}{.status.allocatable.cpu}{" mem="}{.status.allocatable.memory}{"\n"}{end}' |
| 67 | + |
| 68 | + - name: E2E - classical gang |
| 69 | + run: bash test/e2e/01-classical-gang.sh |
| 70 | + |
| 71 | + - name: Deploy quantum add-on |
| 72 | + run: | |
| 73 | + # Includes the device plugin and oriented to testing container |
| 74 | + kubectl apply -f deploy/fluence-resources-test.yaml |
| 75 | + kubectl rollout restart -n kube-system deployment/fluence |
| 76 | + kubectl rollout status -n kube-system deployment/fluence --timeout=60s |
| 77 | + for i in $(seq 1 60); do |
| 78 | + kubectl get nodes -o jsonpath='{range .items[*]}{.status.allocatable}{"\n"}{end}' |
| 79 | + kubectl get nodes -o jsonpath='{range .items[*]}{.status.allocatable}{"\n"}{end}' | grep -q 'fluxion.flux-framework.org/qpu' && break |
| 80 | + sleep 1 |
| 81 | + done |
| 82 | + POD=$(kubectl -n kube-system get pods -l app=fluence -o name | head -1) |
| 83 | + kubectl -n kube-system exec "${POD#pod/}" -- /bin/bash -c "cat /tmp/fluence-graph-*.json" |
| 84 | +
|
| 85 | + - name: Wait for webhook |
| 86 | + run: | |
| 87 | +
|
| 88 | + # wait for the deployment AND for the caBundle to be populated on the webhook config |
| 89 | + kubectl -n kube-system rollout status deployment/fluence-webhook --timeout=120s |
| 90 | + for i in $(seq 1 30); do |
| 91 | + cab=$(kubectl get mutatingwebhookconfiguration fluence-webhook \ |
| 92 | + -o jsonpath='{.webhooks[0].clientConfig.caBundle}' 2>/dev/null) |
| 93 | + [ -n "$cab" ] && break |
| 94 | + sleep 2 |
| 95 | + done |
| 96 | + # let TLS serving settle after caBundle patch |
| 97 | + sleep 3 |
| 98 | +
|
| 99 | + - name: E2E - quantum placement |
| 100 | + run: bash test/e2e/02-quantum-placement.sh |
| 101 | + |
| 102 | + #- name: E2E - restart recovery (no double-book) |
| 103 | + # run: bash test/e2e/03-restart-recovery.sh |
| 104 | + |
| 105 | + - name: Dump diagnostics on failure |
| 106 | + if: failure() |
| 107 | + run: | |
| 108 | + kubectl get pods -A -o wide |
| 109 | + kubectl logs -n kube-system deployment/fluence |
0 commit comments