Skip to content

Commit

Permalink
Cleaning up (#36)
Browse files Browse the repository at this point in the history
Cleaning up some code, moving stuff around. Planning to add other
workload drivers to the mix.

Signed-off-by: Joe Talerico <[email protected]>
  • Loading branch information
jtaleric authored Mar 17, 2023
1 parent 88c3033 commit f9e004a
Show file tree
Hide file tree
Showing 3,233 changed files with 1,122,489 additions and 409 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion .github/workflows/go-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18
go-version: 1.19

- name: Build
run: go build -v ./...
2 changes: 1 addition & 1 deletion .github/workflows/go-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18
go-version: 1.19

- name: Install dependencies
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/go-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18
go-version: 1.19

- name: Test
run: go test -v ./...
15 changes: 15 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
ARCH ?= amd64
BIN = k8s-netperf
BIN_DIR = bin
BIN_PATH = $(BIN_DIR)/$(ARCH)/$(BIN)
CGO = 0

all: build

build: $(BIN_PATH)

clean: $(BIN_PATH)
rm -rf bin/$(ARCH)

$(BIN_PATH): $(SOURCES)
GOARCH=$(ARCH) CGO_ENABLED=$(CGO) go build -v -mod vendor -o $(BIN_PATH) ./cmd/k8s-netperf
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ Running Networking Performance Tests against K8s

[![asciicast](https://asciinema.org/a/524925.svg)](https://asciinema.org/a/524925)

## Status
Currently a work-in-progress.

### Benchmark Tool and Tests

| Tool | Test | Status | Pass/Fail Context |
Expand All @@ -19,7 +16,7 @@ Currently a work-in-progress.
```shell
$ git clone http://github.com/jtaleric/k8s-netperf
$ cd k8s-netperf
$ go build .
$ make build
```

## Running
Expand All @@ -38,7 +35,7 @@ If you run with `-all`, you will need to allow `hostNetwork` for the netperf sa.
```shell
$ kubectl create ns netperf
$ kubectl create sa netperf -n netperf
$ ./k8s-netperf -help
$ ./bin/arch/k8s-netperf -help
Usage of ./k8s-netperf:
-all
Run all tests scenarios - hostNet and podNetwork (if possible)
Expand Down
14 changes: 8 additions & 6 deletions netperf.go → cmd/k8s-netperf/k8s-netperf.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ import (
"strings"
"time"

log "gihub.com/jtaleric/k8s-netperf/logging"
"gihub.com/jtaleric/k8s-netperf/metrics"
"gihub.com/jtaleric/k8s-netperf/netperf"
"github.com/jtaleric/k8s-netperf/pkg/config"
"github.com/jtaleric/k8s-netperf/pkg/k8s"
log "github.com/jtaleric/k8s-netperf/pkg/logging"
"github.com/jtaleric/k8s-netperf/pkg/metrics"
"github.com/jtaleric/k8s-netperf/pkg/netperf"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/tools/clientcmd"
Expand All @@ -32,7 +34,7 @@ func main() {
log.SetDebug()
}

cfg, err := netperf.ParseConf(*cfgfile)
cfg, err := config.ParseConf(*cfgfile)
if err != nil {
log.Error(err)
os.Exit(1)
Expand All @@ -52,7 +54,7 @@ func main() {
log.Error(err)
os.Exit(1)
}
s := netperf.PerfScenarios{
s := config.PerfScenarios{
HostNetwork: *full,
NodeLocal: *nl,
RestConfig: *rconfig,
Expand Down Expand Up @@ -99,7 +101,7 @@ func main() {
}

// Build the SUT (Deployments)
err = netperf.BuildSUT(client, &s)
err = k8s.BuildSUT(client, &s)
if err != nil {
log.Error(err)
os.Exit(1)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module gihub.com/jtaleric/k8s-netperf
module github.com/jtaleric/k8s-netperf

go 1.18

Expand Down
218 changes: 0 additions & 218 deletions netperf/kubernetes.go

This file was deleted.

Loading

0 comments on commit f9e004a

Please sign in to comment.