Skip to content

Commit 2a358cf

Browse files
authored
Merge pull request #167 from capolrik/gh-ci
Adding GitHub actions ci.yml for PRs
2 parents 56710be + 726bf5a commit 2a358cf

File tree

3 files changed

+90
-4
lines changed

3 files changed

+90
-4
lines changed

.github/workflows/ci.yml

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches: [ "*" ]
6+
paths-ignore:
7+
- '**.md'
8+
- '**.sh'
9+
10+
# Allows you to run this workflow manually from the Actions tab
11+
workflow_dispatch:
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
17+
env:
18+
KUBECONFIG: "/home/runner/ovn.conf"
19+
KIND_IPV4_SUPPORT: "true"
20+
KIND_IPV6_SUPPORT: "false"
21+
OVN_GATEWAY_MODE: "shared"
22+
23+
steps:
24+
- name: Checkoput OVN-kubernetes repo
25+
uses: actions/checkout@v4
26+
with:
27+
repository: 'ovn-org/ovn-kubernetes'
28+
fetch-depth: 1
29+
path: ovn-k
30+
31+
- name: Kind setup
32+
timeout-minutes: 30
33+
run: |
34+
make -C ovn-k/test install-kind
35+
kubectl get po -A
36+
37+
- name: Label worker nodes
38+
run: |
39+
kubectl label node ovn-worker node-role.kubernetes.io/worker="" --overwrite=true
40+
kubectl label node ovn-worker2 node-role.kubernetes.io/worker="" --overwrite=true
41+
kubectl get node -o wide
42+
43+
- name: Checkout k8s-netperf
44+
uses: actions/checkout@v4
45+
46+
- name: Build k8s-netperf
47+
run: |
48+
make build
49+
50+
- name: Run default tests
51+
run: |
52+
./bin/amd64/k8s-netperf --debug
53+
54+
- name: Run UDN L3 tests (using SVC)
55+
run: |
56+
./bin/amd64/k8s-netperf --debug --udnl3 --config examples/netperf-svc.yml
57+
58+
- name: Run UDN L2 tests (using SVC)
59+
run: |
60+
./bin/amd64/k8s-netperf --debug --udnl2 --config examples/netperf-svc.yml

examples/netperf-svc.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
tests:
2+
- TCPStreamService:
3+
parallelism: 1
4+
profile: "TCP_STREAM"
5+
duration: 10
6+
samples: 3
7+
messagesize: 1024
8+
service: True
9+
10+
- UDPStreamService:
11+
parallelism: 1
12+
profile: "UDP_STREAM"
13+
duration: 10
14+
samples: 3
15+
messagesize: 1024
16+
service: True
17+
18+
- CRRService:
19+
parallelism: 1
20+
profile: "TCP_CRR"
21+
duration: 10
22+
samples: 3
23+
messagesize: 1024
24+
service: True

pkg/k8s/kubernetes.go

+6-4
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,6 @@ func DeployL3Udn(dynamicClient *dynamic.DynamicClient) error {
194194
"topology": "Layer3",
195195
"layer3": map[string]interface{}{
196196
"role": "Primary",
197-
"ipam": map[string]interface{}{
198-
"lifecycle": "Persistent",
199-
},
200197
"subnets": []interface{}{
201198
map[string]interface{}{
202199
"cidr": "10.0.0.0/16",
@@ -637,11 +634,14 @@ func BuildSUT(client *kubernetes.Clientset, s *config.PerfScenarios) error {
637634

638635
// Extract the UDN Ip address of the server (or the client) from the annotations - Support only ipv4
639636
func ExtractUdnIp(pod corev1.Pod) (string, error) {
637+
for key, value := range pod.Annotations {
638+
log.Debugf("Pod Annotation key: %s, value: %s", key, value)
639+
}
640640
podNetworksJson := pod.Annotations["k8s.ovn.org/pod-networks"]
641641
var root map[string]json.RawMessage
642642
err := json.Unmarshal([]byte(podNetworksJson), &root)
643643
if err != nil {
644-
fmt.Println("Error unmarshalling JSON:", err)
644+
log.Error("Error unmarshalling JSON:", err)
645645
return "", err
646646
}
647647
//
@@ -656,8 +656,10 @@ func ExtractUdnIp(pod corev1.Pod) (string, error) {
656656
if strings.Contains(ip, ".") { // Check if it's an IPv4 address
657657
ipv4, _, err = net.ParseCIDR(ip)
658658
if err != nil {
659+
log.Error("Error w/ IPv4 annotations:", err)
659660
return "", err
660661
}
662+
log.Debugf("Pod %s UDN Ip: %s\n", pod.Name, ipv4.String())
661663
}
662664
}
663665
return ipv4.String(), nil

0 commit comments

Comments
 (0)