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

Add a client to evaluate performances #303

Merged
merged 4 commits into from
May 16, 2022
Merged
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
9 changes: 7 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ container-volume/

# Ignore configuration directory
# to avoid leaking sensitive information and frequent update
poc-cb-net/config/**
# poc-cb-net/config/**
config.yaml
log_conf.yaml
template-*
# Provide templates of configuration files
# for users to copy and edit
!poc-cb-net/config/template-*
Expand All @@ -20,11 +21,15 @@ poc-cb-net/cmd/agent/agent
poc-cb-net/cmd/controller/controller
poc-cb-net/cmd/admin-web/admin-web
poc-cb-net/cmd/service/service
poc-cb-net/cmd/test-client/demo-client
poc-cb-net/cmd/test-client/demo-client/demo-client
poc-cb-net/cmd/test-client/perf-eval-client/perf-eval-client
poc-cb-net/cmd/test-client/check-response-time-of-cb-tumblebug-api/check-response-time-of-cb-tumblebug-api

# Ignore secrets
poc-cb-net/cmd/agent/secret/
*.pem
*.pub
bin/

# Igore output, result
result/
10 changes: 7 additions & 3 deletions poc-cb-net/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
default: controller service admin_web agent demo_client
default: controller service admin_web agent demo_client perf_eval_client

controller:
go build -mod=mod -o ./cmd/controller/controller ./cmd/controller/controller.go
Expand All @@ -13,7 +13,10 @@ agent:
go build -mod=mod -o ./cmd/agent/agent ./cmd/agent/agent.go

demo_client:
go build -mod=mod -o ./cmd/test-client/demo-client ./cmd/test-client/demo-client.go
go build -mod=mod -o ./cmd/test-client/demo-client/demo-client ./cmd/test-client/demo-client/demo-client.go

perf_eval_client:
go build -mod=mod -o ./cmd/test-client/perf-eval-client/perf-eval-client ./cmd/test-client/perf-eval-client/perf-eval-client.go

production:
@echo "Build for production"
Expand All @@ -25,7 +28,8 @@ production:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -ldflags '-s -w' -o ./cmd/service/service ./cmd/service/service.go
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -ldflags '-s -w' -o ./cmd/admin-web/admin-web ./cmd/admin-web/admin-web.go
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -ldflags '-s -w' -o ./cmd/agent/agent ./cmd/agent/agent.go
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -ldflags '-s -w' -o ./cmd/test-client/demo-client ./cmd/test-client/demo-client.go
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -ldflags '-s -w' -o ./cmd/test-client/demo-client/demo-client ./cmd/test-client/demo-client/demo-client.go
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -ldflags '-s -w' -o ./cmd/test-client/demo-client/perf-eval-client ./cmd/test-client/perf-eval-client.go

# cc:
# GOOS=linux GOARCH=arm go build -mod=mod -o cb-tumblebug-arm
Expand Down
7 changes: 4 additions & 3 deletions poc-cb-net/cmd/admin-web/admin-web.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ var cladnetClient pb.CloudAdaptiveNetworkServiceClient
var systemManagementClient pb.SystemManagementServiceClient

func init() {
fmt.Println("Start......... init() of admin-web.go")
fmt.Println("\nStart......... init() of admin-web.go")

// Set cb-log
env := os.Getenv("CBLOG_ROOT")
Expand All @@ -58,7 +58,7 @@ func init() {
panic(err)
}
exePath := filepath.Dir(ex)
fmt.Printf("exe path: %v\n", exePath)
// fmt.Printf("exe path: %v\n", exePath)

logConfPath := filepath.Join(exePath, "config", "log_conf.yaml")
if file.Exists(logConfPath) {
Expand Down Expand Up @@ -86,7 +86,7 @@ func init() {
panic(err)
}
exePath := filepath.Dir(ex)
fmt.Printf("exe path: %v\n", exePath)
// fmt.Printf("exe path: %v\n", exePath)

configPath := filepath.Join(exePath, "config", "config.yaml")
if file.Exists(configPath) {
Expand All @@ -107,6 +107,7 @@ func init() {
CBLogger.Debugf("Load %v", configPath)

fmt.Println("End......... init() of admin-web.go")
fmt.Println("")
}

var (
Expand Down
7 changes: 4 additions & 3 deletions poc-cb-net/cmd/agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ var CBLogger *logrus.Logger
var config model.Config

func init() {
fmt.Println("Start......... init() of agent.go")
fmt.Println("\nStart......... init() of agent.go")

// Set cb-log
env := os.Getenv("CBLOG_ROOT")
Expand All @@ -52,7 +52,7 @@ func init() {
panic(err)
}
exePath := filepath.Dir(ex)
fmt.Printf("exe path: %v\n", exePath)
// fmt.Printf("exe path: %v\n", exePath)

logConfPath := filepath.Join(exePath, "config", "log_conf.yaml")
if file.Exists(logConfPath) {
Expand Down Expand Up @@ -80,7 +80,7 @@ func init() {
panic(err)
}
exePath := filepath.Dir(ex)
fmt.Printf("exe path: %v\n", exePath)
// fmt.Printf("exe path: %v\n", exePath)

configPath := filepath.Join(exePath, "config", "config.yaml")
if file.Exists(configPath) {
Expand All @@ -101,6 +101,7 @@ func init() {
CBLogger.Debugf("Load %v", configPath)

fmt.Println("End......... init() of agent.go")
fmt.Println("")
}

// Control the cb-network agent by commands from remote
Expand Down
7 changes: 4 additions & 3 deletions poc-cb-net/cmd/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ var CBLogger *logrus.Logger
var config model.Config

func init() {
fmt.Println("Start......... init() of controller.go")
fmt.Println("\nStart......... init() of controller.go")

// Set cb-log
env := os.Getenv("CBLOG_ROOT")
Expand All @@ -47,7 +47,7 @@ func init() {
panic(err)
}
exePath := filepath.Dir(ex)
fmt.Printf("exe path: %v\n", exePath)
// fmt.Printf("exe path: %v\n", exePath)

logConfPath := filepath.Join(exePath, "config", "log_conf.yaml")
if file.Exists(logConfPath) {
Expand Down Expand Up @@ -75,7 +75,7 @@ func init() {
panic(err)
}
exePath := filepath.Dir(ex)
fmt.Printf("exe path: %v\n", exePath)
// fmt.Printf("exe path: %v\n", exePath)

configPath := filepath.Join(exePath, "config", "config.yaml")
if file.Exists(configPath) {
Expand All @@ -96,6 +96,7 @@ func init() {
CBLogger.Debugf("Load %v", configPath)

fmt.Println("End......... init() of controller.go")
fmt.Println("")
}

// func watchCLADNetSpecification(wg *sync.WaitGroup, etcdClient *clientv3.Client) {
Expand Down
7 changes: 4 additions & 3 deletions poc-cb-net/cmd/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ var config model.Config
var etcdClient *clientv3.Client

func init() {
fmt.Println("Start......... init() of cb-network service.go")
fmt.Println("\nStart......... init() of cb-network service.go")

// Set cb-log
env := os.Getenv("CBLOG_ROOT")
Expand All @@ -64,7 +64,7 @@ func init() {
panic(err)
}
exePath := filepath.Dir(ex)
fmt.Printf("exe path: %v\n", exePath)
// fmt.Printf("exe path: %v\n", exePath)

logConfPath := filepath.Join(exePath, "config", "log_conf.yaml")
if file.Exists(logConfPath) {
Expand Down Expand Up @@ -92,7 +92,7 @@ func init() {
panic(err)
}
exePath := filepath.Dir(ex)
fmt.Printf("exe path: %v\n", exePath)
// fmt.Printf("exe path: %v\n", exePath)

configPath := filepath.Join(exePath, "config", "config.yaml")
if file.Exists(configPath) {
Expand All @@ -113,6 +113,7 @@ func init() {
CBLogger.Debugf("Load %v", configPath)

fmt.Println("End......... init() of cb-network service.go")
fmt.Println("")
}

type serverSystemManagement struct {
Expand Down
25 changes: 0 additions & 25 deletions poc-cb-net/cmd/test-client/config/template-config.yaml

This file was deleted.

Loading