A sub-system of Cloud-Barista Platform to Deploy and Manage Multi-Cloud Infrastructure.
Note for developing and using Cloud-Barista
Cloud-Barista is currently under development. (not v1.0 yet)
We welcome any new suggestions, issues, opinions, and controbutors !
Please note that the functionalities of Cloud-Barista are not stable and secure yet.
Becareful if you plan to use the current release in production.
If you have any difficulties in using Cloud-Barista, please let us know.
(Open an issue or Join the Cloud-Barista Slack)
[English] As an opensource project initiated by Korean members,
we would like to promote participation of Korean contributors during initial stage of this project.
So, CB-Tumblebug Repo will accept use of Korean language in its early stages.
On the other hand, we hope this project flourishes regardless of contributor's country eventually.
So, the maintainers recommend using English at least for the title of Issues, Pull Requests, and Commits,
while CB-Tumblebug Repo accommodates local languages in the contents of them.
[한국어] CB-Tumblebug은 한국에서 시작된 오픈 소스 프로젝트로서
프로젝트의 초기 단계에는 한국 기여자들의 참여를 촉진하고자 합니다.
따라서 초기 단계의 CB-Tumblebug는 한국어 사용을 받아 들일 것입니다.
다른 한편으로, 이 프로젝트가 국가에 관계없이 번성하기를 희망합니다.
따라서 개발 히스토리 관리를 위해 이슈, 풀 요청, 커밋 등의
제목에 대해서는 영어 사용을 권장하며, 내용에 대한 한국어 사용은 수용할 것입니다.
- CB-Tumblebug Execution and Development Environment
- How to contribute on CB-Tumblebug
- How To Run CB-Tumblebug
- CB-Tumblebug build and Execution based on Source Code in detail
- How to use CB-Tumblebug functions
- Linux (Recommended: Ubuntu v18.04)
- Go (Recommended: v1.16)
CB-Tumblebug welcomes improvements from both new and experienced contributors!
Check out CONTRIBUTING.
- Table of Contents
- Install tools and packages required
- Clone CB-Tumblebug
- Set CB-Tumblebug Environmental Variable
- Build CB-Tumblebug and Execute (
make
andmake run
)
- CB-Tumblebug build and Execution based on Source Code in detail
-
Check out CB-Tumblebug image from (https://hub.docker.com/r/cloudbaristaorg/cb-tumblebug/tags)
-
Execute CB-Tumblebug Container
# docker run -p 1323:1323 -p 50252:50252 \ -v ${HOME}/go/src/github.com/cloud-barista/cb-tumblebug/meta_db:/app/meta_db \ --name cb-tumblebug \ cloudbaristaorg/cb-tumblebug:x.x.x
-
Through cb-operator, we can run Cloud-Barista's entire FW including CB-TB at once.
$ git clone https://github.com/cloud-barista/cb-operator.git $ cd cb-operator/src cb-operator/src$ make cb-operator/src$ ./operator
-
Install tools and packages required
-
Install Git, gcc and make
# apt update
# apt install make gcc git
-
Install Go
- Install Go by referencing https://golang.org/dl/ (Version v1.16 or upper: recommended environment)
- Installation Example
wget https://golang.org/dl/go1.16.4.linux-amd64.tar.gz
tar -C /usr/local -xzf go1.16.4.linux-amd64.tar.gz
- add followings on the bottom of
.bashrc
export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin export GOPATH=$HOME/go
source ~/.bashrc
(apply the changes to.bashrc
)
-
-
Clone CB-Tumblebug
# git clone https://github.com/cloud-barista/cb-tumblebug.git $HOME/go/src/github.com/cloud-barista/cb-tumblebug
-
Setting Environmental Variable for executing CB-Tumblebug
- check and configure
cb-tumblebug/conf/setup.env
(CB-Tumblebug environment variable, changes may be required)- run
source setup.env
to apply on the system.
- run
- check and configure
store_conf.yaml
undercb-tumblebug/conf
(cb-store environment variable, changes may be required)- Set store type (NUTSDB or ETCD)
- Address with DB data should be set when configuring NUTSDB(local DB) i (file will be added under
cb-tumblebug/meta_db/dat
as default)
- set and configure
log_conf.yaml
undercb-tumblebug/conf
(cb-log environment variable, changes may be required)
- check and configure
-
Build Command
# cd ~/go/src/github.com/cloud-barista/cb-tumblebug/src # export GO111MODULE=on # make
-
If Swagger API Document needs to be updated run
make swag
atcb-tumblebug/src/
directory.- API document file is created at
cb-tumblebug/src/api/rest/docs/swagger.yaml
directory. - Following API document can be checked on http://localhost:1323/tumblebug/swagger/index.html through web browser. (Automatically provided when CB-Tumblebug is executed)
- API document file is created at
-
Run CB-Spider in another tab
-
# cd ~/go/src/github.com/cloud-barista/cb-tumblebug/src
-
# make run
(or# go run *.go
)CB-Tumblebug server execution screen
██████╗██████╗ ████████╗██████╗ ██╔════╝██╔══██╗ ╚══██╔══╝██╔══██╗ ██║ ██████╔╝█████╗██║ ██████╔╝ ██║ ██╔══██╗╚════╝██║ ██╔══██╗ ╚██████╗██████╔╝ ██║ ██████╔╝ ╚═════╝╚═════╝ ╚═╝ ╚═════╝ ██████╗ ███████╗ █████╗ ██████╗ ██╗ ██╗ ██╔══██╗██╔════╝██╔══██╗██╔══██╗╚██╗ ██╔╝ ██████╔╝█████╗ ███████║██║ ██║ ╚████╔╝ ██╔══██╗██╔══╝ ██╔══██║██║ ██║ ╚██╔╝ ██║ ██║███████╗██║ ██║██████╔╝ ██║ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚═════╝ ╚═╝ Multi-cloud infrastructure management framework ________________________________________________ https://github.com/cloud-barista/cb-tumblebug Access to API dashboard (username: default / password: default) http://xxx.xxx.xxx.xxx:1323/tumblebug/swagger/index.html ⇨ http server started on [::]:1323 ⇨ grpc server started on [::]:50252
Known Errors and Troubleshooting
-
Errors related to
golang.org/x/net/trace
panic: /debug/requests is already registered. You may have two independent copies of golang.org/x/net/trace in your binary, trying to maintain separate state. This may involve a vendor copy of golang.org/x/net/trace.
Solution: Run following to resolve this issue by removing duplicated files.
# rm -rf $GOPATH/src/go.etcd.io/etcd/vendor/golang.org/x/net/trace # make
src/testclient/scripts/
provides a Bashshell-based script that simplifies and automates Complicated MCIS (MC-Infra) provisioning procedures.
- Step 1: [Enter cloud authentication information and test basic information](#enter-cloud-authentication-information and test basic information)
- Step 2: Provisioning Namespace, MCIR, MCIS .etc (Choose between Integrated control test/Individual controls test)
- Individual Control Test (Objected Dependencies should be Considered when testing individuals of Namespace, MCIR, MCIS .etc)
- Integrated Control Test (Recommended)
src/testclient/scripts/sequentialFullTest/
- Step 3: Multi Cloud Infrastructure usecase
- Go to
src/testclient/scripts/
- Create
credentials.conf
credentials.conf
provides basic credentials template of CSPs (AWS, GCP, AZURE, ALIBABA .etc)- Reference
credentials.conf.example
to enter the user's cloud credentials. - How to get CSP credentials
- Configure
conf.env
- Provides basic test information (server endpoint, cloud vision, image name for test, and spec name for test .etc) of CB-Spider and CB-Tumblebug
- Since information on many cloud types has already been investigated and entered, it can be used without modification. (However, it is necessary to check since charging may occur depending on the designated spec.)
- Way to change VM image for test:
IMAGE_NAME[$IX,$IY]=ami-061eb2b23f9f8839c
- Way to change VM spec for test:
SPEC_NAME[$IX,$IY]=m4.4xlarge
- Way to change VM image for test:
testSet.env
설정- Set cloud and Region configurations to be used for MCIS provisioning to files ( copy and utilize 'testSet.env')
- Set Combination of CSP
- Set numbers of CSP combination (change numbers at NumCSP=)
- Combination of CSP can be set by rearranging the orders at L15-L24 (until the numbers configured on NumCSP)
- ex): Combination of aws, alibaba : Change NumCSP=) to NumCSP=2 , and rearrange those
IndexAWS=$((++IX))
,IndexAlibaba=$((++IX))
accordingly.
- Set the region of combination of CSPs
- Go to each CSP setting section
# AWS (Total: 21 Regions)
- Set the numbers of region desired
NumRegion[$IndexAWS]=2
( 2 was set for demo) - Rearrange the orders of the region to selected region desired (The top 2 region will be selected in case
NumRegion[$IndexAWS]=2
)
- Go to each CSP setting section
- Be aware!
- Be aware that creating VMs on public CSPs such as AWS, GCP, Azure, etc. may be billed.
- With the default setting of
testSet.env
, TestClouds (TestCloud01
,TestCloud02
,TestCloud03
) will be used to create mock VMs. TestCloud01
,TestCloud02
,TestCloud03
are not real CSPs. It is used for testing purpose. (not support SSH into VM)- Anyway, please be aware cloud usage cost when you use public CSPs.
- For resource that you want to control, go to following directory to run the test needed
- Since the objects depend on each other, it is desirable to perform them in ascending order with reference to numbers.
1.configureSpider
# Collection of scripts related to cloud information registration2.configureTumblebug
# Collection of scripts related to namespace and dynamic environment settings3.vNet
# Collection of scripts related to creation of MCIR vNet4.securityGroup
# Collection of scripts related to creation of MCIR securityGroup5.sshKey
# Collection of scripts related to creation of MCIR sshKey6.image
# Collection of scripts related to registration of MCIR image7.spec
# Collection of scripts related to registration of MCIR spec8.mcis
# Collection of scripts related of MCIS creation and control, MCIS remote command, etc.9.monitoring
# Collection of scripts of CB-DF Monitoring Agent Installation and Monitoring Test Script through CB-TB
- Since the objects depend on each other, it is desirable to perform them in ascending order with reference to numbers.
- Executing
create-all.sh
andclean-all.sh
undersrc/testclient/scripts/sequentialFullTest/
You can test the entire process can be tested at once. - By running
create-all.sh
andclean-all.sh
insrc/testclient/scripts/sequentialFullTest/
directory,└── sequentialFullTest # Automatic testing of Cloud information registration, NS generation, MCIR generation, and MCIS generation at once. ├── check-test-config.sh # Check the configuration of the multi-cloud infrastructure specified in the current testSet. ├── create-all.sh # Automatic testing of Cloud information registration, NS generation, MCIR generation, and MCIS generation at once. ├── gen-sshKey.sh # Test log that has been executed (generating an SSH key file accessible to MCIS) ├── command-mcis.sh # Execute a remote command to the generated MCIS (multiple VM) ├── deploy-nginx-mcis.sh # Automatically distribute Nginx to the generated MCIS (multiple VM) ├── create-mcis-for-df.sh # Create MCIS for CB-Dragonfly hosting ├── deploy-dragonfly-docker.sh # Automatic distribution of CB-Dragonfly to MCIS and automatic environment configuration. ├── clean-all.sh # Delete all objects in reverse order of creation. └── executionStatus # Test log (information is added when performing testAll, and information is removed when performing cleanAll). You can check the work in progress
- Usage Example
- MCIS creation test
./create-all.sh -n shson -f ../testSetCustom.env
# Performs creation with the cloud combination configured in ../testSetCustom.env- The procedure for confirming the generation of MCIS configured in ../testSetCustom.env proceeds automatically.
- Execution result example
Table: All VMs in the MCIS : cb-shson ID Status PublicIP PrivateIP CloudType CloudRegion CreatedTime -- ------ -------- --------- --------- ----------- ----------- aws-ap-southeast-1-0 Running xx.250.xx.73 192.168.2.180 aws ap-southeast-1 2021-09-17 14:59:30 aws-ca-central-1-0 Running x.97.xx.230 192.168.4.98 aws ca-central-1 2021-09-17 14:59:58 gcp-asia-east1-0 Running xx.229.xxx.26 192.168.3.2 gcp asia-east1 2021-09-17 14:59:42 [DATE: 17/09/2021 15:00:00] [ElapsedTime: 49s (0m:49s)] [Command: ./create-mcis-only.sh all 1 shson ../testSetCustom.env 1] [Executed Command List] [MCIR:aws-ap-southeast-1(28s)] create-mcir-ns-cloud.sh (MCIR) aws 1 shson ../testSetCustom.env [MCIR:aws-ca-central-1(34s)] create-mcir-ns-cloud.sh (MCIR) aws 2 shson ../testSetCustom.env [MCIR:gcp-asia-east1(93s)] create-mcir-ns-cloud.sh (MCIR) gcp 1 shson ../testSetCustom.env [MCIS:cb-shsonvm4(19s+More)] create-mcis-only.sh (MCIS) all 1 shson ../testSetCustom.env [DATE: 17/09/2021 15:00:00] [ElapsedTime: 149s (2m:29s)] [Command: ./create-all.sh -n shson -f ../testSetCustom.env -x 1]
- MCIS removal test (needs to be deleted with input parameters used in creation)
./clean-all.sh -n shson -f ../testSetCustom.env
# Performs removal with the cloud combination configured in ../testSetCustom.env- Be aware!
- If you created MCIS (VMs) for testing in public clouds, the VMs may be charged.
- You need to terminate MCIS by using
clean-all
to avoid unexpected billing. - Anyway, please be aware cloud usage cost when you use public CSPs.
- Create MCIS SSH access key and connect to each VM.
./gen-sshKey.sh -n shson -f ../testSetCustom.env
# Return all VM's access keys configured in MCIS.- Execution Result Example
... [GENERATED PRIVATE KEY (PEM, PPK)] [MCIS INFO: mc-shson] [VMIP]: 13.212.254.59 [MCISID]: mc-shson [VMID]: aws-ap-southeast-1-0 ./sshkey-tmp/aws-ap-southeast-1-shson.pem ./sshkey-tmp/aws-ap-southeast-1-shson.ppk ... [SSH COMMAND EXAMPLE] [VMIP]: 13.212.254.59 [MCISID]: mc-shson [VMID]: aws-ap-southeast-1-0 ssh -i ./sshkey-tmp/aws-ap-southeast-1-shson.pem cb-user@13.212.254.59 -o StrictHostKeyChecking=no ... [VMIP]: 35.182.30.37 [MCISID]: mc-shson [VMID]: aws-ca-central-1-0 ssh -i ./sshkey-tmp/aws-ca-central-1-shson.pem cb-user@35.182.30.37 -o StrictHostKeyChecking=no
- MCIS creation test
I/O Examples
~/go/src/github.com/cloud-barista/cb-tumblebug/src/testclient/scripts/sequentialFullTest$ `./create-all.sh -n shson -f ../testSetCustom.env`
####################################################################
## Create MCIS from Zero Base
####################################################################
[Test for AWS]
####################################################################
## 0. Create Cloud Connection Config
####################################################################
[Test for AWS]
{
"ProviderName" : "AWS",
"DriverLibFileName" : "aws-driver-v1.0.so",
"DriverName" : "aws-driver01"
}
..........
"RegionName" : "aws-us-east-1"
}
{
"CredentialName" : "aws-credential01",
"RegionName" : "aws-us-east-1",
"DriverName" : "aws-driver01",
"ConfigName" : "aws-us-east-1",
"ProviderName" : "AWS"
}
####################################################################
## 0. Namespace: Create
####################################################################
{
"message" : "The namespace NS-01 already exists."
}
####################################################################
## 1. vpc: Create
####################################################################
[Test for AWS]
{
"subnetInfoList" : [
{
"IId" : {
"SystemId" : "subnet-0ab25b7090afa97b7",
"NameId" : "aws-us-east-1-shson"
},
................
"status" : "",
"name" : "aws-us-east-1-shson",
"keyValueList" : null,
"connectionName" : "aws-us-east-1",
"cspVNetId" : "vpc-0e3004f28e8a89057"
}
Dozing for 10 : 1 2 3 4 5 6 7 8 9 10 (Back to work)
####################################################################
## 2. SecurityGroup: Create
####################################################################
[Test for AWS]
{
"keyValueList" : [
{
"Value" : "aws-us-east-1-shson-delimiter-aws-us-east-1-shson",
"Key" : "GroupName"
},
{
"Key" : "VpcID",
...........
"name" : "aws-us-east-1-shson",
"description" : "test description",
"cspSecurityGroupId" : "sg-033e4b7c42671873c",
"id" : "aws-us-east-1-shson"
}
Dozing for 10 : 1 2 3 4 5 6 7 8 9 10 (Back to work)
####################################################################
## 3. sshKey: Create
####################################################################
[Test for AWS]
{
"name" : "aws-us-east-1-shson",
"fingerprint" : "d2:1a:a0:6d:b3:f7:8e:b7:44:9f:13:9c:d6:e3:a8:c3:58:8c:de:27",
..............
"id" : "aws-us-east-1-shson",
"description" : "",
"privateKey" : "-----BEGIN RSA PRIVATE KEY-----\nMIIEogIBAAKCAQ\ KEY-----",
"username" : ""
}
####################################################################
## 4. image: Register
####################################################################
[Test for AWS]
{
"keyValueList" : [
{
"Key" : "",
"Value" : ""
},
{
"Value" : "",
"Key" : ""
}
],
"description" : "Canonical, Ubuntu, 18.04 LTS, amd64 bionic",
"cspImageName" : "",
"connectionName" : "aws-us-east-1",
"status" : "",
"creationDate" : "",
"cspImageId" : "ami-085925f297f89fce1",
"name" : "aws-us-east-1-shson",
"guestOS" : "Ubuntu",
"id" : "aws-us-east-1-shson"
}
####################################################################
## 5. spec: Register
####################################################################
[Test for AWS]
{
"mem_MiB" : "1024",
"max_num_storage" : "",
........
"mem_GiB" : "1",
"id" : "aws-us-east-1-shson",
"num_core" : "",
"cspSpecName" : "t2.micro",
"storage_GiB" : "",
"ebs_bw_Mbps" : "",
"connectionName" : "aws-us-east-1",
"net_bw_Gbps" : "",
"gpu_model" : "",
"cost_per_hour" : "",
"name" : "aws-us-east-1-shson"
}
####################################################################
## 6. vm: Create MCIS
####################################################################
[Test for AWS]
{
"targetAction" : "Create",
"status" : "Running-(3/3)",
"id" : "aws-us-east-1-shson",
"name" : "aws-us-east-1-shson",
"description" : "Tumblebug Demo",
"targetStatus" : "Running",
"placementAlgo" : "",
"vm" : [
{
"vmUserId" : "",
"targetStatus" : "None",
"subnetId" : "aws-us-east-1-shson",
"location" : {
"nativeRegion" : "us-east-1",
"cloudType" : "aws",
"latitude" : "38.1300",
"briefAddr" : "Virginia",
"longitude" : "-78.4500"
},
"vm_accessId" : "",
"region" : {
"Region" : "us-east-1",
"Zone" : "us-east-1f"
},
"imageId" : "aws-us-east-1-shson",
"privateDNS" : "ip-192-168-1-108.ec2.internal",
"vmBootDisk" : "/dev/sda1",
"status" : "Running",
"security_groupIds" : [
"aws-us-east-1-shson"
],
"vm_access_passwd" : "",
.........
"VMUserId" : "",
"SecurityGroupIIds" : [
{
"SystemId" : "sg-033e4b7c42671873c",
"NameId" : "aws-us-east-1-shson"
}
],
"VMBootDisk" : "/dev/sda1",
"PrivateDNS" : "ip-192-168-1-108.ec2.internal",
"StartTime" : "2020-05-30T18:33:42Z",
"VMBlockDisk" : "/dev/sda1",
"ImageIId" : {
"SystemId" : "ami-085925f297f89fce1",
"NameId" : "ami-085925f297f89fce1"
}
},
"publicIP" : "35.173.215.4",
"name" : "aws-us-east-1-shson-01",
"id" : "aws-us-east-1-shson-01",
"vnetId" : "aws-us-east-1-shson",
"sshKeyId" : "aws-us-east-1-shson",
"privateIP" : "192.168.1.108",
"config_name" : "aws-us-east-1",
"vmBlockDisk" : "/dev/sda1",
"targetAction" : "None",
"description" : "description",
"specId" : "aws-us-east-1-shson",
"publicDNS" : "",
"vmUserPasswd" : ""
},
{
"vmBlockDisk" : "/dev/sda1",
"targetAction" : "None",
"description" : "description",
"specId" : "aws-us-east-1-shson",
"vmUserPasswd" : "",
..........
}
]
}
Dozing for 1 : 1 (Back to work)
####################################################################
## 6. VM: Status MCIS
####################################################################
[Test for AWS]
{
"targetStatus" : "None",
"id" : "aws-us-east-1-shson",
"targetAction" : "None",
"vm" : [
{
"publicIp" : "35.173.215.4",
"nativeStatus" : "Running",
"cspId" : "aws-us-east-1-shson-01",
"name" : "aws-us-east-1-shson-01",
"status" : "Running",
"targetAction" : "None",
"targetStatus" : "None",
"id" : "aws-us-east-1-shson-01"
},
{
"name" : "aws-us-east-1-shson-02",
"status" : "Running",
"targetAction" : "None",
"targetStatus" : "None",
"id" : "aws-us-east-1-shson-02",
"publicIp" : "18.206.13.233",
"cspId" : "aws-us-east-1-shson-02",
"nativeStatus" : "Running"
},
{
"targetAction" : "None",
"id" : "aws-us-east-1-shson-03",
"targetStatus" : "None",
"name" : "aws-us-east-1-shson-03",
"status" : "Running",
"cspId" : "aws-us-east-1-shson-03",
"nativeStatus" : "Running",
"publicIp" : "18.232.53.134"
}
],
"status" : "Running-(3/3)",
"name" : "aws-us-east-1-shson"
}
[Logging to notify latest command history]
[Executed Command List]
[CMD] create-all.sh gcp 1 shson
[CMD] create-all.sh alibaba 1 shson
[CMD] create-all.sh aws 1 shson
[Executed Command List] contains the history of the command performed. (Can be checked by following command cat ./executionStatus )
- Access status can be checked through SSH remote command execution.
- command-mcis.sh # execute command on MCIS(multiple VM) created.
- Execution Example
./create-all.sh -n shson -f ../testSet.env
# Create VM based on information in testSet.env./command-mcis.sh -n shson -f ../testSet.env
# Check IP and Hostname of all VMs in MCIS
- Distribute Nginx to test web server access.
- deploy-nginx-mcis.sh # Automatic deployment of Nginx on MCIS(multiple VM) created.
- Execution example
- deploy-nginx-mcis.sh -n shson -f ../testSetAws.env # Install Ngnix and webpages based on information in testSet.env on all VMs of MCIS.
- Create required VM resources(MCIR) Through CB-Tumblebug Multi Cloud Interface Resource(MCIR) management API
- Through CB-Tumblebug Multi Cloud Infra Service(MCIS) Management API, create, check, control, send command, termination, and deletion of MCIS.
Thanks goes to these wonderful people (emoji key):