CB-Tumblebug (Multi-Cloud Infra Service Management)



A sub-system of Cloud-Barista Platform to Deploy and Manage Multi-Cloud Infrastructure.
Note for developing and using Cloud-Barista
Development stage of 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)
Localization and Globalization of CB-Tumblebug (CB-Tumblebug의 현지화 및 세계화)
[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 실행 및 개발 환경
- CB-Tumblebug 기여 방법
- CB-Tumblebug 실행 방법
- CB-Tumblebug 소스 빌드 및 실행 방법 상세
- CB-Tumblebug 기능 사용 방법
CB-Tumblebug 실행 및 개발 환경
- Linux (추천: Ubuntu v18.04)
- Go (추천: v1.16)
CB-Tumblebug 기여 방법
CB-Tumblebug welcomes improvements from all contributors, new and experienced!
(1) 기여의 종류
- Issue 오픈
- Bug report, Enhancement request, Feature request, ...
- PR (Pull-Request) 오픈
- Documentation, Source code, ...
(2) 기여 가이드
CB-Tumblebug 실행 방법
(1) 소스 코드 기반 설치 및 실행
- 개요
- 필요 패키지/도구 설치
- CB-Tumblebug 소스 다운로드 (Git clone CB-Tumblebug)
- CB-Tumblebug 환경 변수 설정
- CB-Tumblebug 빌드 및 실행 (
make 및 make run)
- 소스 빌드 및 실행 방법 상세
(2) 컨테이너 기반 실행
# docker run -p 1323:1323 -p 50252:50252 \
-v /root/go/src/github.com/cloud-barista/cb-tumblebug/meta_db:/app/meta_db \
--name cb-tumblebug \
cloudbaristaorg/cb-tumblebug:0.4.xx
(3) cb-operator 기반 Cloud-Barista 통합 실행
- cb-operator를 통해 CB-TB를 포함한 Cloud-Barista 전체 FW를 통합 실행 가능
$ git clone https://github.com/cloud-barista/cb-operator.git
$ cd cb-operator/src
cb-operator/src$ make
cb-operator/src$ ./operator
CB-Tumblebug 소스 빌드 및 실행 방법 상세
(1) CB-Tumblebug 빌드 환경 구성
(2) CB-Tumblebug 빌드
# cd ~/go/src/github.com/cloud-barista/cb-tumblebug/src
# export GO111MODULE=on
# make
- Swagger API 문서 업데이트 필요 시
cb-tumblebug/src/ 에서 make swag 실행
(3) CB-Tumblebug 실행
-
CB-Spider 실행 (다른 탭에서)
-
# cd ~/go/src/github.com/cloud-barista/cb-tumblebug/src
-
# make run (또는 # go run *.go)
CB-Tumblebug 서버 실행 화면
██████╗██████╗ ████████╗██████╗
██╔════╝██╔══██╗ ╚══██╔══╝██╔══██╗
██║ ██████╔╝█████╗██║ ██████╔╝
██║ ██╔══██╗╚════╝██║ ██╔══██╗
╚██████╗██████╔╝ ██║ ██████╔╝
╚═════╝╚═════╝ ╚═╝ ╚═════╝
██████╗ ███████╗ █████╗ ██████╗ ██╗ ██╗
██╔══██╗██╔════╝██╔══██╗██╔══██╗╚██╗ ██╔╝
██████╔╝█████╗ ███████║██║ ██║ ╚████╔╝
██╔══██╗██╔══╝ ██╔══██║██║ ██║ ╚██╔╝
██║ ██║███████╗██║ ██║██████╔╝ ██║
╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚═════╝ ╚═╝
Multi-cloud infrastructure managemenet 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?url=http://xxx.xxx.xxx.xxx:1323/tumblebug/swaggerActive
⇨ http server started on [::]:1323
⇨ grpc server started on [::]:50252
-
알려진 에러 및 해결 방법
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 vendored copy of golang.org/x/net/trace.
에러 발생 시, 다음을 실행하여 해결
# rm -rf $GOPATH/src/go.etcd.io/etcd/vendor/golang.org/x/net/trace
# make
CB-Tumblebug 기능 사용 방법
- CB-Tumblebug 스크립트 사용
- CB-Tumblebug REST API 사용
CB-Tumblebug 스크립트 사용
src/testclient/scripts/는 복잡한 단계가 필요한 MCIS (MC-Infra) 프로비저닝 절차를 간소화 및 자동화시킨 Bash shell 기반 스크립트를 제공.
- 1 단계: 클라우드 인증 정보 및 테스트 기본 정보 입력
- 2 단계: Namespace, MCIR, MCIS 등 프로비저닝 (통합 제어 / 개별 제어 중 선택)
- 개별 제어 시험 (Namespace, MCIR, MCIS 등 개별 시험시, 오브젝트들의 의존성 고려 필수)
- 통합 제어 시험 (추천 테스트 방법)
src/testclient/scripts/sequentialFullTest/
- 3 단계: [멀티 클라우드 인프라 유스케이스 자동 배포](#멀티-클라우드-인프라-유스케이스
클라우드 인증 정보 및 테스트 기본 정보 입력
src/testclient/scripts/ 이동
credentials.conf 생성
conf.env 설정
- CB-Spider 및 CB-Tumblebug 서버 엔드포인트, 클라우드 리젼, 테스트용 이미지명, 테스트용 스팩명 등 테스트 기본 정보 제공
- 이미 많은 클라우드 타입에 대한 정보가 조사 및 입력되어 있으므로, 수정없이 사용 가능. (단, 지정된 Spec에 따라 과금이 발생할 수 있으므로 확인 필요)
testSet.env 설정
- MCIS 프로비저닝에 사용될, 클라우드 및 리전 구성을 파일로 설정 (기존의
testSet.env 를 변경해도 되고, 복사하여 활용도 가능)
- 조합할 CSP 종류 지정
- 조합할 총 CSP 개수 지정 (NumCSP= 에 숫자를 변경)
- 조합할 CSP 종류는 L15-L24의 라인 상 순서를 변경하여 지정 (NumCSP에 지정된 개수까지 활용)
- 예: aws, alibaba 로 조합하고 싶은 경우: NumCSP=2 로 변경하고,
IndexAWS=$((++IX)), IndexAlibaba=$((++IX)) 순으로 재정렬
- 조합할 CSP의 리전 지정
- 각 CSP 설정 항목으로 이동
# AWS (Total: 21 Regions)
NumRegion[$IndexAWS]=2 에서 구성하고 싶은 리전의 수를 지정 (예시에서는 2로 지정)
- 리전 리스트의 라인 순서를 변경하여 원하는 리전으로 셋팅 (
NumRegion[$IndexAWS]=2 인 경우 가장 위에 나열된 2개의 리전이 선택)
- 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.
개별 제어 시험
- 제어하고 싶은 리소스 오브젝트에 대해, 해당 디렉토리로 이동하여 필요한 시험 수행
- 오브젝트는 서로 의존성이 있으므로, 번호를 참고하여 오름차순으로 수행하는 것이 바람직함
1.configureSpider # 클라우드 정보 등록 관련 스크립트 모음
2.configureTumblebug # 네임스페이스 및 동적 환경 설정 관련 스크립트 모음
3.vNet # MCIR vNet 생성 관련 스크립트 모음
4.securityGroup # MCIR securityGroup 생성 관련 스크립트 모음
5.sshKey # MCIR sshKey 생성 관련 스크립트 모음
6.image # MCIR image 등록 관련 스크립트 모음
7.spec # MCIR spec 등록 관련 스크립트 모음
8.mcis # MCIS 생성 및 제어, MCIS 원격 커맨드 등 스크립트 모음
9.monitoring # CB-TB를 통해서 CB-DF 모니터링 에이전트 설치 및 모니터링 테스트 스크립트 모음
통합 제어 시험
src/testclient/scripts/sequentialFullTest/ 에 포함된 create-all.sh 및 clean-all.sh 을 수행하면 전체 과정을 한번에 테스트 가능
└── sequentialFullTest # Cloud 정보 등록, NS 생성, MCIR 생성, MCIS 생성까지 한번에 자동 테스트
├── check-test-config.sh # 현재 testSet에 지정된 멀티 클라우드 인프라 구성을 확인
├── create-all.sh # Cloud 정보 등록, NS 생성, MCIR 생성, MCIS 생성까지 한번에 자동 테스트
├── gen-sshKey.sh # 수행이 진행된 테스트 로그 (MCIS에 접속 가능한 SSH키 파일 생성)
├── command-mcis.sh # 생성된 MCIS(다중VM)에 원격 명령 수행
├── deploy-nginx-mcis.sh # 생성된 MCIS(다중VM)에 Nginx 자동 배포
├── create-mcis-for-df.sh # CB-Dragonfly 호스팅을 위한 MCIS 생성
├── deploy-dragonfly-docker.sh # MCIS에 CB-Dragonfly 자동 배포 및 환경 자동 설정
├── clean-all.sh # 모든 오브젝트를 생성의 역순으로 삭제
└── executionStatus # 수행이 진행된 테스트 로그 (testAll 수행시 정보가 추가되며, cleanAll 수행시 정보가 제거됨. 진행중인 작업 확인 가능)
- 사용 예시
- 테스트 형상 확인
./check-test-config.sh -n shson -f ../testSetCustom.env # ../testSetCustom.env 에 구성된 조합을 미리 확인 (사용되는 CSP, region, image, spec 등)
- 생성 테스트
./create-all.sh -n shson -f ../testSetCustom.env # ../testSetCustom.env 에 구성된 클라우드 조합으로 MCIS 생성 수행
- 제거 테스트 (생성에서 활용한 입력 파라미터로 삭제 필요)
./clean-all.sh -n shson -f ../testSetCustom.env # ../testSetCustom.env 에 구성된 클라우드 조합으로 제거 수행
- Be aware!
- If you created MCIS (VMs) for testing in public clouds, the VMs may be charged.
- You need to termiate MCIS by using
clean-all to avoid unexpected billing.
- Anyway, please be aware cloud usage cost when you use public CSPs.
입출력 예시 보기
~/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 Connction 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] 에는 수행한 커맨드의 히스토리가 포함됨.
(cat ./executionStatus 를 통해 다시 확인 가능)
멀티 클라우드 인프라 유스케이스
MCIS SSH 원격 커맨드
- SSH 원격 커맨드 실행을 통해서 접속 여부 등을 확인 가능
- command-mcis.sh # 생성된 MCIS(다중VM)에 원격 명령 수행
- 실행 예시
./create-all.sh -n shson -f ../testSet.env # testSet.env 에 구성된 정보를 기준으로 MCIS 생성
./command-mcis.sh -n shson -f ../testSet.env # MCIS의 모든 VM에 IP 및 Hostname 조회를 수행
MCIS SSH 접속키 생성 및 접속
- 스크립트를 통해 MCIS의 VM에 각각 접속할 수 있는 SSH Key 및 주소를 생성
- gen-sshKey.sh # MCIS에 구성된 모든 VM의 접속키 리턴
- 실행 예시
./create-all.sh -n shson -f ../testSetAws.env # testSetAws.env 에 구성된 정보를 기준으로 MCIS 생성
./gen-sshKey.sh -n shson -f ../testSetAws.env # MCIS에 구성된 모든 VM의 접속키 리턴
son@son:~/go/src/github.com/cloud-barista/cb-tumblebug/src/testclient/scripts/sequentialFullTest$ ./gen-sshKey.sh -n shson -f ../testSetAws.env
...
[GENERATED PRIVATE KEY (PEM, PPK)]
[MCIS INFO: mc-shson]
[VMIP]: 13.212.254.59 [MCISID]: mc-shson [VMID]: aws-ap-se-1-0
./sshkey-tmp/aws-ap-se-1-shson.pem
./sshkey-tmp/aws-ap-se-1-shson.ppk
...
[SSH COMMAND EXAMPLE]
[VMIP]: 13.212.254.59 [MCISID]: mc-shson [VMID]: aws-ap-se-1-0
ssh -i ./sshkey-tmp/aws-ap-se-1-shson.pem cb-user@13.212.254.59 -o StrictHostKeyChecking=no
...
[VMIP]: 35.182.30.37 [MCISID]: mc-shson [VMID]: aws-ca-ct-1-0
ssh -i ./sshkey-tmp/aws-ca-ct-1-shson.pem cb-user@35.182.30.37 -o StrictHostKeyChecking=no
MCIS Nginx 분산 배치
- Nginx를 분산 배치하여, 웹서버 접속 시험 가능
- deploy-nginx-mcis.sh # 생성된 MCIS(다중VM)에 Nginx 자동 배포
- 실행 예시
- deploy-nginx-mcis.sh -n shson -f ../testSetAws.env # testSetAws.env 에 구성된 정보를 기준으로 MCIS의 모든 VM에 Nginx 및 웹페이지 설치
MCIS Weave Scope 클러스터 모니터링 분산 배치
MCIS Jitsi 영상 회의 배치
MCIS Ansible 실행 환경 자동 구성
MCIS 토이 게임 서버 배치
CB-Tumblebug REST API 사용
- CB-Spider API를 통해 클라우드 인프라 연동 정보 등록
- CB-Tumblebug 멀티 클라우드 네임스페이스 관리 API를 통해서 Namespace 생성
- CB-Tumblebug 멀티 클라우드 인프라 자원(MCIR) 관리 API를 통해서 VM 생성을 위한 자원 (MCIR) 생성
- CB-Tumblebug 멀티 클라우드 인프라 서비스(MCIS) 관리 API를 통해서 MCIS 생성, 조회, 제어, 원격명령수행, 종료 및 삭제
Contributors ✨
Thanks goes to these wonderful people (emoji key):
License
