File tree Expand file tree Collapse file tree 3 files changed +55
-7
lines changed
network/benchmarks/netperf Expand file tree Collapse file tree 3 files changed +55
-7
lines changed Original file line number Diff line number Diff line change
1
+ name : Build and Push Docker Image for network/benchmarks/netperf/nptest
2
+
3
+ on :
4
+ push :
5
+ tags :
6
+ - ' **'
7
+
8
+ jobs :
9
+ build-and-push :
10
+ permissions :
11
+ packages : write # Write permission is required to publish Docker images to GitHub Container Registry
12
+ contents : read
13
+
14
+ runs-on : ubuntu-latest
15
+
16
+ steps :
17
+ - name : Checkout repository
18
+ uses : actions/checkout@v4
19
+
20
+ - name : Set up QEMU
21
+ uses : docker/setup-qemu-action@v3
22
+
23
+ - name : Set up Docker Buildx
24
+ uses : docker/setup-buildx-action@v3
25
+
26
+ - name : Log in to GitHub Container Registry
27
+ uses : docker/login-action@v3
28
+ with :
29
+ registry : ghcr.io
30
+ username : ${{ github.actor }}
31
+ password : ${{ secrets.GITHUB_TOKEN }}
32
+
33
+ - name : Build and push Docker image
34
+ run : |
35
+ cd network/benchmarks/netperf
36
+ make push
37
+ env :
38
+ DOCKERREPO : ghcr.io/${{ github.repository_owner }}/nptest
39
+ IMAGE_TAG : ${{ github.ref_name }}
Original file line number Diff line number Diff line change 15
15
all : docker push launch runtests
16
16
17
17
DOCKERREPO := $(or $(DOCKERREPO ) , girishkalele/netperf-latest)
18
+ IMAGE_TAG := $(or $(IMAGE_TAG ) , latest)
18
19
19
- docker : launch
20
+ docker : test
20
21
mkdir -p Dockerbuild && \
21
22
cp -rf nptest/* Dockerbuild/ && \
22
- docker build -t $(DOCKERREPO ) Dockerbuild/
23
+ docker build -t $(DOCKERREPO ) : $( IMAGE_TAG ) Dockerbuild/
23
24
24
25
push : docker
25
- gcloud docker push $(DOCKERREPO )
26
+ docker push $(DOCKERREPO ) : $( IMAGE_TAG )
26
27
27
28
clean :
28
29
@rm -f Dockerbuild/*
@@ -33,6 +34,10 @@ clean:
33
34
launch : launch.go
34
35
go build -o launch launch.go
35
36
37
+ test :
38
+ go test ./...
39
+ cd nptest && go test ./...
40
+
36
41
# 'runtests' is the test runner target
37
42
runtests : launch
38
43
@echo Launching network performance tests
@@ -42,7 +47,5 @@ runtests: launch
42
47
@echo Results file netperf-latest.csv and SVG/PNG graphs generated successfully
43
48
44
49
localtest : docker
45
- docker push $(DOCKERREPO )
46
- go run launch.go -image=$(DOCKERREPO ) -json -kubeConfig ./kubeConfig
47
-
48
-
50
+ docker push $(DOCKERREPO ) :$(IMAGE_TAG )
51
+ go run launch.go -image=$(DOCKERREPO ) :$(IMAGE_TAG ) -json -kubeConfig ./kubeConfig
Original file line number Diff line number Diff line change @@ -52,6 +52,12 @@ RUN cd iperf-3.1 && ./configure --prefix=/usr/local --bindir /usr/local/bin && m
52
52
RUN curl -LO https://github.com/HewlettPackard/netperf/archive/netperf-2.7.0.tar.gz && tar -xzf netperf-2.7.0.tar.gz && mv netperf-netperf-2.7.0/ netperf-2.7.0
53
53
RUN cd netperf-2.7.0 && ./configure --prefix=/usr/local --bindir /usr/local/bin && make CFLAGS=-fcommon && make install
54
54
55
+ # Validate the installation of qperf, iperf3 and netperf
56
+ RUN usr/local/bin/qperf --help
57
+ RUN usr/local/bin/iperf3 -v
58
+ RUN usr/local/bin/netperf -V
59
+ RUN usr/local/bin/netserver -V
60
+
55
61
COPY --from=builder /workspace/nptests /usr/bin/
56
62
57
63
ENTRYPOINT ["nptests" ]
You can’t perform that action at this time.
0 commit comments