Skip to content

Commit 9b044d0

Browse files
committed
feat: improve network performance test to make it reusable and easily modifiable
1 parent f428ee2 commit 9b044d0

21 files changed

+2106
-946
lines changed

network/benchmarks/netperf/.gitignore

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ Dockerbuild/*
22
Dockerbuildclient/*
33
nptests
44
netperf-w?.yaml
5+
result*/*.json
56
*.csv
67
*.jpg
78
*.png
@@ -11,4 +12,6 @@ netperf-w?.yaml
1112
*.pyc
1213
.vscode
1314
data-*
14-
15+
kubeConfig
16+
launch
17+
AzurePublicCloud-*.json

network/benchmarks/netperf/Makefile

+14-9
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,17 @@
1414

1515
all: docker push launch runtests
1616

17-
DOCKERREPO := girishkalele/netperf-latest
17+
repo_owner := $(shell echo $(REPO_OWNER) | tr '[:upper:]' '[:lower:]')
18+
dockerrepo := $(if $(repo_owner),ghcr.io/$(repo_owner)/nptest,girishkalele/netperf-latest)
19+
image_tag := $(or $(IMAGE_TAG), latest)
1820

19-
docker: launch
20-
mkdir -p Dockerbuild/nptest && \
21-
cp -f Dockerfile Dockerbuild/ && \
22-
cp -f nptest/nptest.go Dockerbuild/nptest/ && \
23-
cp -f go.mod Dockerbuild/ && \
24-
cp -f go.sum Dockerbuild/ && \
25-
docker build -t $(DOCKERREPO) Dockerbuild/
21+
docker: test
22+
mkdir -p Dockerbuild && \
23+
cp -rf nptest/* Dockerbuild/ && \
24+
docker build -t $(dockerrepo):$(image_tag) Dockerbuild/
2625

2726
push: docker
28-
gcloud docker push $(DOCKERREPO)
27+
docker push $(dockerrepo):$(image_tag)
2928

3029
clean:
3130
@rm -f Dockerbuild/*
@@ -36,6 +35,10 @@ clean:
3635
launch: launch.go
3736
go build -o launch launch.go
3837

38+
test:
39+
go test ./...
40+
cd nptest && go test ./...
41+
3942
# 'runtests' is the test runner target
4043
runtests: launch
4144
@echo Launching network performance tests
@@ -44,4 +47,6 @@ runtests: launch
4447
cp netperf-latest.csv plotperf && cd plotperf; make plot && mv *png .. && mv *svg ..
4548
@echo Results file netperf-latest.csv and SVG/PNG graphs generated successfully
4649

50+
localtest: push
51+
go run launch.go -image=$(dockerrepo):$(image_tag) -json -kubeConfig ./kubeConfig
4752

network/benchmarks/netperf/go.mod

+38-28
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,47 @@
1-
module k8s.io/perf-tests/network
1+
module k8s.io/perf-tests/network/benchmarks/netperf
22

3-
go 1.22.4
3+
go 1.22.7
44

55
require (
6-
k8s.io/api v0.0.0-20181011064954-26c7a45db378
7-
k8s.io/apimachinery v0.0.0-20181011064652-56cf97ad69c7
8-
k8s.io/client-go v0.0.0-20181011105049-9b03088ac34f
6+
k8s.io/api v0.30.3
7+
k8s.io/apimachinery v0.30.3
8+
k8s.io/client-go v0.30.3
99
)
1010

1111
require (
12-
github.com/davecgh/go-spew v1.1.1 // indirect
13-
github.com/ghodss/yaml v1.0.1-0.20180820084758-c7ce16629ff4 // indirect
14-
github.com/gogo/protobuf v1.1.2-0.20181010092945-fd322a3c4963 // indirect
15-
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b // indirect
16-
github.com/golang/protobuf v1.3.1 // indirect
17-
github.com/google/btree v1.0.0 // indirect
18-
github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf // indirect
19-
github.com/googleapis/gnostic v0.2.3-0.20180520015035-48a0ecefe2e4 // indirect
20-
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 // indirect
21-
github.com/imdario/mergo v0.3.6 // indirect
22-
github.com/json-iterator/go v1.1.6-0.20180914014843-2433035e5132 // indirect
12+
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
13+
github.com/emicklei/go-restful/v3 v3.12.1 // indirect
14+
github.com/go-logr/logr v1.4.2 // indirect
15+
github.com/go-openapi/jsonpointer v0.21.0 // indirect
16+
github.com/go-openapi/jsonreference v0.21.0 // indirect
17+
github.com/go-openapi/swag v0.23.0 // indirect
18+
github.com/gogo/protobuf v1.3.2 // indirect
19+
github.com/golang/protobuf v1.5.4 // indirect
20+
github.com/google/gnostic-models v0.6.8 // indirect
21+
github.com/google/gofuzz v1.2.0 // indirect
22+
github.com/google/uuid v1.6.0 // indirect
23+
github.com/imdario/mergo v0.3.16 // indirect
24+
github.com/josharian/intern v1.0.0 // indirect
25+
github.com/json-iterator/go v1.1.12 // indirect
26+
github.com/mailru/easyjson v0.7.7 // indirect
2327
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
24-
github.com/modern-go/reflect2 v1.0.1 // indirect
25-
github.com/peterbourgon/diskv v2.0.2-0.20180312054125-0646ccaebea1+incompatible // indirect
26-
github.com/spf13/pflag v1.0.3 // indirect
27-
github.com/stretchr/testify v1.5.1 // indirect
28-
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 // indirect
29-
golang.org/x/net v0.0.0-20190603091049-60506f45cf65 // indirect
30-
golang.org/x/oauth2 v0.0.0-20160902055913-3c3a985cb79f // indirect
31-
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a // indirect
32-
golang.org/x/text v0.3.2 // indirect
33-
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2 // indirect
34-
google.golang.org/appengine v1.6.6 // indirect
28+
github.com/modern-go/reflect2 v1.0.2 // indirect
29+
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
30+
github.com/spf13/pflag v1.0.5 // indirect
31+
golang.org/x/net v0.29.0 // indirect
32+
golang.org/x/oauth2 v0.23.0 // indirect
33+
golang.org/x/sys v0.25.0 // indirect
34+
golang.org/x/term v0.24.0 // indirect
35+
golang.org/x/text v0.18.0 // indirect
36+
golang.org/x/time v0.6.0 // indirect
37+
google.golang.org/protobuf v1.34.2 // indirect
3538
gopkg.in/inf.v0 v0.9.1 // indirect
36-
gopkg.in/yaml.v2 v2.2.2 // indirect
39+
gopkg.in/yaml.v2 v2.4.0 // indirect
40+
gopkg.in/yaml.v3 v3.0.1 // indirect
41+
k8s.io/klog/v2 v2.130.1 // indirect
42+
k8s.io/kube-openapi v0.0.0-20240903163716-9e1beecbcb38 // indirect
43+
k8s.io/utils v0.0.0-20240921022957-49e7df575cb6 // indirect
44+
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
45+
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
46+
sigs.k8s.io/yaml v1.4.0 // indirect
3747
)

0 commit comments

Comments
 (0)