|
1 | 1 | name: Kind TFT |
2 | 2 |
|
3 | 3 | on: |
| 4 | + workflow_dispatch: |
4 | 5 | pull_request: |
5 | 6 | push: |
6 | 7 | branches: |
7 | 8 | - main |
| 9 | + - ci-change |
8 | 10 |
|
9 | 11 | jobs: |
10 | 12 | kind-tft: |
11 | 13 | strategy: |
12 | | - # Keep every scenario running to completion so we can collect artifacts |
13 | | - # from each leg independently when one fails. |
14 | 14 | fail-fast: false |
15 | 15 | matrix: |
16 | 16 | include: |
17 | 17 | - scenario: full-suite |
18 | | - dpu_sim_config: config-kind.yaml |
| 18 | + dpu_sim_config: ci/config-kind-ovnk-offload.yaml |
| 19 | + tft_config: "" |
| 20 | + tft_env: "" |
19 | 21 | - scenario: diverse-subset |
20 | | - dpu_sim_config: config-kind.yaml |
21 | | - tft_log_preamble: "false" |
| 22 | + dpu_sim_config: ci/config-kind.yaml |
| 23 | + tft_config: .github/tft-configs/diverse-subset.yaml |
| 24 | + tft_env: | |
| 25 | + TFT_LOG_PREAMBLE=false |
22 | 26 | - scenario: resource-limits |
23 | | - dpu_sim_config: config-kind.yaml |
24 | | - - scenario: dpu-offload |
25 | | - dpu_sim_config: config-kind-ovnk-offload.yaml |
26 | | - runs-on: ubuntu-latest |
27 | | - timeout-minutes: 180 |
28 | | - # Job-level concurrency so matrix.scenario is in scope; workflow-level |
29 | | - # concurrency cannot reference matrix.* expressions. |
| 27 | + dpu_sim_config: ci/config-kind-ovnk-offload.yaml |
| 28 | + tft_config: .github/tft-configs/resource-limits.yaml |
| 29 | + tft_env: "" |
30 | 30 | concurrency: |
31 | 31 | group: kind-tft-${{ matrix.scenario }}-${{ github.ref }} |
32 | 32 | cancel-in-progress: true |
33 | | - steps: |
34 | | - - name: Checkout ovn-k8s-traffic-flow-tests |
35 | | - uses: actions/checkout@v4 |
36 | | - |
37 | | - - name: Checkout dpu-simulator |
38 | | - uses: actions/checkout@v4 |
39 | | - with: |
40 | | - repository: ovn-kubernetes/dpu-simulator |
41 | | - ref: main |
42 | | - path: dpu-simulator |
43 | | - |
44 | | - - name: Checkout OVN-Kubernetes (master) |
45 | | - uses: actions/checkout@v4 |
46 | | - with: |
47 | | - repository: ovn-org/ovn-kubernetes |
48 | | - ref: master |
49 | | - path: dpu-simulator/ovn-kubernetes |
50 | | - |
51 | | - - name: Set up Go |
52 | | - uses: actions/setup-go@v5 |
53 | | - with: |
54 | | - go-version-file: dpu-simulator/go.mod |
55 | | - cache: true |
56 | | - |
57 | | - - name: Install libvirt development headers |
58 | | - run: sudo apt-get update && sudo apt-get install -y libvirt-dev |
59 | | - |
60 | | - - name: Install Helm |
61 | | - uses: azure/setup-helm@v4 |
62 | | - |
63 | | - - name: Set up Python for traffic flow tests |
64 | | - uses: actions/setup-python@v5 |
65 | | - with: |
66 | | - python-version: "3.12" |
67 | | - |
68 | | - - name: Install kind |
69 | | - run: | |
70 | | - KIND_VERSION=v0.31.0 |
71 | | - curl -fsSLo /tmp/kind-linux-amd64 "https://kind.sigs.k8s.io/dl/${KIND_VERSION}/kind-linux-amd64" |
72 | | - curl -fsSLo /tmp/kind-linux-amd64.sha256sum "https://kind.sigs.k8s.io/dl/${KIND_VERSION}/kind-linux-amd64.sha256sum" |
73 | | - (cd /tmp && sha256sum -c kind-linux-amd64.sha256sum) |
74 | | - chmod +x /tmp/kind-linux-amd64 |
75 | | - sudo mv /tmp/kind-linux-amd64 /usr/local/bin/kind |
76 | | -
|
77 | | - - name: Build dpu-sim |
78 | | - working-directory: dpu-simulator |
79 | | - run: make build |
80 | | - |
81 | | - - name: Disable containerd image store |
82 | | - # Workaround for https://github.com/kubernetes-sigs/kind/issues/3795 |
83 | | - run: | |
84 | | - sudo mkdir -p /etc/docker |
85 | | - [ -s "/etc/docker/daemon.json" ] && { |
86 | | - cat "/etc/docker/daemon.json" | jq '. + {"features":{"containerd-snapshotter": false}}' | sudo tee /etc/docker/daemon.$$ |
87 | | - } || { |
88 | | - echo '{"features":{"containerd-snapshotter": false}}' | sudo tee /etc/docker/daemon.$$ |
89 | | - } |
90 | | - sudo mv -f /etc/docker/daemon.$$ /etc/docker/daemon.json |
91 | | - sudo systemctl restart docker |
92 | | -
|
93 | | - - name: Deploy KIND cluster |
94 | | - working-directory: dpu-simulator |
95 | | - run: ./bin/dpu-sim --config ${{ matrix.dpu_sim_config }} |
96 | | - |
97 | | - - name: Verify clusters are ready |
98 | | - working-directory: dpu-simulator |
99 | | - run: | |
100 | | - kubectl wait --for=condition=Ready nodes --all \ |
101 | | - --kubeconfig kubeconfig/dpu-sim-host.kubeconfig --timeout=25m |
102 | | - kubectl wait --for=condition=Ready nodes --all \ |
103 | | - --kubeconfig kubeconfig/dpu-sim-dpu.kubeconfig --timeout=25m |
104 | | -
|
105 | | - - name: TFT Python venv |
106 | | - working-directory: dpu-simulator |
107 | | - run: ./bin/dpu-sim tft venv --config ${{ matrix.dpu_sim_config }} --tft-repo-path "$GITHUB_WORKSPACE" |
108 | | - |
109 | | - - name: Run traffic flow tests |
110 | | - working-directory: dpu-simulator |
111 | | - env: |
112 | | - TFT_KUBECONFIG: ${{ github.workspace }}/dpu-simulator/kubeconfig/dpu-sim-host.kubeconfig |
113 | | - TFT_LOG_PREAMBLE: ${{ matrix.tft_log_preamble }} |
114 | | - run: | |
115 | | - ./bin/dpu-sim tft run \ |
116 | | - --config ${{ matrix.dpu_sim_config }} \ |
117 | | - --tft-repo-path "$GITHUB_WORKSPACE" \ |
118 | | - --tft-config "$GITHUB_WORKSPACE/.github/tft-configs/${{ matrix.scenario }}.yaml" \ |
119 | | - --check |
120 | | -
|
121 | | - - name: Export kind logs on failure |
122 | | - if: failure() |
123 | | - run: | |
124 | | - kind export logs /tmp/kind-tft-logs --name dpu-sim-host 2>/dev/null || true |
125 | | - kind export logs /tmp/kind-tft-logs --name dpu-sim-dpu 2>/dev/null || true |
126 | | -
|
127 | | - - name: Upload kind logs on failure |
128 | | - if: failure() |
129 | | - uses: actions/upload-artifact@v4 |
130 | | - with: |
131 | | - name: kind-tft-${{ matrix.scenario }}-kind-logs |
132 | | - path: /tmp/kind-tft-logs |
133 | | - if-no-files-found: ignore |
134 | | - |
135 | | - - name: Upload TFT results on failure |
136 | | - if: failure() |
137 | | - uses: actions/upload-artifact@v4 |
138 | | - with: |
139 | | - name: kind-tft-${{ matrix.scenario }}-ft-logs |
140 | | - path: ft-logs |
141 | | - if-no-files-found: ignore |
142 | | - |
143 | | - - name: Cleanup |
144 | | - if: always() |
145 | | - working-directory: dpu-simulator |
146 | | - run: ./bin/dpu-sim --config ${{ matrix.dpu_sim_config }} --cleanup || true |
| 33 | + uses: ovn-kubernetes/dpu-simulator/.github/workflows/kind-tft.yml@main |
| 34 | + with: |
| 35 | + config: ${{ matrix.dpu_sim_config }} |
| 36 | + tft-config: ${{ matrix.tft_config }} |
| 37 | + tft-env: ${{ matrix.tft_env }} |
| 38 | + tft-repo-url: https://github.com/${{ github.event.pull_request.head.repo.full_name || github.repository }} |
| 39 | + tft-ref: ${{ github.event.pull_request.head.sha || github.sha }} |
| 40 | + artifact-prefix: kind-tft-${{ matrix.scenario }} |
0 commit comments