-
Notifications
You must be signed in to change notification settings - Fork 69
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
[Mizar-Arktos-Integration]Tenant-vpc-support: finalize code changes for mizar pod controller and mizar arktos network controller after successful integration tests #1281
[Mizar-Arktos-Integration]Tenant-vpc-support: finalize code changes for mizar pod controller and mizar arktos network controller after successful integration tests #1281
Conversation
…etwork controller after successful integration tests between mizar team and arktos team
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 - it has been verified working; already met bar of poc.
the PR description claims that it YES has user exposable changes - in that case, please provide more detail about the change.
@@ -0,0 +1,26 @@ | |||
#!/usr/bin/env bash |
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.
just for curiosity: is this file auto generated, or authored by hand?
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.
This file is authored by hand after I see the file 'hack/update-generated.sh' as benchmark for quickly generating the file pkg/controller/mizar/builtins.pb.go after the file pkg/controller/mizar/builtins.proto is changed.
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.
I can see a lot of similarity of hack/update-generated-protobuf.sh and this file. Note update-generated-protobuf is automatically called in make update but this script needs to be manually run for code generation. We need to make this code generation automated.
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.
Will do in master branch
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.
I updated builtins.proto for type definition, run update-generated-mizar.sh, there is no code update. I wonder how your script work?
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.
Needs ubuntu 18.04 or upper, install protobuf-compiler first: "sudo apt install -y protobuf-compiler". "protoc --version" needs to be 3.0 or upper.
@@ -0,0 +1,93 @@ | |||
#!/usr/bin/env bash |
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.
Did you come up the entire script of copied from somewhere? If later, please specify the source.
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.
Add the comments below in this script.
"This cript is created based on hack/lib/protoc.sh and is made with minor changes"
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.
Is there a reason that we cann't make minor change to hack/lib/protoc.sh and reuse the code. I can see a lot of code is same between the two files. No reason to maintain two copies of similar code.
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.
I ever attempted to try this idea. But the new code changes for hack/lib/protoc.sh are related to too many other codes because other codes will call the functions inside hack/lib/protoc.sh, which needs more time to do tests. So I temporarily give up this idea in POC.
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.
Will do in master branch.
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.
Please note many of the suggestions are for master code standard. They should not block the code from checking into POC branch. Feel free to merge the code and refactor the code later.
@@ -0,0 +1,93 @@ | |||
#!/usr/bin/env bash |
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.
Is there a reason that we cann't make minor change to hack/lib/protoc.sh and reuse the code. I can see a lot of code is same between the two files. No reason to maintain two copies of similar code.
@@ -0,0 +1,26 @@ | |||
#!/usr/bin/env bash |
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.
I can see a lot of similarity of hack/update-generated-protobuf.sh and this file. Note update-generated-protobuf is automatically called in make update but this script needs to be manually run for code generation. We need to make this code generation automated.
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: h-w-chen, Sindica The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Yes, we need time to figure out how to automatically generate. |
If only for auto code generating, just add your function into hack/make-rules/update.sh |
ToDo for master branch:
|
Please hold on for item 1,2,3, as Vinay's proof of concept demo for option 3, there is no need for Mizar controllers. Hence, all the above suggested improvement won't be needed. |
What type of PR is this?
/kind feature
What this PR does / why we need it:
In terms of the design document at https://github.com/CentaurusInfra/arktos/blob/poc-2022-01-30/docs/design-proposals/multi-tenancy/multi-tenancy-network-mizar-integration.md, this PR implements the following two functions:
The json template files for Mizar CRDs - VPC and Subnet are located as default at the directory ./hack/runtime/.
./hack/runtime/default_mizar_network_subnet_template.json (the below is an example)
./hack/runtime/default_mizar_network_vpc_template.json (the below is an example)
Which issue(s) this PR fixes:.
The new feature is part of Mizar Arktos integration.
Fixes # N/A
Special notes for your reviewer:
This PR is clean version based on working PR 1248, which is used for integration tests between arktos team and mizar team.
Test steps:
Note: These steps have been tested with system tenant in Carl's local dev environment which runs the codes in poc-2022-01-30 branch q131172019:CarlXie-poc-2022-01-30-tenant-vpc-support,
OS: AWS EC2 instance running Ubuntu 20.04
Protobuf-Compiler: 3.6.1 (sudo apt install -y protobuf-compiler; protoc --version)
1.2) Run script "hack/update-generated-mizar.sh'" to regenerate gRPC codes including the file pkg/controller/mizar/builtins.pb.go if you make the changes in the mizar grpc proto file pkg/controller/mizar/builtins.proto
1.3) Run command "CNIPLUGIN=mizar ./hack/arktos-up.sh" to start Arktos scale-up cluster with Mizar. Or follow up the steps 0.6) through step 1 at https://github.com/q131172019/arktos/blob/CarlXie_singleNodeArktosCluster/docs/setup-guide/single-node-dev-scale-up-cluster-with-Mizar.md to ensure Mizar CRDs and pods are in Running state, especially check whether CRDs - vpc (system-default-network) and subnet (system-default-network-subnet) as well as dividers and bouncers of tenant 'system' are created correctly based on above two template files of VPC and Subnet .
2.1) Use the following yaml file to create two nginx pods of tenant 'system'
~/TMP/mizar/pod-vpc-1-without-annotation.yaml
2.2) Check whether the annotations including two mizar CRDs - vpc and subnet are correctly added into two nginx pods
2.3) Check whether two nginx pods can communicate each other via curl
3.1) Create non-system tenant 'aaa'
3.2) Check whether non-system tenant aaa's mizar CRDs are created successfully
3.3) Use the following yaml file to create two nginx pods of non-system tenant 'aaa'
~/TMP/mizar/pod-vpc-1-without-annotation.aaa.yaml
3.4) Check whether the annotations including two mizar CRDs - vpc and subnet are correctly added into non-system tenant aaa's two nginx pods
3.5) Check whether non-system tenant aaa's two nginx pods can communicate each other via curl
4.1) Get IPs of all pods including system tenant's nginx pods and non-system tenant's nginx pods
4.2) Test whether system tenant's two nginx pods SHOULD not talk with non-system tenant aaa's two nginx pods
4.3) Test whether non-system tenant aaa's two nginx pods SHOULD not talk with system tenant's two nginx pods
5.1) Delete non-system tenant 'aaa'
5.2) Delete system tenant's two nginx pods
Does this PR introduce a user-facing change?:
No.