|
| 1 | +# Copyright 2026 Google LLC |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +name: helm-e2e |
| 16 | +on: |
| 17 | + pull_request: |
| 18 | + push: |
| 19 | + branches: [main] |
| 20 | +permissions: |
| 21 | + contents: read |
| 22 | +jobs: |
| 23 | + e2e-test: |
| 24 | + runs-on: ubuntu-latest |
| 25 | + steps: |
| 26 | + - name: Checkout |
| 27 | + uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0 |
| 28 | + - name: Setup Go |
| 29 | + uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0 |
| 30 | + with: |
| 31 | + go-version-file: go.mod |
| 32 | + - name: Setup Helm |
| 33 | + uses: azure/setup-helm@v4 |
| 34 | + - name: Cache micro-VM assets |
| 35 | + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 |
| 36 | + with: |
| 37 | + path: bin/microvm-assets/amd64 |
| 38 | + key: microvm-assets-amd64-${{ hashFiles('hack/microvm-assets/assemble.sh') }} |
| 39 | + - name: Enable KVM |
| 40 | + run: | |
| 41 | + echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' \ |
| 42 | + | sudo tee /etc/udev/rules.d/99-kvm4all.rules |
| 43 | + sudo udevadm control --reload-rules |
| 44 | + sudo udevadm trigger --name-match=kvm |
| 45 | + - name: Create cluster |
| 46 | + run: hack/create-kind-cluster.sh |
| 47 | + - name: Install observability fixtures |
| 48 | + run: | |
| 49 | + kubectl apply -f manifests/ate-install/kind/otel-collector.yaml |
| 50 | + kubectl apply -f manifests/ate-install/kind/prometheus.yaml |
| 51 | + - name: Build chart images |
| 52 | + run: | |
| 53 | + for component in ateapi atecontroller atelet podcertcontroller atenet; do |
| 54 | + KO_DOCKER_REPO="localhost:5001/${component}" \ |
| 55 | + ./hack/run-tool.sh ko build --bare --tags helm-e2e \ |
| 56 | + --platform linux/amd64 "./cmd/${component}" |
| 57 | + done |
| 58 | + - name: Install Agent Substrate with Helm |
| 59 | + run: | |
| 60 | + helm upgrade --install substrate-crds charts/substrate-crds |
| 61 | + helm upgrade --install substrate charts/substrate \ |
| 62 | + --namespace ate-system \ |
| 63 | + --create-namespace \ |
| 64 | + --set image.registry=localhost:5001 \ |
| 65 | + --set image.tag=helm-e2e \ |
| 66 | + --set 'atelet.extraArgs[0]=--localhost-registry-replacement=kind-registry:5000' \ |
| 67 | + --set otel.endpoint=http://opentelemetry-collector.otel-system.svc:4317 \ |
| 68 | + --set postgres.resources.requests.cpu=500m |
| 69 | + - name: Bootstrap mTLS authorities |
| 70 | + run: | |
| 71 | + hack/install-ate-kind.sh --create-podcertificate-controller-cas |
| 72 | + hack/install-ate-kind.sh --create-jwt-authority-pool-secret |
| 73 | + hack/install-ate-kind.sh --create-actor-id-ca-pool-secret |
| 74 | + hack/install-ate-kind.sh --create-actor-id-ca-certs-secret |
| 75 | + hack/install-ate-kind.sh --create-api-authentication-config |
| 76 | + - name: Wait for Helm install |
| 77 | + run: | |
| 78 | + helm upgrade substrate charts/substrate \ |
| 79 | + --namespace ate-system \ |
| 80 | + --reuse-values \ |
| 81 | + --wait --timeout=10m |
| 82 | + - name: Deploy egress gateway fixture |
| 83 | + env: |
| 84 | + KO_DOCKER_REPO: localhost:5001 |
| 85 | + KO_DEFAULTPLATFORMS: linux/amd64 |
| 86 | + run: | |
| 87 | + ./hack/run-tool.sh ko apply -f manifests/ate-install/atenet-egress.yaml -- --context=kind-kind |
| 88 | + kubectl --context kind-kind rollout status deployment/atenet-egress -n ate-system --timeout=120s |
| 89 | + - name: Deploy micro-VM counter demo |
| 90 | + run: hack/run-microvm-demo-kind.sh --skip-control-plane |
| 91 | + - name: Deploy gVisor counter demo |
| 92 | + run: hack/install-ate-kind.sh --deploy-demo-counter |
| 93 | + - name: Deploy egress demo |
| 94 | + run: hack/install-ate-kind.sh --deploy-demo-egress |
| 95 | + - name: Wait for micro-VM golden snapshot |
| 96 | + run: | |
| 97 | + kubectl --context kind-kind wait --for=condition=Ready \ |
| 98 | + actortemplate/counter-microvm -n ate-demo-counter-microvm --timeout=600s |
| 99 | + - name: Run E2E tests (gVisor) |
| 100 | + run: hack/run-e2e-kind.sh -v -args --no-color |
| 101 | + - name: Run E2E tests (micro-VM) |
| 102 | + env: |
| 103 | + E2E_TEMPLATE_NAMESPACE: ate-demo-counter-microvm |
| 104 | + E2E_TEMPLATE_NAME: counter-microvm |
| 105 | + E2E_TEMPLATE_READY_TIMEOUT: 600s |
| 106 | + run: hack/run-e2e-kind.sh ./internal/e2e/suites/demo -v -args --no-color |
| 107 | + - name: Dump diagnostics on failure |
| 108 | + if: failure() |
| 109 | + run: | |
| 110 | + kubectl --context kind-kind get actortemplate,workerpool,pods -A -o wide || true |
| 111 | + for p in $(kubectl --context kind-kind get pods -n ate-system -o name 2>/dev/null); do |
| 112 | + echo "=== logs: ate-system/${p} ===" |
| 113 | + kubectl --context kind-kind logs -n ate-system "$p" --all-containers --tail=300 || true |
| 114 | + done |
0 commit comments