Skip to content

Commit

Permalink
feat: improve network performance test to make it reusable and easily…
Browse files Browse the repository at this point in the history
… modifiable
  • Loading branch information
ritwikranjan committed Nov 18, 2024
1 parent c6ef3b7 commit 3a15444
Show file tree
Hide file tree
Showing 20 changed files with 1,945 additions and 873 deletions.
5 changes: 4 additions & 1 deletion network/benchmarks/netperf/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Dockerbuild/*
Dockerbuildclient/*
nptests
netperf-w?.yaml
result*/*.json
*.csv
*.jpg
*.png
Expand All @@ -11,4 +12,6 @@ netperf-w?.yaml
*.pyc
.vscode
data-*

kubeConfig
launch
AzurePublicCloud-*.json
23 changes: 14 additions & 9 deletions network/benchmarks/netperf/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,17 @@

all: docker push launch runtests

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

docker: launch
mkdir -p Dockerbuild/nptest && \
cp -f Dockerfile Dockerbuild/ && \
cp -f nptest/nptest.go Dockerbuild/nptest/ && \
cp -f go.mod Dockerbuild/ && \
cp -f go.sum Dockerbuild/ && \
docker build -t $(DOCKERREPO) Dockerbuild/
docker: test
mkdir -p Dockerbuild && \
cp -rf nptest/* Dockerbuild/ && \
docker build -t $(dockerrepo):$(image_tag) Dockerbuild/

push: docker
gcloud docker push $(DOCKERREPO)
docker push $(dockerrepo):$(image_tag)

clean:
@rm -f Dockerbuild/*
Expand All @@ -36,6 +35,10 @@ clean:
launch: launch.go
go build -o launch launch.go

test:
go test ./...
cd nptest && go test ./...

# 'runtests' is the test runner target
runtests: launch
@echo Launching network performance tests
Expand All @@ -44,4 +47,6 @@ runtests: launch
cp netperf-latest.csv plotperf && cd plotperf; make plot && mv *png .. && mv *svg ..
@echo Results file netperf-latest.csv and SVG/PNG graphs generated successfully

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

4 changes: 2 additions & 2 deletions network/benchmarks/netperf/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module k8s.io/perf-tests/network
module k8s.io/perf-tests/network/benchmarks/netperf

go 1.22.4
go 1.22.7

require (
k8s.io/api v0.31.2
Expand Down
Loading

0 comments on commit 3a15444

Please sign in to comment.