Run e2e DRA tests on branch #13
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: Run e2e DRA tests on branch | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| branch: | |
| description: 'Branch to checkout' | |
| required: true | |
| default: 'main' | |
| k8sversion: | |
| description: 'Kubernetes version' | |
| required: true | |
| default: '1.34' | |
| env: | |
| VERSION: ${{ github.event.inputs.k8sversion }} | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout selected branch | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.inputs.branch }} | |
| - name: Set up for integration test | |
| run: | | |
| ./hack/install-etcd.sh | |
| echo "PATH=$(pwd)/third_party/etcd:$PATH" >> $GITHUB_ENV | |
| ulimit -n 1200 | |
| - name: Show containerd default cgroup driver | |
| run: | | |
| sudo ctr version | |
| sudo cat /etc/containerd/config.toml | grep systemd || echo "no systemd driver found" | |
| - name: Configure containerd to use cgroupfs and cdi | |
| run: | | |
| # Generate default config if missing | |
| sudo mkdir -p /etc/containerd | |
| sudo containerd config default | sudo tee /etc/containerd/config.toml > /dev/null | |
| # Update containerd paths | |
| sudo sed -ie 's|root = "/var/lib/containerd"|root = "/docker-graph/containerd/daemon"|' /etc/containerd/config.toml | |
| sudo sed -ie 's|state = "/run/containerd"|state = "/var/run/docker/containerd/daemon"|' /etc/containerd/config.toml | |
| # Use cgroupfs instead of systemd | |
| sudo sed -ie 's/SystemdCgroup = true/SystemdCgroup = false/' /etc/containerd/config.toml | |
| # Enable CDI | |
| sudo sed -ie 's|enable_cdi = false|enable_cdi = true|' /etc/containerd/config.toml | |
| # Restart containerd to apply the changes | |
| sudo systemctl restart containerd | |
| - name: Install CNI plugins | |
| run: | | |
| CNI_VERSION=v1.5.0 | |
| sudo mkdir -p /opt/cni/bin | |
| wget -q https://github.com/containernetworking/plugins/releases/download/${CNI_VERSION}/cni-plugins-linux-amd64-${CNI_VERSION}.tgz -O /tmp/cni.tgz | |
| sudo tar -xzf /tmp/cni.tgz -C /opt/cni/bin | |
| ls /opt/cni/bin | |
| - name: Create CNI configuration | |
| run: | | |
| sudo mkdir -p /etc/cni/net.d | |
| cat <<EOF | sudo tee /etc/cni/net.d/10-bridge.conf | |
| { | |
| "cniVersion": "0.4.0", | |
| "name": "bridge0", | |
| "type": "bridge", | |
| "bridge": "cni0", | |
| "isGateway": true, | |
| "ipMasq": true, | |
| "ipam": { | |
| "type": "host-local", | |
| "ranges": [ | |
| [{"subnet": "10.22.0.0/16"}] | |
| ], | |
| "routes": [{"dst": "0.0.0.0/0"}] | |
| } | |
| } | |
| EOF | |
| cat /etc/cni/net.d/10-bridge.conf | |
| - name: Verify setup | |
| run: | | |
| echo "Verifying etcd installation..." | |
| which etcd | |
| etcd --version | |
| echo "Verifying CNI..." | |
| ls -l /etc/cni/net.d/ | |
| ls -l /opt/cni/bin/ | |
| - name: Build ginkgo | |
| run: | | |
| make ginkgo | |
| - name: Install Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: 1.25.0 | |
| - name: Add Go bin to PATH | |
| run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH | |
| - name: Run test | |
| env: | |
| KUBE_ROOT: /home/runner/work/kubernetes/kubernetes | |
| run: | | |
| make test-e2e-node FOCUS='\[Feature:DynamicResourceAllocation\]' SKIP='\[Flaky\]' PARALLELISM=1 \ | |
| TEST_ARGS='--kubelet-flags=--fail-swap-on=false --feature-gates="DynamicResourceAllocation=true,ResourceHealthStatus=true,DRAConsumableCapacity=true" --service-feature-gates="DynamicResourceAllocation=true,ResourceHealthStatus=true,DRAConsumableCapacity=true" --runtime-config=api/all=true' | |
| - name: Print kubelet logs | |
| if: always() | |
| run: | | |
| for file in /tmp/_artifacts/*/kubelet.log; do | |
| if [ -f "$file" ]; then | |
| echo "=== $file ===" | |
| cat "$file" | |
| echo | |
| fi | |
| done | |
| - name: Print containerd logs | |
| if: always() | |
| run: | | |
| echo "==== Containerd Logs ====" | |
| sudo journalctl -u containerd --no-pager -n 100 |