-
Notifications
You must be signed in to change notification settings - Fork 51
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 Cloud Adaptive Network configuration when creating MCIS #1054
Add Cloud Adaptive Network configuration when creating MCIS #1054
Conversation
- Create `networking.go` - Add configureCloudAdaptiveNetwork() to `provisioning.go` - Update `go.mod` and `go.sum`
src/core/mcis/provisioning.go
Outdated
@@ -965,6 +970,13 @@ func CreateMcis(nsId string, req *TbMcisReq, option string) (*TbMcisInfo, error) | |||
} | |||
} | |||
|
|||
// Configure Cloud Adaptive Network | |||
if true { //mcisTmp.ConfigureCloudAdaptiveNetwork != "no" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
조건(true)는 향후 mcisTmp.ConfigureCloudAdaptiveNetwork != "no"
와 같이 변경할 예정입니다 ^^
(현재는 테스트를 위해 true로 지정)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
네, 맞습니다 ^^
src/core/mcis/provisioning.go
Outdated
// // ConfigureCloudAdaptiveNetwork is an option to configure Cloud Adaptive Network (CLADNet) ([yes/no] default:yes) | ||
// ConfigureCloudAdaptiveNetwork string `json:"configureCloudAdaptiveNetwork" example:"yes" default:"yes" enums:"yes,no"` // yes or no | ||
|
||
if (req.InstallMonAgent != "no" || option != "register") || true { // mcisTmp.ConfigureCloudAdaptiveNetwork != "no" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
조건(true)은 향후 mcisTmp.ConfigureCloudAdaptiveNetwork != "no"
와 같이 변경할 예정입니다 ^^
(현재는 테스트를 위해 true로 지정)
누락된 부분이 있어 말씀 드립니다.
앞으로 원활한 테스트를 위해 상시 구동환경을 구축해 놓을 예정입니다 😃 |
src/core/mcis/networking.go
Outdated
common.CBLog.Debug("Start.........") | ||
|
||
// Check cb-network endpoints | ||
gRPCServiceEndpoint, etcdEndpoints, err := checkCBNetworkEndpoints() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gRPCServiceEndpoint, etcdEndpoints, err := checkCBNetworkEndpoints() | |
networkServiceEndpoint, etcdEndpoints, err := checkCBNetworkEndpoints() |
gRPCServiceEndpoint 값에는 아마
CB_NETWORK_SERVICE_ENDPOINT=localhost:8053
가 입력되는 것 같네요.
gRPC는 프로토콜(방법)에 대한 상세 사항이고,
현재 코드가 REST로 처리되고 있는 것으로 봐서,
굳이 방법 자체를 변수명에 포함할 필요가 없다는 생각이 듭니다. (전반적으로)
아마 etcdEndpoints 와의 구분을 위해서 특정하신 것 같기도 합니다만.. ^^
어떻게 생각하시나요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yunkon-kim 아, 그리고 MCIS Provisioning 단계에 포함하기 이전에 예를 들면, CB-DF Agent도 구동 중인 MCIS에 별도의 API로 설치할 수 있도록 (개발자용) API를 제공하고 있습니당. POST GET |
말씀해주신 방향으로 진행하면 통합 작업이 한결 수월하겠네요. 감사합니다 ^^ |
- Reset `provisioning.go` and add variables related to the cb-network agent - Add a REST API to configure Cloud Adaptive Network to MCIS
말씀하신 내용을 바탕으로 수정 반영 하였고요.
cb-network agent 설치 여부를 체크하기 위하여 추가하였고요. 추가한 변수가 API 등 다른 부분에 많은 영향을 줄지 문의 드립니다. (영향을 주는 부분이 많다면 다른 방법을 강구해보겠습니다 ^^;;) type TbMcisInfo struct {
Id string `json:"id"`
Name string `json:"name"`
Status string `json:"status"`
StatusCount StatusCountInfo `json:"statusCount"`
TargetStatus string `json:"targetStatus"`
TargetAction string `json:"targetAction"`
// InstallMonAgent Option for CB-Dragonfly agent installation ([yes/no] default:yes)
InstallMonAgent string `json:"installMonAgent" example:"yes" default:"yes" enums:"yes,no"` // yes or no
+ // ConfigureCloudAdaptiveNetwork is an option to configure Cloud Adaptive Network (CLADNet) ([yes/no] default:yes)
+ ConfigureCloudAdaptiveNetwork string `json:"configureCloudAdaptiveNetwork" example:"yes" default:"yes" enums:"yes,no"` // yes or no
// Label is for describing the mcis in a keyword (any string can be used)
Label string `json:"label" example:"User custom label"`
// SystemLabel is for describing the mcis in a keyword (any string can be used) for special System purpose
SystemLabel string `json:"systemLabel" example:"Managed by CB-Tumblebug" default:""`
PlacementAlgo string `json:"placementAlgo,omitempty"`
Description string `json:"description"`
Vm []TbVmInfo `json:"vm"`
} // TbVmInfo is struct to define a server instance object
type TbVmInfo struct {
Id string `json:"id"`
Name string `json:"name"`
IdByCSP string `json:"idByCSP"` // CSP managed ID or Name
// defined if the VM is in a group
VmGroupId string `json:"vmGroupId"`
Location common.GeoLocation `json:"location"`
// Required by CB-Tumblebug
Status string `json:"status"`
TargetStatus string `json:"targetStatus"`
TargetAction string `json:"targetAction"`
// Montoring agent status
MonAgentStatus string `json:"monAgentStatus" example:"[installed, notInstalled, failed]"` // yes or no// installed, notInstalled, failed
+ // NetworkAgent status
+ NetworkAgentStatus string `json:"networkAgentStatus" example:"[notInstalled, installing, installed, failed]"` // notInstalled, installing, installed, failed
// Latest system message such as error message
SystemMessage string `json:"systemMessage" example:"Failed because ..." default:""` // systeam-given string message
// Created time
CreatedTime string `json:"createdTime" example:"2022-11-10 23:00:00" default:""`
Label string `json:"label"`
Description string `json:"description"`
Region RegionInfo `json:"region"` // AWS, ex) {us-east1, us-east1-c} or {ap-northeast-2}
PublicIP string `json:"publicIP"`
SSHPort string `json:"sshPort"`
PublicDNS string `json:"publicDNS"`
PrivateIP string `json:"privateIP"`
PrivateDNS string `json:"privateDNS"`
RootDiskType string `json:"rootDiskType"`
RootDiskSize string `json:"rootDiskSize"`
RootDeviceName string `json:"rootDeviceName"`
VMBootDisk string `json:"vmBootDisk"` // ex) /dev/sda1
VMBlockDisk string `json:"vmBlockDisk"`
ConnectionName string `json:"connectionName"`
SpecId string `json:"specId"`
ImageId string `json:"imageId"`
VNetId string `json:"vNetId"`
SubnetId string `json:"subnetId"`
SecurityGroupIds []string `json:"securityGroupIds"`
SshKeyId string `json:"sshKeyId"`
VmUserAccount string `json:"vmUserAccount,omitempty"`
VmUserPassword string `json:"vmUserPassword,omitempty"`
CspViewVmDetail SpiderVMInfo `json:"cspViewVmDetail,omitempty"`
} VM에 마킹하는 부분 // AddVmToMcis is func to add VM to MCIS
func AddVmToMcis(wg *sync.WaitGroup, nsId string, mcisId string, vmInfoData *TbVmInfo, option string) error {
...
// Monitoring Agent Installation Status (init: notInstalled)
vmInfoData.MonAgentStatus = "notInstalled"
+ vmInfoData.NetworkAgentStatus = "notInstalled"
...
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
export CB_NETWORK_SERVICE_ENDPOINT=localhost:8053
export CB_NETWORK_ETCD_ENDPOINTS='["localhost:2379"]'
@yunkon-kim 이 두 세트만 구성하면, 제가 테스트해볼 수 있나요?
src/core/mcis/provisioning.go
Outdated
@@ -167,6 +167,9 @@ type TbMcisInfo struct { | |||
// InstallMonAgent Option for CB-Dragonfly agent installation ([yes/no] default:yes) | |||
InstallMonAgent string `json:"installMonAgent" example:"yes" default:"yes" enums:"yes,no"` // yes or no | |||
|
|||
// ConfigureCloudAdaptiveNetwork is an option to configure Cloud Adaptive Network (CLADNet) ([yes/no] default:yes) | |||
ConfigureCloudAdaptiveNetwork string `json:"configureCloudAdaptiveNetwork" example:"yes" default:"yes" enums:"yes,no"` // yes or no |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ConfigureCloudAdaptiveNetwork string `json:"configureCloudAdaptiveNetwork" example:"yes" default:"yes" enums:"yes,no"` // yes or no | |
ConfigureCloudAdaptiveNetwork string `json:"configureCloudAdaptiveNetwork" example:"yes" default:"no" enums:"yes,no"` // yes or no |
아직 특별한 상관은 없지만~
까먹기 전에 표기해두었습니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
다음번 Commit에서
default: "no"
수정사항 반영하곘습니다. -
테스트와 관련해서 제가 한세트 구성한 후 정보 공유 드리겠습니다 😄
export CB_NETWORK_SERVICE_ENDPOINT=localhost:8053 export CB_NETWORK_ETCD_ENDPOINTS='["localhost:2379"]'
@yunkon-kim 이 두 세트만 구성하면, 제가 테스트해볼 수 있나요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
테스트에 필요한 환경은 구성을 완료하였습니다. (정보는 Slack으로 공유 드리겠습니다 ^^)
그런데 테스트를 위해서 간단한 논의가 필요할 것 같습니다.
API를 먼저 추가하고 테스트를 진행하는 방식으로 변경 하면서 환경변수에 Endpoint 정보를 불러보는 부분을 제거했네요 ^^;;;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(최근 Commit)
API 호출시 Endpoints 가 전달되지 않을 경우 환경변수에서 불러오기를 시도하도록 변경하였습니다 ^^
- Read the endpoints from the env if not passed as a parameter
- Update method of endpoints passing or reading - Fix invaild memory access
아래 사항 개선하여 Commit 하였습니다 ^^
아래 테스트를 진행했고, 이슈는 없었습니다.
Swagger update 사항은 자동 생성 방식을 따르는게 좋을 것 같아 제외하였습니다. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM :)
MCIS 생성 시 Cloud Adaptive Network를 배치(configuration)하기 위한 PR 입니다.
현재 초기 버전이고 논의를 통해 개선해 나가고자 합니다 ^^
주요 변경 사항
networking.go
provisioning.go
go.mod
andgo.sum
테스트
/tumblebug/ns/{nsId}/mcisDynamic
API를 통한 테스트 및 디버깅 수행예정 사항
소스코드의 여러 부분에 영향을 줄 것 같습니다. 주의사항/팁이 있으시면 공유 부탁드립니다 ^^
provisioning.go
에서 Cloud Adaptive Network 배치 구분 추가현재 3곳 중 1곳에 적용 및 테스트한 상황으로 아래 함수에서 CB-Dragonfly agent 부분에 추가 예정