Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: improve network performance test to make it reusable and modifiable #2969

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.3
Expand Down
Loading