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

Refactor drivers code #131

Merged
merged 8 commits into from
Feb 22, 2024
Merged

Conversation

rsevilla87
Copy link
Member

@rsevilla87 rsevilla87 commented Feb 16, 2024

Type of change

  • Refactor
  • New feature
  • Bug fix
  • Optimization
  • Documentation Update

Description

Refactoring drivers code, all drivers code has been moved to the drivers package, and they implement the new Driver interface. Resulting in a more intuitive and reduced code.

Now is also possible to select what driver to use, by default netperf is enabled, but it's possible to run the test with different combinations of drivers, i.e:

$ k8s-netperf --iperf # Will run the test using iperf and netperf

or

$ k8s-netperf --netperf=false --uperf # Will run the test using uperf

Related Tickets & Documents

  • Related Issue #
  • Closes #

Checklist before requesting a review

  • I have performed a self-review of my code.
  • If it is a core feature, I have added thorough tests.

@rsevilla87 rsevilla87 changed the title Refactor drivers code WIP: Refactor drivers code Feb 16, 2024
Signed-off-by: Raul Sevilla <[email protected]>
@rsevilla87 rsevilla87 changed the title WIP: Refactor drivers code Refactor drivers code Feb 16, 2024
Signed-off-by: Raul Sevilla <[email protected]>
@rsevilla87 rsevilla87 added documentation Improvements or additions to documentation enhancement New feature or request labels Feb 16, 2024
Makefile Show resolved Hide resolved
Copy link
Member

@jtaleric jtaleric left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to dig into this failure a bit more

panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
main.executeWorkload({0x1, 0xa, {0xc00022d6f0, 0xa}, 0x3, 0x400, 0x0, {0x1ee68ee, 0x4}, 0x1}, ...)
	/home/jtaleric/code/k8s-netperf/cmd/k8s-netperf/k8s-netperf.go:358 +0xfc6
main.glob..func1(0xc000231900?, {0x1ee698e?, 0x4?, 0x1ee6992?})
	/home/jtaleric/code/k8s-netperf/cmd/k8s-netperf/k8s-netperf.go:187 +0x1065
github.com/spf13/cobra.(*Command).execute(0x3299a20, {0xc000132010, 0x1, 0x1})
	/home/jtaleric/go/pkg/mod/github.com/spf13/[email protected]/command.go:920 +0x863
github.com/spf13/cobra.(*Command).ExecuteC(0x3299a20)
	/home/jtaleric/go/pkg/mod/github.com/spf13/[email protected]/command.go:1044 +0x3a5
github.com/spf13/cobra.(*Command).Execute(...)
	/home/jtaleric/go/pkg/mod/github.com/spf13/[email protected]/command.go:968
main.main()
	/home/jtaleric/code/k8s-netperf/cmd/k8s-netperf/k8s-netperf.go:464 +0x3c7
jtaleric at polaris in ~/code/k8s-netperf on interface-refactor△ $ git checkout main

I just ran w/ ./bin/amd64/k8s-netperf --debug

cmd/k8s-netperf/k8s-netperf.go Outdated Show resolved Hide resolved
cmd/k8s-netperf/k8s-netperf.go Outdated Show resolved Hide resolved
@jtaleric
Copy link
Member

Need to dig into this failure a bit more

panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
main.executeWorkload({0x1, 0xa, {0xc00022d6f0, 0xa}, 0x3, 0x400, 0x0, {0x1ee68ee, 0x4}, 0x1}, ...)
	/home/jtaleric/code/k8s-netperf/cmd/k8s-netperf/k8s-netperf.go:358 +0xfc6
main.glob..func1(0xc000231900?, {0x1ee698e?, 0x4?, 0x1ee6992?})
	/home/jtaleric/code/k8s-netperf/cmd/k8s-netperf/k8s-netperf.go:187 +0x1065
github.com/spf13/cobra.(*Command).execute(0x3299a20, {0xc000132010, 0x1, 0x1})
	/home/jtaleric/go/pkg/mod/github.com/spf13/[email protected]/command.go:920 +0x863
github.com/spf13/cobra.(*Command).ExecuteC(0x3299a20)
	/home/jtaleric/go/pkg/mod/github.com/spf13/[email protected]/command.go:1044 +0x3a5
github.com/spf13/cobra.(*Command).Execute(...)
	/home/jtaleric/go/pkg/mod/github.com/spf13/[email protected]/command.go:968
main.main()
	/home/jtaleric/code/k8s-netperf/cmd/k8s-netperf/k8s-netperf.go:464 +0x3c7
jtaleric at polaris in ~/code/k8s-netperf on interface-refactor△ $ git checkout main

I just ran w/ ./bin/amd64/k8s-netperf --debug

I patched the hostNet issues locally, but still running into issues :(

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x19fbb06]

goroutine 1 [running]:
main.executeWorkload({0x1, 0xa, {0xc00022d6f0, 0xa}, 0x3, 0x400, 0x0, {0x1ee68ee, 0x4}, 0x1}, ...)
	/home/jtaleric/code/k8s-netperf/cmd/k8s-netperf/k8s-netperf.go:398 +0x566
main.glob..func1(0xc000231900?, {0x1ee698e?, 0x4?, 0x1ee6992?})
	/home/jtaleric/code/k8s-netperf/cmd/k8s-netperf/k8s-netperf.go:187 +0x1065
github.com/spf13/cobra.(*Command).execute(0x3299a20, {0xc000132010, 0x1, 0x1})
	/home/jtaleric/go/pkg/mod/github.com/spf13/[email protected]/command.go:920 +0x863
github.com/spf13/cobra.(*Command).ExecuteC(0x3299a20)
	/home/jtaleric/go/pkg/mod/github.com/spf13/[email protected]/command.go:1044 +0x3a5
github.com/spf13/cobra.(*Command).Execute(...)
	/home/jtaleric/go/pkg/mod/github.com/spf13/[email protected]/command.go:968
main.main()
	/home/jtaleric/code/k8s-netperf/cmd/k8s-netperf/k8s-netperf.go:464 +0x3c7

Signed-off-by: Raul Sevilla <[email protected]>
@rsevilla87
Copy link
Member Author

Need to dig into this failure a bit more

panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
main.executeWorkload({0x1, 0xa, {0xc00022d6f0, 0xa}, 0x3, 0x400, 0x0, {0x1ee68ee, 0x4}, 0x1}, ...)
	/home/jtaleric/code/k8s-netperf/cmd/k8s-netperf/k8s-netperf.go:358 +0xfc6
main.glob..func1(0xc000231900?, {0x1ee698e?, 0x4?, 0x1ee6992?})
	/home/jtaleric/code/k8s-netperf/cmd/k8s-netperf/k8s-netperf.go:187 +0x1065
github.com/spf13/cobra.(*Command).execute(0x3299a20, {0xc000132010, 0x1, 0x1})
	/home/jtaleric/go/pkg/mod/github.com/spf13/[email protected]/command.go:920 +0x863
github.com/spf13/cobra.(*Command).ExecuteC(0x3299a20)
	/home/jtaleric/go/pkg/mod/github.com/spf13/[email protected]/command.go:1044 +0x3a5
github.com/spf13/cobra.(*Command).Execute(...)
	/home/jtaleric/go/pkg/mod/github.com/spf13/[email protected]/command.go:968
main.main()
	/home/jtaleric/code/k8s-netperf/cmd/k8s-netperf/k8s-netperf.go:464 +0x3c7
jtaleric at polaris in ~/code/k8s-netperf on interface-refactor△ $ git checkout main

I just ran w/ ./bin/amd64/k8s-netperf --debug

I patched the hostNet issues locally, but still running into issues :(

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x19fbb06]

goroutine 1 [running]:
main.executeWorkload({0x1, 0xa, {0xc00022d6f0, 0xa}, 0x3, 0x400, 0x0, {0x1ee68ee, 0x4}, 0x1}, ...)
	/home/jtaleric/code/k8s-netperf/cmd/k8s-netperf/k8s-netperf.go:398 +0x566
main.glob..func1(0xc000231900?, {0x1ee698e?, 0x4?, 0x1ee6992?})
	/home/jtaleric/code/k8s-netperf/cmd/k8s-netperf/k8s-netperf.go:187 +0x1065
github.com/spf13/cobra.(*Command).execute(0x3299a20, {0xc000132010, 0x1, 0x1})
	/home/jtaleric/go/pkg/mod/github.com/spf13/[email protected]/command.go:920 +0x863
github.com/spf13/cobra.(*Command).ExecuteC(0x3299a20)
	/home/jtaleric/go/pkg/mod/github.com/spf13/[email protected]/command.go:1044 +0x3a5
github.com/spf13/cobra.(*Command).Execute(...)
	/home/jtaleric/go/pkg/mod/github.com/spf13/[email protected]/command.go:968
main.main()
	/home/jtaleric/code/k8s-netperf/cmd/k8s-netperf/k8s-netperf.go:464 +0x3c7

Need to dig into this failure a bit more

panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
main.executeWorkload({0x1, 0xa, {0xc00022d6f0, 0xa}, 0x3, 0x400, 0x0, {0x1ee68ee, 0x4}, 0x1}, ...)
	/home/jtaleric/code/k8s-netperf/cmd/k8s-netperf/k8s-netperf.go:358 +0xfc6
main.glob..func1(0xc000231900?, {0x1ee698e?, 0x4?, 0x1ee6992?})
	/home/jtaleric/code/k8s-netperf/cmd/k8s-netperf/k8s-netperf.go:187 +0x1065
github.com/spf13/cobra.(*Command).execute(0x3299a20, {0xc000132010, 0x1, 0x1})
	/home/jtaleric/go/pkg/mod/github.com/spf13/[email protected]/command.go:920 +0x863
github.com/spf13/cobra.(*Command).ExecuteC(0x3299a20)
	/home/jtaleric/go/pkg/mod/github.com/spf13/[email protected]/command.go:1044 +0x3a5
github.com/spf13/cobra.(*Command).Execute(...)
	/home/jtaleric/go/pkg/mod/github.com/spf13/[email protected]/command.go:968
main.main()
	/home/jtaleric/code/k8s-netperf/cmd/k8s-netperf/k8s-netperf.go:464 +0x3c7
jtaleric at polaris in ~/code/k8s-netperf on interface-refactor△ $ git checkout main

I just ran w/ ./bin/amd64/k8s-netperf --debug

I patched the hostNet issues locally, but still running into issues :(

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x19fbb06]

goroutine 1 [running]:
main.executeWorkload({0x1, 0xa, {0xc00022d6f0, 0xa}, 0x3, 0x400, 0x0, {0x1ee68ee, 0x4}, 0x1}, ...)
	/home/jtaleric/code/k8s-netperf/cmd/k8s-netperf/k8s-netperf.go:398 +0x566
main.glob..func1(0xc000231900?, {0x1ee698e?, 0x4?, 0x1ee6992?})
	/home/jtaleric/code/k8s-netperf/cmd/k8s-netperf/k8s-netperf.go:187 +0x1065
github.com/spf13/cobra.(*Command).execute(0x3299a20, {0xc000132010, 0x1, 0x1})
	/home/jtaleric/go/pkg/mod/github.com/spf13/[email protected]/command.go:920 +0x863
github.com/spf13/cobra.(*Command).ExecuteC(0x3299a20)
	/home/jtaleric/go/pkg/mod/github.com/spf13/[email protected]/command.go:1044 +0x3a5
github.com/spf13/cobra.(*Command).Execute(...)
	/home/jtaleric/go/pkg/mod/github.com/spf13/[email protected]/command.go:968
main.main()
	/home/jtaleric/code/k8s-netperf/cmd/k8s-netperf/k8s-netperf.go:464 +0x3c7

I can't reproduce it, what was the exact command you used?

@jtaleric
Copy link
Member

I can't reproduce it, what was the exact command you used?

weird.

All I am doing is ./bin/amd64/k8s-netperf --debug

and I see

DEBU[2024-02-19 08:53:34] client-across Running on perf-fc640-4.perf.lab.eng.rdu2.redhat.com with IP 10.1.184.207 
DEBU[2024-02-19 08:53:34] Executing workloads. hostNetwork is false, service is false 
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x19fbb06]

goroutine 1 [running]:
main.executeWorkload({0x1, 0xa, {0xc00022d6f0, 0xa}, 0x3, 0x400, 0x0, {0x1ee68ee, 0x4}, 0x1}, ...)
	/home/jtaleric/code/k8s-netperf/cmd/k8s-netperf/k8s-netperf.go:398 +0x566
main.glob..func1(0xc000231900?, {0x1ee698e?, 0x4?, 0x1ee6992?})
	/home/jtaleric/code/k8s-netperf/cmd/k8s-netperf/k8s-netperf.go:187 +0x1065
github.com/spf13/cobra.(*Command).execute(0x3299a20, {0xc000132010, 0x1, 0x1})
	/home/jtaleric/go/pkg/mod/github.com/spf13/[email protected]/command.go:920 +0x863
github.com/spf13/cobra.(*Command).ExecuteC(0x3299a20)
	/home/jtaleric/go/pkg/mod/github.com/spf13/[email protected]/command.go:1044 +0x3a5
github.com/spf13/cobra.(*Command).Execute(...)
	/home/jtaleric/go/pkg/mod/github.com/spf13/[email protected]/command.go:968
main.main()
	/home/jtaleric/code/k8s-netperf/cmd/k8s-netperf/k8s-netperf.go:464 +0x3c7

Checking version

Version: interface-refactor
Git Commit: 9c61fac33db600342e36e9167e657aa240c2b8fd
Build Date: 2024-02-19-08:52:14
Go Version: go1.21.3
OS/Arch: linux amd64

@jtaleric
Copy link
Member

npr := executeWorkload(nc, s, true, false, false, false)

                                       npr := executeWorkload(nc, s, true, false, false, false)

this should be

                                       npr := executeWorkload(nc, s, false, false, false, false)

@jtaleric
Copy link
Member

npr := executeWorkload(nc, s, true, false, false, false)

                                       npr := executeWorkload(nc, s, true, false, false, false)

this should be

                                       npr := executeWorkload(nc, s, false, false, false, false)

Update...

The fields are.
executeWorkload(networkConfig, scenario, hostNetwork, netperfWorkload, iperfWorkload, uperfWorkload)

So, with this, the update to line -

npr := executeWorkload(nc, s, true, false, false, false)

npr := executeWorkload(nc, s, false, true, false, false)

Signed-off-by: Raul Sevilla <[email protected]>
Signed-off-by: Raul Sevilla <[email protected]>
@jtaleric
Copy link
Member

👀

@rsevilla87
Copy link
Member Author

👀

alright, it should be ready now

Copy link
Member

@jtaleric jtaleric left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@jtaleric jtaleric self-requested a review February 21, 2024 22:35
@jtaleric
Copy link
Member

hm, just ran into this...

./bin/amd64/k8s-netperf
INFO[2024-02-21 17:30:28] 📒 Reading netperf.yml file.                  
INFO[2024-02-21 17:30:28] 📒 Reading netperf.yml file - using ConfigV2 Method.  
INFO[2024-02-21 17:30:28] Cleaning resources created by k8s-netperf    
INFO[2024-02-21 17:30:29] ⏰ Waiting for client-across Deployment to deleted... 
INFO[2024-02-21 17:31:00] ⏰ Waiting for server Deployment to deleted... 
INFO[2024-02-21 17:31:31] 🔬 prometheus discovered at openshift-monitoring 
WARN[2024-02-21 17:31:31] ⚠️  No zone label                            
WARN[2024-02-21 17:31:31] ⚠️  Single node per zone and/or no zone labels 
INFO[2024-02-21 17:31:31] 🚀 Creating service for iperf-service in namespace netperf 
INFO[2024-02-21 17:31:31] 🚀 Creating service for uperf-service in namespace netperf 
INFO[2024-02-21 17:31:31] 🚀 Creating service for netperf-service in namespace netperf 
INFO[2024-02-21 17:31:31] 🚀 Starting Deployment for: client-across in namespace: netperf 
INFO[2024-02-21 17:31:31] ⏰ Checking for client-across Pods to become ready... 
INFO[2024-02-21 17:31:34] 🚀 Starting Deployment for: server in namespace: netperf 
INFO[2024-02-21 17:31:34] ⏰ Checking for server Pods to become ready... 
INFO[2024-02-21 17:31:38] 🗒️  Running netperf TCP_STREAM (service false) for 10s  
INFO[2024-02-21 17:31:51] 🗒️  Running netperf TCP_STREAM (service false) for 10s  
INFO[2024-02-21 17:32:03] 🗒️  Running netperf TCP_STREAM (service false) for 10s  
FATA[2024-02-21 17:32:15] 😭 At least one driver needs to be enabled   

We must need to set netperf to true by default.

@jtaleric
Copy link
Member

Nope, this is even weirder... we see it ran some tcp stream tests in the output i shared 😕

@rsevilla87
Copy link
Member Author

rsevilla87 commented Feb 21, 2024

I can't reproduce it:

$ ./bin/amd64/k8s-netperf 
INFO[2024-02-21 23:56:41] 📒 Reading netperf.yml file.                  
INFO[2024-02-21 23:56:41] 📒 Reading netperf.yml file - using ConfigV2 Method.  
INFO[2024-02-21 23:56:41] Cleaning resources created by k8s-netperf    
INFO[2024-02-21 23:56:42] ⏰ Waiting for client-across Deployment to deleted... 
INFO[2024-02-21 23:56:54] ⏰ Waiting for server Deployment to deleted... 
INFO[2024-02-21 23:56:58] 🔬 prometheus discovered at openshift-monitoring 
WARN[2024-02-21 23:57:00] ⚠️   Single node per zone and/or no zone labels 
INFO[2024-02-21 23:57:01] 🚀 Creating service for iperf-service in namespace netperf 
INFO[2024-02-21 23:57:01] 🚀 Creating service for uperf-service in namespace netperf 
INFO[2024-02-21 23:57:02] 🚀 Creating service for netperf-service in namespace netperf 
INFO[2024-02-21 23:57:02] 🚀 Starting Deployment for: client-across in namespace: netperf 
INFO[2024-02-21 23:57:02] ⏰ Checking for client-across Pods to become ready... 
INFO[2024-02-21 23:57:05] 🚀 Starting Deployment for: server in namespace: netperf 
INFO[2024-02-21 23:57:05] ⏰ Checking for server Pods to become ready... 
INFO[2024-02-21 23:57:11] 🗒️   Running netperf TCP_STREAM (service false) for 10s  
INFO[2024-02-21 23:57:25] 🗒️   Running netperf TCP_STREAM (service false) for 10s  
INFO[2024-02-21 23:57:38] 🗒️   Running netperf TCP_STREAM (service false) for 10s  
INFO[2024-02-21 23:57:53] 🗒️   Running netperf TCP_STREAM (service false) for 10s  
INFO[2024-02-21 23:58:06] 🗒️   Running netperf TCP_STREAM (service false) for 10s  
INFO[2024-02-21 23:58:20] 🗒️   Running netperf TCP_STREAM (service false) for 10s  
INFO[2024-02-21 23:58:34] 🗒️   Running netperf UDP_STREAM (service false) for 10s  
INFO[2024-02-21 23:58:47] 🗒️   Running netperf UDP_STREAM (service false) for 10s  
INFO[2024-02-21 23:59:00] 🗒️   Running netperf UDP_STREAM (service false) for 10s  
INFO[2024-02-21 23:59:15] 🗒️   Running netperf TCP_CRR (service false) for 10s  
INFO[2024-02-21 23:59:30] 🗒️   Running netperf TCP_CRR (service false) for 10s  
INFO[2024-02-21 23:59:45] 🗒️   Running netperf TCP_CRR (service false) for 10s  
INFO[2024-02-22 00:00:01] 🗒️   Running netperf TCP_CRR (service true) for 10s  
INFO[2024-02-22 00:00:17] 🗒️   Running netperf TCP_CRR (service true) for 10s  
INFO[2024-02-22 00:00:32] 🗒️   Running netperf TCP_CRR (service true) for 10s  
INFO[2024-02-22 00:00:49] 🗒️   Running netperf TCP_RR (service false) for 10s  
INFO[2024-02-22 00:01:02] 🗒️   Running netperf TCP_RR (service false) for 10s  
INFO[2024-02-22 00:01:16] 🗒️   Running netperf TCP_RR (service false) for 10s  
blablabla
INFO[2024-02-22 00:01:38] Cleaning resources created by k8s-netperf    
INFO[2024-02-22 00:01:39] ⏰ Waiting for client-across Deployment to deleted... 
INFO[2024-02-22 00:02:10] ⏰ Waiting for server Deployment to deleted... 

@jtaleric jtaleric merged commit c99337e into cloud-bulldozer:main Feb 22, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants