Skip to content

Commit 3a15444

Browse files
committed
feat: improve network performance test to make it reusable and easily modifiable
1 parent c6ef3b7 commit 3a15444

20 files changed

+1945
-873
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

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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 (
66
k8s.io/api v0.31.2

0 commit comments

Comments
 (0)