Skip to content

Commit

Permalink
Release v0.0.10
Browse files Browse the repository at this point in the history
Merge `release-v0.0.10` branch to `main`
  • Loading branch information
yunkon-kim authored Mar 31, 2022
2 parents a67d883 + a36533d commit 8ec9e45
Show file tree
Hide file tree
Showing 21 changed files with 557 additions and 352 deletions.
15 changes: 15 additions & 0 deletions poc-cb-net/README.KR.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@ git checkout tags/v3.5.0 -b v3.5.0
server_port: "8053"
gateway_port: "8052"
# A config for the demo-client as follows:
service_call_method: "grpc" # i.e., "rest" / "grpc"
```

##### log_conf.yaml
Expand Down Expand Up @@ -241,6 +244,9 @@ sudo ./controller
server_port: "8053"
gateway_port: "8052"
# A config for the demo-client as follows:
service_call_method: "grpc" # i.e., "rest" / "grpc"
```

##### log_conf.yaml
Expand Down Expand Up @@ -321,6 +327,9 @@ sudo ./cladnet-service
server_port: "8053"
gateway_port: "8052"
# A config for the demo-client as follows:
service_call_method: "grpc" # i.e., "rest" / "grpc"
```

##### log_conf.yaml
Expand Down Expand Up @@ -402,6 +411,9 @@ sudo ./admin-web
server_port: "8053"
gateway_port: "8052"
# A config for the demo-client as follows:
service_call_method: "grpc" # i.e., "rest" / "grpc"
```

##### log_conf.yaml
Expand Down Expand Up @@ -492,6 +504,9 @@ sudo ./agent
server_port: "8053"
gateway_port: "8052"
# A config for the demo-client as follows:
service_call_method: "grpc" # i.e., "rest" / "grpc"
```

#### demo-client 빌드
Expand Down
15 changes: 15 additions & 0 deletions poc-cb-net/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,9 @@ It was deployed and tested on the "home" directory of Ubuntu 18.04. It's possibl
server_port: "8053"
gateway_port: "8052"
# A config for the demo-client as follows:
service_call_method: "grpc" # i.e., "rest" / "grpc"
```

##### log_conf.yaml
Expand Down Expand Up @@ -240,6 +243,9 @@ It was deployed and tested on the "home" directory of Ubuntu 18.04. It's possibl
server_port: "8053"
gateway_port: "8052"
# A config for the demo-client as follows:
service_call_method: "grpc" # i.e., "rest" / "grpc"
```

##### log_conf.yaml
Expand Down Expand Up @@ -320,6 +326,9 @@ It was deployed and tested on the "home" directory of Ubuntu 18.04. It's possibl
server_port: "8053"
gateway_port: "8052"
# A config for the demo-client as follows:
service_call_method: "grpc" # i.e., "rest" / "grpc"
```
##### log_conf.yaml
Expand Down Expand Up @@ -400,6 +409,9 @@ It was deployed and tested on the "home" directory of Ubuntu 18.04. It's possibl
server_port: "8053"
gateway_port: "8052"
# A config for the demo-client as follows:
service_call_method: "grpc" # i.e., "rest" / "grpc"
```

##### log_conf.yaml
Expand Down Expand Up @@ -491,6 +503,9 @@ If it is running on another node, it is required to modify source code (related
server_port: "8053"
gateway_port: "8052"
# A config for the demo-client as follows:
service_call_method: "grpc" # i.e., "rest" / "grpc"
```
#### Build the demo-client
Expand Down
7 changes: 6 additions & 1 deletion poc-cb-net/cmd/admin-web/admin-web.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,14 @@ func handleTestSpecification(etcdClient *clientv3.Client, responseText []byte) {

// Get a networking rule of a cloud adaptive network
keyNetworkingRule := fmt.Sprint(etcdkey.NetworkingRule + "/" + testSpecification.CLADNetID)
CBLogger.Debugf("Get - %v", keyNetworkingRule)
resp, err := etcdClient.Get(context.TODO(), keyNetworkingRule, clientv3.WithPrefix())
if err != nil {
CBLogger.Error(err)
}

CBLogger.Tracef("Get resp: %+v", resp)

for _, kv := range resp.Kvs {

var peer model.Peer
Expand Down Expand Up @@ -275,6 +278,7 @@ func handleControlCommand(etcdClient *clientv3.Client, responseText string) {

// Get a networking rule of a cloud adaptive network
keyNetworkingRule := fmt.Sprint(etcdkey.NetworkingRule + "/" + cladnetID)
CBLogger.Debugf("Get - %v", keyNetworkingRule)
resp, err := etcdClient.Get(context.TODO(), keyNetworkingRule, clientv3.WithPrefix())
if err != nil {
CBLogger.Error(err)
Expand All @@ -283,7 +287,7 @@ func handleControlCommand(etcdClient *clientv3.Client, responseText string) {
for _, kv := range resp.Kvs {
key := string(kv.Key)
CBLogger.Tracef("Key : %v", key)
CBLogger.Tracef("The peer: %v", kv.Value)
CBLogger.Tracef("The peer: %v", string(kv.Value))

var peer model.Peer
err := json.Unmarshal(kv.Value, &peer)
Expand All @@ -294,6 +298,7 @@ func handleControlCommand(etcdClient *clientv3.Client, responseText string) {
// Put the evaluation specification of the CLADNet to the etcd
keyControlCommand := fmt.Sprint(etcdkey.ControlCommand + "/" + peer.CLADNetID + "/" + peer.HostID)

CBLogger.Debugf("Put - %v", keyControlCommand)
cmdMessageBody := cmd.BuildCommandMessage(controlCommand, controlCommandOption)
CBLogger.Tracef("%#v", cmdMessageBody)
//spec := message.Text
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 @@ -222,9 +222,10 @@ func watchHostNetworkInformation(wg *sync.WaitGroup, etcdClient *clientv3.Client
peer.PublicIPv4Address = hostNetworkInformation.PublicIP
}

CBLogger.Debugf("Put \"%v\"", keyNetworkingRuleOfPeer)
doc, _ := json.Marshal(peer)
CBLogger.Debugf("Put - %v", keyNetworkingRuleOfPeer)
CBLogger.Tracef("Value: %#v", peer)

doc, _ := json.Marshal(peer)
if _, err := etcdClient.Put(context.TODO(), keyNetworkingRuleOfPeer, string(doc)); err != nil {
CBLogger.Error(err)
}
Expand All @@ -250,7 +251,7 @@ func watchHostNetworkInformation(wg *sync.WaitGroup, etcdClient *clientv3.Client
func tryToAcquireWorkload(etcdClient *clientv3.Client, controllerID string, key string, revision int64) bool {
CBLogger.Debugf("Start (%s) .........", controllerID)
// Key to lease temporally by which each cb-network controller can distinguish each updated value
keyToLease := fmt.Sprintf("lease/%s-%d", key, revision)
keyToLease := fmt.Sprintf("lease%s-%d", key, revision)
// fmt.Printf("%#v\n", keyPrefix)

// Self-assign a workload by Compare-and-Swap (CAS) and Lease
Expand Down
2 changes: 1 addition & 1 deletion poc-cb-net/cmd/service/cladnet-service.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ func (s *server) CreateCLADNet(ctx context.Context, cladnetSpec *pb.CLADNetSpeci
}

func (s *server) RecommendAvailableIPv4PrivateAddressSpaces(ctx context.Context, ipnets *pb.IPNetworks) (*pb.AvailableIPv4PrivateAddressSpaces, error) {
log.Printf("Received: %v", ipnets.IpNetworks)
log.Printf("Received: %#v", ipnets.IpNetworks)

availableSpaces := nethelper.GetAvailableIPv4PrivateAddressSpaces(ipnets.IpNetworks)
response := &pb.AvailableIPv4PrivateAddressSpaces{
Expand Down
3 changes: 3 additions & 0 deletions poc-cb-net/cmd/test-client/config/template-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ grpc:
service_endpoint: "localhost:8053"
server_port: "8053"
gateway_port: "8052"

# A config for the demo-client as follows:
service_call_method: "grpc" # i.e., "rest" / "grpc"
Loading

0 comments on commit 8ec9e45

Please sign in to comment.