Skip to content

Commit b3f1c09

Browse files
authored
Merge pull request #295 from Venkat-Kunaparaju/actions
Add Kind TFT CI Lanes
2 parents 15596e2 + f2b7064 commit b3f1c09

5 files changed

Lines changed: 262 additions & 0 deletions

File tree

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Test pre_provision=false with iperf-tcp across a diverse subset of test cases.
2+
3+
tft:
4+
- name: "kind-diverse-subset"
5+
namespace: "default"
6+
test_cases:
7+
- POD_TO_POD_SAME_NODE
8+
- POD_TO_POD_DIFF_NODE
9+
- POD_TO_CLUSTER_IP_TO_POD_SAME_NODE
10+
- POD_TO_NODE_PORT_TO_POD_SAME_NODE
11+
- HOST_TO_HOST_SAME_NODE
12+
- HOST_TO_HOST_DIFF_NODE
13+
- HOST_TO_CLUSTER_IP_TO_POD_SAME_NODE
14+
- HOST_TO_NODE_PORT_TO_POD_SAME_NODE
15+
- POD_TO_EXTERNAL
16+
- POD_TO_POD_ANP_ALLOW
17+
- POD_TO_POD_NP_DENY
18+
duration: 5
19+
pre_provision: false
20+
connections:
21+
- name: "iperf-tcp"
22+
type: "iperf-tcp"
23+
instances: 1
24+
reverse: false
25+
server:
26+
- name: "dpu-sim-host-worker"
27+
persistent: false
28+
sriov: false
29+
client:
30+
- name: "dpu-sim-host-worker2"
31+
sriov: false
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Test sriov=true with iperf-tcp
2+
3+
tft:
4+
- name: "kind-dpu-offload"
5+
namespace: "default"
6+
test_cases: "1-26"
7+
duration: 5
8+
pre_provision: true
9+
connections:
10+
- name: "iperf-tcp"
11+
type: "iperf-tcp"
12+
instances: 1
13+
reverse: false
14+
server:
15+
- name: "dpu-sim-host-worker"
16+
persistent: false
17+
sriov: true
18+
default_network: "default/ovn-primary"
19+
client:
20+
- name: "dpu-sim-host-worker2"
21+
sriov: true
22+
default_network: "default/ovn-primary"
23+
resource_name: "dpusim.io/vf"
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Run test cases 1-26 and 32-36 with iperf-tcp, and http-curl.
2+
3+
tft:
4+
- name: "kind-full-suite"
5+
namespace: "default"
6+
test_cases: "1-26,32-36"
7+
duration: 5
8+
pre_provision: true
9+
connections:
10+
- name: "iperf-tcp"
11+
type: "iperf-tcp"
12+
instances: 1
13+
reverse: false
14+
server:
15+
- name: "dpu-sim-host-worker"
16+
persistent: false
17+
sriov: false
18+
client:
19+
- name: "dpu-sim-host-worker2"
20+
sriov: false
21+
- name: "http-curl"
22+
type: "http"
23+
instances: 1
24+
reverse: false
25+
server:
26+
- name: "dpu-sim-host-worker"
27+
persistent: false
28+
sriov: false
29+
client:
30+
- name: "dpu-sim-host-worker2"
31+
sriov: false
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Validates per-pod CPU/memory requests+limits, a persistent server pod, the
2+
# reverse direction codepath, and a plugin scoped to a subset of test cases.
3+
4+
tft:
5+
- name: "kind-resource-limits"
6+
namespace: "default"
7+
test_cases: "1-12"
8+
duration: 5
9+
pre_provision: true
10+
connections:
11+
- name: "iperf-tcp"
12+
type: "iperf-tcp"
13+
instances: 1
14+
reverse: true
15+
cpu_request: "10m"
16+
cpu_limit: "500m"
17+
mem_request: "50Mi"
18+
mem_limit: "200Mi"
19+
server:
20+
- name: "dpu-sim-host-worker"
21+
persistent: true
22+
sriov: false
23+
client:
24+
- name: "dpu-sim-host-worker2"
25+
sriov: false
26+
plugins:
27+
- name: measure_cpu
28+
test_cases:
29+
- POD_TO_POD_SAME_NODE
30+
- POD_TO_POD_DIFF_NODE
31+
- POD_TO_HOST_SAME_NODE
32+
- POD_TO_HOST_DIFF_NODE
33+
- POD_TO_CLUSTER_IP_TO_POD_SAME_NODE

.github/workflows/kind-tft.yml

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

0 commit comments

Comments
 (0)