Coder Social home page Coder Social logo

cloud-barista / cb-tumblebug Goto Github PK

View Code? Open in Web Editor NEW
39.0 8.0 43.0 32.62 MB

Cloud-Barista Multi-Cloud Infra Management Framework

License: Apache License 2.0

Shell 29.45% Go 69.54% Makefile 0.05% Dockerfile 0.14% Python 0.82%
cloud cloud-computing multi-cloud vm multicloud cb-tumblebug csp cloud-barista iaas cb-spider

cb-tumblebug's Introduction

CB-Tumblebug (Multi-Cloud Infra Service Management)

Go Report Card Build Top Language GitHub go.mod Go version Repo Size GoDoc Swagger API Doc

Release Version Pre Release Version License Slack

All Contributors

A sub-system of Cloud-Barista Platform to Deploy and Manage Multi-Cloud Infrastructure.

[Note] CB-Tumblebug is currently under development
CB-Tumblebug is currently under development. (not v1.0 yet)
We welcome any new suggestions, issues, opinions, and contributors !
Please note that the functionalities of Cloud-Barista are not stable and secure yet.
Be careful 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)
[Note] Localization and Globalization of CB-Tumblebug
Since CB-Tumblebug was 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는 한국어 사용을 받아 들일 것입니다.
다른 한편으로, 이 프로젝트가 국가에 관계없이 번성하기를 희망합니다.
따라서 개발 히스토리 관리를 위해 이슈, 풀 요청, 커밋 등의 
제목에 대해서는 영어 사용을 권장하며, 내용에 대한 한국어 사용은 수용할 것입니다.

[한국어, English]



목차

  1. CB-Tumblebug 실행 및 개발 환경
  2. CB-Tumblebug 기여 방법
  3. CB-Tumblebug 실행 방법
  4. CB-Tumblebug 소스 빌드 및 실행 방법 상세
  5. CB-Tumblebug 기능 사용 방법


CB-Tumblebug 실행 및 개발 환경

  • Linux (추천: Ubuntu 22.04)
  • Go (추천: v1.21.6)

의존성 리스트 (SBOM)



CB-Tumblebug 기여 방법

CB-Tumblebug welcomes improvements from both new and experienced contributors!

Check out CONTRIBUTING.



CB-Tumblebug 실행 방법

(1) 소스 코드 기반 설치 및 실행

  • 개요
    • 필요 패키지/도구 설치
    • CB-Tumblebug 소스 다운로드 (Git clone CB-Tumblebug)
    • CB-Tumblebug 환경 변수 설정
    • CB-Tumblebug 빌드 및 실행 (makemake run)
  • 소스 빌드 및 실행 방법 상세

(2) 컨테이너 기반 실행

  • CB-Tumblebug 이미지 확인(https://hub.docker.com/r/cloudbaristaorg/cb-tumblebug/tags)

  • CB-Tumblebug 컨테이너 실행

    ./scripts/runTumblebug.sh

    or

    docker run -p 1323:1323 \
    -v ${HOME}/go/src/github.com/cloud-barista/cb-tumblebug/meta_db:/app/meta_db \
    --name cb-tumblebug \
    cloudbaristaorg/cb-tumblebug:x.x.x

(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 빌드 환경 구성

  • 필요 패키지 또는 도구 설치

    • Git, gcc, make 설치
      sudo apt update
      sudo apt install make gcc git
    • Go 설치
      • https://golang.org/dl/ 를 참고하여 Go 설치 (추천 개발 환경: Go v1.21.6 이상)
      • 설치 예시
        • Go 다운로드 및 압축 해제
          wget https://go.dev/dl/go1.21.6.linux-amd64.tar.gz;
          sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.21.6.linux-amd64.tar.gz
        • .bashrc 파일 하단에 다음을 추가
          echo 'export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin' >> ~/.bashrc
          echo 'export GOPATH=$HOME/go' >> ~/.bashrc
        • .bashrc 변경 내용을 적용하고 설치 현황 확인
          source ~/.bashrc
          echo $GOPATH
          go env
          go version
  • CB-Tumblebug 소스 다운로드

    • CB-Tumblebug 저장소 클론

      git clone --depth 1 https://github.com/cloud-barista/cb-tumblebug.git $HOME/go/src/github.com/cloud-barista/cb-tumblebug
      cd ~/go/src/github.com/cloud-barista/cb-tumblebug

      --depth 1 옵션은 commit 히스토리를 제한적으로 다운로드하여 용량을 줄이므로, 기여를 위해서는 해당 옵션을 지정하지 않거나 하기 명령어로 commit 히스토리를 다시 다운로드하는 것을 권장.

      git fetch --unshallow
    • CB-Tumblebug 디렉토리 이동 alias 등록 (편의를 위한 선택 사항. cdtb, cbtbsrc, cdtbtest 키워드로 디렉토리 이동)

      echo "alias cdtb='cd $HOME/go/src/github.com/cloud-barista/cb-tumblebug'" >> ~/.bashrc
      echo "alias cdtbsrc='cd $HOME/go/src/github.com/cloud-barista/cb-tumblebug/src'" >> ~/.bashrc
      echo "alias cdtbtest='cd $HOME/go/src/github.com/cloud-barista/cb-tumblebug/src/testclient/scripts'" >> ~/.bashrc
      source ~/.bashrc

(2) CB-Tumblebug 빌드

  • 빌드 실행

    cd ~/go/src/github.com/cloud-barista/cb-tumblebug/src
    make

    의존성이 있는 패키지는 자동 다운로드됨. 처음 빌드하는 경우 시간이 다소 소요되며, 이후 Go 빌드 캐시를 통해 빌드 속도가 향상됨.

  • (참고) Swagger API 문서 업데이트 필요 시 cb-tumblebug/src/ 에서 make swag 실행

(3) CB-Tumblebug 실행

  • CB-Spider 실행 CB-Tumblebug은 클라우드 제어를 위해서 CB-Spider를 활용(필수 구동)

    • (추천 실행 방법) CB-TB 스크립트를 통한 CB-Spider 컨테이너 실행 (가급적 지정된 버전 사용)
      cd ~/go/src/github.com/cloud-barista/cb-tumblebug
      ./scripts/runSpider.sh
      Docker가 설치되어 있어야 하며 설치되어 있지 않은 경우, 아래 스크립트 활용 가능 (프로덕션용 구성은 아님)
      cd ~/go/src/github.com/cloud-barista/cb-tumblebug
      ./scripts/installDocker.sh
      
      컨테이너 이외의 설치 방법은 CB-Spider 참고
  • CB-Tumblebug 실행에 필요한 환경변수 설정 (다른 탭에서)

    • cb-tumblebug/conf/setup.env 내용 확인 및 설정 (CB-Tumblebug 환경변수, 필요에 따라 변경)
      • 환경변수를 시스템에 반영
        cd ~/go/src/github.com/cloud-barista/cb-tumblebug
        source conf/setup.env
      • (참고) 필요에 따라 SELF_ENDPOINT 환경변수(외부에서 접속 가능한 주소)를 스크립트를 통해 자동으로 지정
        • CB-Tumblebug을 실행하면 Swagger API Dashboard가 활성화되며, 외부에서 Dashboard에 접속 및 제어하려는 경우에 필요
        cd ~/go/src/github.com/cloud-barista/cb-tumblebug
        source ./scripts/setPublicIP.sh
    • cb-tumblebug/confstore_conf.yaml 내용 확인 및 설정 (cb-store 환경변수, 필요에 따라 변경)
      • storetype 지정 (NUTSDB 또는 ETCD 지정)
      • NUTSDB(local DB) 설정시 DB 데이터가 포함된 주소 지정이 필요 (기본은 cb-tumblebug/meta_db/dat 에 파일로 추가됨)
  • CB-Tumblebug 실행

    cd ~/go/src/github.com/cloud-barista/cb-tumblebug/src
    make run

    또는 CB-Tumblebug 스크립트를 통한 CB-Tumblebug 컨테이너 실행

    cd ~/go/src/github.com/cloud-barista/cb-tumblebug
    export CBTUMBLEBUG_ROOT=$HOME/go/src/github.com/cloud-barista/cb-tumblebug
    ./scripts/runTumblebug.sh

    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/api
    
    ⇨ http server started on [::]:1323
    
    • cb-tumblebug/conf/setup.env 기본 설정 활용시, 시스템 로그는 cb-tumblebug/log/tumblebug.log에 저장됨 (log는 zerolog를 통해 기록)

(4) CB-Tumblebug 멀티 클라우드 환경 설정

  • 클라우드 credential 등록을 위한 credentials.conf 생성 및 정보 입력

    • 개요
      • credentials.conf 는 CB-TB가 지원하는 클라우드 타입 (AWS, GCP, AZURE, ALIBABA 등)에 대해 사용자 인증 정보를 입력 및 보관하는 파일
      • conf/template.credentials.conf를 참조하여 credentials.conf 파일 생성 및 내용 입력 필요
    • 파일 생성 방법: CB-TB 스크립트를 통해 credentials.conf 파일 자동 생성
      cd ~/go/src/github.com/cloud-barista/cb-tumblebug
      ./scripts/genCredencialFile.sh
    • 정보 입력 방법: conf/credentials.conf에 사용자 정보 입력 (참고: CSP별 인증 정보 획득 방법)
  • 모든 멀티 클라우드 연결 정보 및 공통 자원 등록

    • 개요
      • CB-TB의 멀티클라우드 인프라를 생성하기 위해서 클라우드에 대한 연결 정보 (크리덴셜, 클라우드 종류, 클라우드 리젼 등), 공통 활용 이미지 및 스펙 등의 등록이 필요
    • 등록 방법: initMultiCloudEnv.sh 스크립트 실행 (모든 확인 메시지에 대해 'y' 입력)
      cd ~/go/src/github.com/cloud-barista/cb-tumblebug
      ./scripts/initMultiCloudEnv.sh

(5) CB-Tumblebug 서버 종료 및 버전 업그레이드

  • CB-Tumblebug & CB-Spider 서버 종료

    • CB-Spider: ctrl+c 를 통해서 서버 종료
    • CB-Tumblebug: ctrl+c 를 통해서 서버 종료 (종료 이벤트 발생시, Graceful shutdown이 동작: 10초 내에 처리 가능한 API 요청 마무리)
    • 시스템 내부 오류 등 정리가 필요한 경우
      • CB-Tumblebug을 통해 생성한 자원 확인 및 삭제
      • CB-Tumblebug & CB-Spider 메타데이터 삭제
        cd ~/go/src/github.com/cloud-barista/cb-tumblebug
        ./scripts/cleanDB.sh
  • CB-Tumblebug & CB-Spider 버전 업그레이드시 (업그레이드의 영향을 명확하게 파악하고 있는 경우 하기 정리 작업 불필요)

    • CB-Tumblebug을 통해 생성한 자원 확인 및 삭제
    • CB-Tumblebug & CB-Spider 메타데이터 삭제
      cd ~/go/src/github.com/cloud-barista/cb-tumblebug
      ./scripts/cleanDB.sh
    • 업그레이드된 버전으로 재구동


CB-Tumblebug 기능 사용 방법

  1. CB-Tumblebug MapUI 사용
  2. CB-Tumblebug REST API 사용
  3. CB-Tumblebug 스크립트 사용

CB-Tumblebug MapUI 사용

  • CB-MapUI 를 통해 MCIS 생성, 형상 확인 및 제어 가능
    • CB-Tumblebug은 지도 형태로 MCIS 배포 형상 확인을 위해 CB-MapUI를 활용
    • (추천 실행 방법) CB-TB 스크립트를 통한 CB-MapUI 컨테이너 실행
      cd ~/go/src/github.com/cloud-barista/cb-tumblebug
      ./scripts/runMapUI.sh
    • 웹브라우저에서 http://{HostIP}:1324 에 접속하여 활용 image

CB-Tumblebug REST API 사용

  1. CB-Tumblebug 멀티 클라우드 네임스페이스 관리 API를 통해서 Namespace 생성
  2. CB-Tumblebug 멀티 클라우드 인프라 자원(MCIR) 관리 API를 통해서 VM 생성을 위한 자원 (MCIR) 생성
  3. CB-Tumblebug 멀티 클라우드 인프라 서비스(MCIS) 관리 API를 통해서 MCIS 생성, 조회, 제어, 원격명령수행, 종료 및 삭제
  4. CB-Tumblebug 최적 배치 및 동적 프로비저닝

CB-Tumblebug 스크립트 사용

src/testclient/scripts/는 복잡한 단계가 필요한 MCIS (MC-Infra) 프로비저닝 절차를 간소화 및 자동화시킨 Bash shell 기반 스크립트를 제공.

클라우드 인증 정보 및 테스트 기본 정보 입력

  1. src/testclient/scripts/ 이동
  2. conf.env 설정
    • CB-Spider 및 CB-Tumblebug 서버 엔드포인트, 클라우드 리젼, 테스트용 이미지명, 테스트용 스팩명 등 테스트 기본 정보 제공
    • 이미 많은 클라우드 타입에 대한 정보가 조사 및 입력되어 있으므로, 수정없이 사용 가능. (단, 지정된 Spec에 따라 과금이 발생할 수 있으므로 확인 필요)
  3. 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 모니터링 에이전트 설치 및 모니터링 테스트 스크립트 모음
      • 10.nlb # NLB 관련 스크립트 모음
      • 11.dataDisk # dataDisk 관련 스크립트 모음
      • 12.customImage # customImage 관련 스크립트 모음
      • 13.cluster # K8s cluster 관련 스크립트 모음

통합 제어 시험

  • src/testclient/scripts/sequentialFullTest/ 에 포함된 create-all.shclean-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  # 모든 오브젝트를 생성의 역순으로 삭제
        ├── create-cluster-only.sh # testSet에 지정된 멀티 클라우드 인프라를 대상으로 K8s 클러스터를 생성
        ├── get-cluster.sh # testSet에 지정된 멀티 클라우드 인프라를 대상으로 K8s 클러스터 정보를 얻음
        ├── clean-cluster-only.sh # testSet에 지정된 멀티 클라우드 인프라를 대상으로 K8s 클러스터를 삭제
        ├── force-clean-cluster-only.sh # testSet에 지정된 멀티 클라우드 인프라를 대상으로 K8s 클러스터를 강제 삭제
        ├── add-nodegroup.sh # 생성된 K8s 클러스터에 신규 노드그룹을 생성
        ├── remove-nodegroup.sh # 생성된 K8s 클러스터에 생성된 신규 노드그룹을 삭제
        ├── set-nodegroup-autoscaling.sh # 생성된 노드그룹의 오토스케일링 설정값을 off로 변경
        ├── change-nodegroup-autoscalesize.sh # 생성된 노드그룹의 오토스케일 크기를 변경
        ├── deploy-weavescope-to-cluster.sh # 생성된 K8s 클러스터에 weavescope를 배포
        └── executionStatus  # 수행이 진행된 테스트 로그 (testAll 수행시 정보가 추가되며, cleanAll 수행시 정보가 제거됨. 진행중인 작업 확인 가능)
    
    
  • 사용 방식
    • MCIS 생성 테스트

      • ./create-all.sh -n shson -f ../testSetCustom.env # ../testSetCustom.env 에 구성된 클라우드 조합으로 MCIS 생성 수행
      • ../testSetCustom.env에 구성된 MCIS 생성 형상을 확인하는 절차 자동으로 진행
      • 실행 결과 예시
        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 제거 테스트 (생성에서 활용한 입력 파라미터로 삭제 필요)

      • ./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.
    • MCIS SSH 접속키 생성 및 각 VM에 접속

      • ./gen-sshKey.sh -n shson -f ../testSetCustom.env # MCIS에 구성된 모든 VM의 접속키 리턴
      • 실행 결과 예시
        ...
        [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 [email protected] -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 [email protected] -o StrictHostKeyChecking=no
        
    • MCIS SSH 원격 커맨드 실행을 통해 VM 통합 커맨드 확인

      • ./command-mcis.sh -n shson -f ../testSetCustom.env # MCIS의 모든 VM에 IP 및 Hostname 조회를 수행
    • K8s 클러스터 테스트 (WIP: CSP별 안정화 작업 진행 중)

      • initMultiCloudEnv.sh를 사전 실행함을 가정
      • ./create-mcir-ns-cloud.sh -n tb -f ../testSet.env # K8s 클러스터 생성에 필요한 MCIR 생성
      • ./create-cluster-only.sh -n tb -f ../testSet.env -x 1 -z 1 # K8s 클러스터를 생성(-x 최대노드수 -z 노드그룹 및 클러스터 추가 이름)
      • ./get-cluster.sh -n tb -f ../testSet.env -z 1 # K8s 클러스터 정보 얻기
      • ./add-nodegroup.sh -n tb -f ../testSet.env -x 1 -z 1 # K8s 클러스터에 신규 노드 그룹 추가
      • ./change-nodegroup-autoscalesize.sh -n tb -f ../testSet.env -x 1 -z 1 # 신규 노드 그룹의 autoscale size를 기존+1로 변경
      • ./deploy-weavescope-to-cluster.sh -n tb -f ../testSet.env -y n # 생성한 클러스터에 weascope를 배포
      • ./set-nodegroup-autoscaling.sh -n tb -f ../testSet.env -z 1 # 신규 노드그룹의 autosacling 설정값을 off로 변경
      • ./remove-nodegroup.sh -n tb -f ../testSet.env -z 1 # 신규 생성한 노드그룹을 삭제
      • ./clean-cluster-only.sh -n tb -f ../testSet.env -z 1 # 생성한 K8s 클러스터를 삭제
      • ./force-clean-cluster-only.sh -n tb -f ../testSet.env -z 1 # 생성한 K8s 클러스터를 삭제가 되지 않는 경우 강제 삭제
      • ./clean-mcir-ns-cloud.h -n tb -f ../testSet.env # 생성한 MCIR 삭제
입출력 예시 보기
~/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",
         "status" : "Running",
         "security_groupIds" : [
            "aws-us-east-1-shson"
         ],
         "vm_access_passwd" : "",
 .........
            "VMUserId" : "",
            "SecurityGroupIIds" : [
               {
                  "SystemId" : "sg-033e4b7c42671873c",
                  "NameId" : "aws-us-east-1-shson"
               }
            ],
            "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에 Nginx 분산 배치
  • deploy-nginx-mcis.sh # 생성된 MCIS(다중VM)에 Nginx 자동 배포
MCIS Weave Scope 클러스터 모니터링 분산 배치
MCIS Jitsi 영상 회의 배치
MCIS Ansible 실행 환경 자동 구성
MCIS 토이 게임 서버 배치
MCIS Xonotic(3D FPS) 게임 서버 배치


Contributors ✨

Thanks goes to these wonderful people (emoji key):

Seokho Son
Seokho Son

🚧 🤔 💻 👀
Jihoon Seo
Jihoon Seo

🚧 🤔 💻 👀
Yunkon (Alvin) Kim
Yunkon (Alvin) Kim

🤔 💻 👀
jmleefree
jmleefree

💻 👀
ByoungSeob Kim
ByoungSeob Kim

🤔
Sooyoung Kim
Sooyoung Kim

🐛 🤔
KANG DONG JAE
KANG DONG JAE

🤔
Youngwoo-Jung
Youngwoo-Jung

🤔
Sean Oh
Sean Oh

🤔
MZC-CSC
MZC-CSC

🐛 🤔
Eunsang
Eunsang

📓
hyokyungk
hyokyungk

📓
pjini
pjini

📓
sunmi
sunmi

📓
sglim
sglim

📖 💻
jangh-lee
jangh-lee

📖 💻
이도훈
이도훈

📖 💻
Park Beomsu
Park Beomsu

💻
Hassan Alsamahi
Hassan Alsamahi

💻
Taegeon An
Taegeon An

💻
INHYO
INHYO

💻
Modney
Modney

📖 💻
Seongbin Bernie Cho
Seongbin Bernie Cho

💻 📖
Gibaek Nam
Gibaek Nam

💻
Abidin Durdu
Abidin Durdu

💻
soyeon Park
soyeon Park

💻
Jayita Pramanik
Jayita Pramanik

📖
Mukul Kolpe
Mukul Kolpe

📖
EmmanuelMarianMat
EmmanuelMarianMat

💻
Carlos Felix
Carlos Felix

💻
Stuart Gilbert
Stuart Gilbert

💻
Ketan Deshmukh
Ketan Deshmukh

💻
Tríona Barrow
Tríona Barrow

💻
BamButz
BamButz

💻
dogfootman
dogfootman

📓
Okhee Lee
Okhee Lee

📓
joowon
joowon

📓
Sanghong Kim
Sanghong Kim

💻
Rohit Rajput
Rohit Rajput

💻
Arshad
Arshad

💻
Jongwoo Han
Jongwoo Han

💻


License

FOSSA Status


cb-tumblebug's People

Contributors

allcontributors[bot] avatar arshad-k7 avatar atg0831 avatar bconfiden2 avatar betelgeuse-7 avatar cat-taesik avatar cb-github-robot avatar chobobdev avatar computerphilosopher avatar dependabot[bot] avatar fossabot avatar github-actions[bot] avatar hassanalsamahi avatar hermitkim1 avatar jangh-lee avatar jayita10 avatar jihoon-seo avatar jmleefree avatar leedohun avatar limsg1234 avatar modney avatar parkinhyo avatar polkabunny avatar powerkimhub avatar prow-for-cloud-barista[bot] avatar prow-v2[bot] avatar rohit-r2000 avatar seokho-son avatar sypark9646 avatar yunkon-kim avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cb-tumblebug's Issues

CB-Spider 의 connection_name 수신 방식 변경에 대한 대응

Need to extract core codes from rest api funcs to support gRPC

이슈

  • CB-Tumblebug은 현재 REST API를 통한 인터페이스만 제공하고 있으나, 향후 gRPC를 통한 제어도 지원하고자 합니다.

해결 방법

  • REST API 처리를 위한 API 리소스 함수에서 기능 함수 분리 및 재정의
  • REST API에 해당하는 gRPC를 위한 함수 생성

gRPC 컨트리뷰션 작업 소스코드 가이드라인

  • gRPC 서비스를 제공하기 위한 컨트리뷰션 가이드라인은 다음과 같습니다.
    • 일반적인 함수(리소스 오브젝트에 대한 CRUD)인 경우 #173 의 방식(네임스페이스에 대한 처리 완료)을 준용하여 REST 리소스 함수에서 기능 함수 분리
      • REST 리소스 함수 내용 정리 (기능에 관련된 코드 제거)
      • 기능에 관련된 코드를 신규 기능 함수로 생성
      • 일관성 유지를 위한 기능 함수의 명칭 수정 등 수행
    • 일반적인 함수가 아니고 REST 리소스 함수의 내용이 복잡하여, 기능 함수명을 특정하기 어려운 경우, 신규 기능 함수명에 임의의 prefix(core)를 추가 (예: func RestPostMcis 의 경우, 신규 생성 함수의 명칭은 func CorePostMcis 으로 지정
      • 해당 함수들의 명칭은 향후 업스트림에 머지 시 전체적으로 수정될 예정
    • 추가되는 함수 및 함수의 명칭 수정은 기존 .go 파일에서 작업 진행 (예: src/common/namespace.go 에 있는 func RestGetNs 를 정리하여 func GetNs를 신규 생성하는 경우 동일한 namespace.go 에 생성
    • 작업 대상 소스 (및 작업 순서)

gRPC 컨트리뷰션 워크플로우 가이드라인

Suggestion: code separation by file

As-is:

[mcism_master.go]

  • struct definitions
    • vmReq
    • mcisReq
    • mcisInfo
    • vmInfo
    • vmStatusInfo
  • func apiServer()
  • func main()
  • func nsValidation()
  • func rest*Mcis()
  • func addVmToMcis
  • func updateVmInfo
  • func getMcisList
  • func getVmList
  • func delMcis
  • func createMcis
  • func createVm
  • func terminateMcis
  • func terminateVm
  • func genUuid()
  • func insertAgent
  • func getVmIp
  • func monitorVm

[mcism_resource_manage_image.go]

  • struct definitions
    • nsReq
    • nsInfo
    • imageReq
    • imageInfo
  • func rest*Ns()
  • func createNs
  • func getNsList
  • func delNs
  • func checkNs
  • func rest*Image()
  • func createImage
  • func registerImage
  • func getImageList
  • func delImage

To-be:

[mcism_main.go]

  • func apiServer()
  • func main()
  • func genUuid()

[mcism_namespace.go]

  • struct definitions
    • nsReq
    • nsInfo
  • func nsValidation()
  • func rest*Ns()
  • func createNs
  • func getNsList
  • func delNs
  • func checkNs

[mcism_mcis.go]

  • struct definitions
    • mcisReq
    • mcisInfo
    • vmReq
    • vmInfo
    • vmStatusInfo
  • func rest*Mcis()
  • func addVmToMcis
  • func updateVmInfo
  • func getMcisList
  • func getVmList
  • func delMcis
  • func createMcis
  • func createVm
  • func terminateMcis
  • func terminateVm
  • func insertAgent
  • func getVmIp
  • func monitorVm

[mcism_resource_manage_image.go]

  • struct definitions
    • imageReq
    • imageInfo
  • func rest*Image()
  • func createImage
  • func registerImage
  • func getImageList
  • func delImage

Info: JSON input/output of CreateMcis() will be changed

Ref: @dev4unet @jazmandorf (cb-webtool might need some updates)


As-is:

[Request]

...
"vm": [ {
                        "name": "'${CONN_CONFIG[$INDEX,$REGION]}'-'${POSTFIX}'-01",
                        "config_name": "'${CONN_CONFIG[$INDEX,$REGION]}'",
                        "image_id": "'${CONN_CONFIG[$INDEX,$REGION]}'-'${POSTFIX}'",
                        "ssh_key_id": "'${CONN_CONFIG[$INDEX,$REGION]}'-'${POSTFIX}'",
                        "spec_id": "'${CONN_CONFIG[$INDEX,$REGION]}'-'${POSTFIX}'",
                        "security_group_ids": [
                                "'${CONN_CONFIG[$INDEX,$REGION]}'-'${POSTFIX}'"
                        ],
                        "vnet_id": "'${CONN_CONFIG[$INDEX,$REGION]}'-'${POSTFIX}'",
                        "subnet_id": "'${CONN_CONFIG[$INDEX,$REGION]}'-'${POSTFIX}'",
                        "description": "description",
                        "vm_access_id": "cb-user",
                        "vm_access_passwd": ""
                },
...

[Response]


To-be:

cb-tumblebug/test/official/6.mcis/create-mcis.sh aws 1 jhseo

[Request]

{
                "name": "'${CONN_CONFIG[$INDEX,$REGION]}'-'${POSTFIX}'",
                "description": "Tumblebug Demo",
                "vm": [ {
                        "name": "'${CONN_CONFIG[$INDEX,$REGION]}'-'${POSTFIX}'-01",
                        "imageId": "'${CONN_CONFIG[$INDEX,$REGION]}'-'${POSTFIX}'",
                        "vmUserAccount": "cb-user",
                        "connectionName": "'${CONN_CONFIG[$INDEX,$REGION]}'",
                        "sshKeyId": "'${CONN_CONFIG[$INDEX,$REGION]}'-'${POSTFIX}'",
                        "specId": "'${CONN_CONFIG[$INDEX,$REGION]}'-'${POSTFIX}'",
                        "securityGroupIds": [
                                "'${CONN_CONFIG[$INDEX,$REGION]}'-'${POSTFIX}'"
                        ],
                        "vNetId": "'${CONN_CONFIG[$INDEX,$REGION]}'-'${POSTFIX}'",
                        "subnetId": "'${CONN_CONFIG[$INDEX,$REGION]}'-'${POSTFIX}'",
                        "description": "description",
                        "vmUserPassword": ""
                }
            ]
        }

[Response]

{
   "vm" : [
      {
         "vmBootDisk" : "/dev/sda1",
         "vmUserPassword" : "",
         "vmUserId" : "",
         "specId" : "aws-us-east-1-jhseo",
         "privateDNS" : "ip-192-168-1-33.ec2.internal",
         "publicIP" : "3.84.238.186",
         "region" : {
            "Region" : "us-east-1",
            "Zone" : "us-east-1e"
         },
         "connectionName" : "aws-us-east-1",
         "targetAction" : "None",
         "securityGroupIds" : [
            "aws-us-east-1-jhseo"
         ],
         "vmBlockDisk" : "/dev/sda1",
         "imageId" : "aws-us-east-1-jhseo",
         "vmUserAccount" : "",
         "sshKeyId" : "aws-us-east-1-jhseo",
         "publicDNS" : "",
         "cspViewVmDetail" : {
            "Name" : "",
            "VPCName" : "",
            "SecurityGroupIIds" : [
               {
                  "SystemId" : "sg-0d455f6e1e2327732",
                  "NameId" : "aws-us-east-1-jhseo"
               }
            ],
            "NetworkInterface" : "eni-attach-0c401cb286c87c54b",
            "ImageIId" : {
               "SystemId" : "ami-085925f297f89fce1",
               "NameId" : "ami-085925f297f89fce1"
            },
            "PrivateDNS" : "ip-192-168-1-33.ec2.internal",
            "ImageName" : "",
            "StartTime" : "2020-07-01T02:00:08Z",
            "PublicDNS" : "",
            "KeyValueList" : [
               {
                  "Value" : "running",
                  "Key" : "State"
               },
               {
                  "Value" : "x86_64",
                  "Key" : "Architecture"
               },
               {
                  "Value" : "vpc-0b3f0f47cffb47f40",
                  "Key" : "VpcId"
               },
               {
                  "Value" : "subnet-092a30316dfb67011",
                  "Key" : "SubnetId"
               },
               {
                  "Value" : "aws-us-east-1-jhseo",
                  "Key" : "KeyName"
               }
            ],
            "SecurityGroupNames" : null,
            "SubnetName" : "",
            "IId" : {
               "NameId" : "aws-us-east-1-jhseo-01",
               "SystemId" : "i-0007a4a800ead78a1"
            },
            "VMUserId" : "",
            "KeyPairIId" : {
               "SystemId" : "aws-us-east-1-jhseo",
               "NameId" : "aws-us-east-1-jhseo"
            },
            "SubnetIID" : {
               "SystemId" : "subnet-092a30316dfb67011",
               "NameId" : "aws-us-east-1-jhseo"
            },
            "VMBlockDisk" : "/dev/sda1",
            "VMSpecName" : "t2.micro",
            "KeyPairName" : "",
            "VMBootDisk" : "/dev/sda1",
            "PrivateIP" : "192.168.1.33",
            "VMUserPasswd" : "",
            "PublicIP" : "3.84.238.186",
            "Region" : {
               "Zone" : "us-east-1e",
               "Region" : "us-east-1"
            },
            "VpcIID" : {
               "SystemId" : "vpc-0b3f0f47cffb47f40",
               "NameId" : "aws-us-east-1-jhseo"
            }
         },
         "privateIP" : "192.168.1.33",
         "subnetId" : "aws-us-east-1-jhseo",
         "vmUserPasswd" : "",
         "vNetId" : "aws-us-east-1-jhseo",
         "description" : "description",
         "targetStatus" : "None",
         "name" : "aws-us-east-1-jhseo-01",
         "id" : "aws-us-east-1-jhseo-01",
         "status" : "Running",
         "location" : {
            "briefAddr" : "Virginia",
            "cloudType" : "aws",
            "latitude" : "38.1300",
            "longitude" : "-78.4500",
            "nativeRegion" : "us-east-1"
         }
      }
   ],
   "description" : "Tumblebug Demo",
   "name" : "aws-us-east-1-jhseo",
   "targetStatus" : "Running",
   "id" : "aws-us-east-1-jhseo",
   "targetAction" : "Create",
   "status" : "Running-(3/3)",
   "placement_algo" : ""
}

Suggestion: Move RestXxx functions into src/api/rest

As-is:
RestXxx functions are in

  • src/common/namespace.go
  • src/common/utility.go
  • src/mcir/common.go
  • src/mcir/image.go
  • src/mcir/securitygroup.go
  • src/mcir/spec.go
  • src/mcir/sshkey.go
  • src/mcir/vnet.go
  • src/mcis/control.go
  • src/mcis/utility.go

To-be:
RestXxx functions are in

  • src/api/rest/xxx.go

Issue: GCP does not accept upper case for resource name

@seokho-son @powerkimhub

일단은: Spider & TB 테스트 스크립트들에서, 리소스 이름을 소문자로만 사용하도록 변경되었습니다.

  • 리소스 이름에 underscore 를 넣으면 안 되는 CSP 도 있습니다.

향후:

  1. 사용자에게, 리소스 이름에 대문자를 넣지 말고 소문자로만 쓰라고 명시한다.
  2. 사용자가 제시한 리소스 이름에 대문자가 있는지 체크하는 로직을 웹도구에 넣는다.
    (문제점: 웹도구를 쓰지 않고 Spider & TB 에 직접 API call 을 날리는 경우가 있을 수도 있음)
  3. 사용자가 제시한 리소스 이름에 대문자가 있는지 체크하는 로직을 Spider & TB 에 넣는다.
  4. ...

Enhance source code tree and names

Let's enhance source code tree and names.

I suggest as follows,
cb-tumblebug/
----------------/README.md
----------------config/
------------------------setup.env
------------------------log_conf.yaml
------------------------store_conf.yaml
----------------doc/
----------------source/
------------------------apiserver.go (mcism_server.go)
------------------------common/
-----------------------------------utility.go (some common utilities in mcism_server.go)
-----------------------------------namespace.go (mcism_namespace.go)
------------------------mcir/
-------------------------------image.go (mcir_image.go)
-------------------------------spec.go (mcir_spec.go)
....
-------------------------------vnic.go (mcir_vnic.go)
------------------------mcism/
--------------------------------control.go (mcism_mcis.go)
--------------------------------(will be extende)

Spider 리모델링에 대한 대응

[2020-04-22 (수) 이메일]

  • 연결설정(ConnectionConfig) 등록: 기존 방법과 동일
  • 변경 인터페이스 및 Full 기능 시험 도구: 아래 내용 참조

<인터페이스/통합시험도구>

  • 위치: cb-spider/api-runtime/rest-runtime/test/full-test/*

  • 1.aws-test.sh: 통합 시험 완료 --> TB AWS로 통합 시작

    • 1.aws-test.sh 내부: 연결설정이름과 이미지이름 설정
    • 실행: 특별한 에러 메시지가 출력 없으면, AWS 기반 현재 CB-Spider full 기능 성공
    • CB-Spider REST API 및 예시: ./full_test.sh 내용 참조
  • 2.azure-test.sh: 현재 디버깅 중

    • 연결설정 및 이미지 설정 외에 AWS와 동일

<이슈/계획>

  • Azure 통합 디버깅
  • New Driver 통합 시험: OpenStack --> GCP --> Alibaba
  • IID Meta 정보와 CSP 자원 불일치시 지원 방법(도구)
  • cblog 및 오류 메시지 refine
  • ROLLBACK 처리 보완 및 시험
  • 그외 주요 리모델링 추진

[2020-04-24 (금) 이메일]

<드라이버 리모델링(IID, VPC/Subnet 등) 추진 현황>

  1. Azure(이노): 통합시험 완료 (일부 수정 요청)
  2. AWS(메가): 통합시험 완료
  3. GCP(메가): 지연중 --> 차주 통합 예정(VMHandler 마감 처리 중)
  4. OpenStack(이노): 통합시험 완료 (일부 수정 요청)
  5. Alibaba(메가): 차주 통합 예정
  6. Cloudit(이노): 차주 통합 예정

NS, MCIS emptiness check

#25 에서 이슈가 제기되었고
#28 PR을 통해
'삭제하려는 NS에 적어도 하나의 MCIS, Image, Network, SecurityGroup, Spec, SshKey, Subnet이 있으면 NS 삭제 실패를 리턴하는 로직' 을
delNs() 함수에 추가하였습니다.

이렇게 하니, 사용자가 '삭제하려는 NS에 적어도 하나의 MCIS, Image, Network, SecurityGroup, Spec, SshKey, Subnet이 있더라도 NS를 강제로 삭제' 할 수는 없는 상태입니다.

또한, delMcis() 함수는 #28 의 delNs() 함수와 다르게, 삭제하려는 MCIS 아래에 VM이 있으면 이를 Terminate & Delete 하고, 최종적으로 MCIS를 삭제하는 로직으로 작성되어 있습니다.


[Emptiness check 로직을 어디에 둘 것인가]

  • 1안: delNs() 함수와 같이 del**() 함수 안에 둔다
    • Webtool 등에서 restDelNs() / delNs() 함수만 호출해도 Emptiness check이 수행됨
    • 강제 삭제 함수는 없는 상태임 (필요 시 구현 가능)
    • 1안으로 결정되면, delMcis() 함수를 업데이트 해야 합니다.
  • 2안: del**() 함수 안에 두지 않는다
    • Webtool 등에서 restGetAllMcis, restGetAllImage, ... 등을 호출하여 Emptiness check을 수행하고, 통과되면 restDelNs() / delNs() 를 호출하여 실제로 삭제 (SEO 의견: 이렇게 하면 API call이 너무 많음)
    • del**() 함수 자체가 강제 삭제 함수의 역할을 함
    • 2안으로 결정되면 delNs() 함수를 업데이트 해야 합니다.

nutsdb dbpath issue

Related: cloud-barista/cb-spider@38e5537

File with issue: https://github.com/cloud-barista/cb-tumblebug/blob/master/conf/store_conf.yaml#L9

Currently:

  dbpath: "/home/son/go/src/github.com/cloud-barista/cb-tumblebug/meta_db/dat"

It was:
https://github.com/cloud-barista/cb-tumblebug/blame/edb245563594fbc2a080b82125247b2eaf584eb0/conf/store_conf.yaml#L9

  dbpath: "/root/go/src/github.com/cloud-barista/cb-tumblebug/meta_db/dat"

FYI:

  dbpath: "~/go/src/github.com/cloud-barista/cb-spider/meta_db/dat"

is not a good solution.

Info: Go struct / JSON field name match table

Ref: #180

[VM Create Request flow]

TbVmReq struct TbVmInfo struct
(Name→) Id
Description Description
Status="Creating"
Name Name
ConnectionName ConnectionName
SpecId SpecId
ImageId ImageId
VNetId VNetId
SubnetId SubnetId
SecurityGroupIds SecurityGroupIds
SshKeyId SshKeyId
TbVmInfo JSON (#180) TbVmInfo struct Req to Spider
[struct = JSON]
name Name→ ReqInfo.Name
connectionName ConnectionName→ ConnectionName
specId SpecId→ (ReqInfo.VMSpecName)
imageId ImageId→ (ReqInfo.ImageName)
securityGroupIds SecurityGroupIds→ ReqInfo.SecurityGroupNames
vNetId VNetId→ ReqInfo.VPCName
subnetId SubnetId→ ReqInfo.SubnetName
sshKeyId SshKeyId→ ReqInfo.KeyPairName
vmUserAccount VmUserAccount→ ReqInfo.VMUserId
vmUserPassword VmUserPassword→ ReqInfo.VMUserPasswd
description Description (no Description)
Resp from Spider
[struct = JSON]
TbVmInfo struct TbVmInfo JSON
[Whole struct]→ CspViewVmDetail cspViewVmDetail
IId
(no ConnectionName)
VMSpecName
ImageIId
SecurityGroupIIds
VpcIID
SubnetIID
KeyPairIId
VMUserId→ VmUserAccount vmUserAccount
VMUserPasswd→ VmUserPassword vmUserPassword
StartTime
Region→ Region region
NetworkInterface
PublicIP→ PublicIP publicIP
PublicDNS→ PublicDNS publicDNS
PrivateIP→ PrivateIP privateIP
PrivateDNS→ PrivateDNS privateDNS
VMBootDisk→ VMBootDisk vmBootDisk
VMBlockDisk→ VMBlockDisk vmBlockDisk
KeyValueList
(no Description)

Issues about MCIR Image mgmt feature

  • 현재: Tumblebug 에서 Image 를 등록하면 UUID 가 생성되어 UUID 로 관리되며, connectionName 필드도 있음
  • TODO: UUID 삭제, [connectionName 남겨놓거나, 또는 region 필드 추가], cspImageID / cspImageName 을 Identifier 로 사용
  • 고려해야 하는 사항: AWS 는 Region 별로 cspImageID (ami-xxxxxxxxx) 가 다름

  • 현재: RegisterImageWithInfo API 제공, RegisterImageWithID API (unstable) 제공
  • TODO: RegisterImageWithID API 안정화, GetImageInfo API 제공 (아니면, 이 기능을 Webtool 에서 제공하는 방안도 있음)

TODO: Forbid deleting NS/MCIS

  1. Forbid deleting NS when there is at least one MCIS or one of resources.

  2. Forbid deleting MCIS when there is at least one VM.

TODO: Organize paths of gRPC server code files

@jmleefree
gRPC 작업하실 때, 아래 사항도 함께 작업해 주시면 감사하겠습니다.


in cb-tumblebug/src/api/grpc/server

As-is:

❯ tree -h
├── [4.2K]  image.go
├── [3.5K]  namespace.go
├── [ 978]  server.go
└── [4.2K]  spec.go

To-be:

❯ tree -h
├── [4.0K]  common
│   ├── [3.9K]  namespace.go
│   └── [1.4K]  utility.go
├── [4.0K]  mcir
│   ├── [6.7K]  common.go
│   ├── [3.6K]  image.go
│   ├── [3.7K]  securitygroup.go
│   ├── [6.5K]  spec.go
│   ├── [3.7K]  sshkey.go
│   └── [3.4K]  vnet.go
├── [4.0K]  mcis
│   ├── [ 24K]  control.go
│   └── [1.2K]  utility.go
└── [ 10K]  server.go

For reference:
in cb-tumblebug/src/api/rest/server

❯ tree -h
├── [4.0K]  common
│   ├── [3.9K]  namespace.go
│   └── [1.4K]  utility.go
├── [4.0K]  mcir
│   ├── [6.7K]  common.go
│   ├── [3.6K]  image.go
│   ├── [3.7K]  securitygroup.go
│   ├── [6.5K]  spec.go
│   ├── [3.7K]  sshkey.go
│   └── [3.4K]  vnet.go
├── [4.0K]  mcis
│   ├── [ 24K]  control.go
│   └── [1.2K]  utility.go
└── [ 10K]  server.go

Suggestion: Organize paths of core code files

As-is:
in cb-tumblebug/src

❯ tree -h
├── [4.0K]  api/
├── [4.0K]  cli/
├── [4.0K]  common/
├── [ 156]  Makefile
├── [4.0K]  mcir/
├── [4.0K]  mcis/
├── [3.2K]  mcism.go
├── [4.0K]  resource/
│   └── [5.5K]  cloudlocation.csv
└── [4.0K]  webadmin/

To-be:

❯ tree -h
├── [4.0K]  api/
├── [4.0K]  cli/
├── [4.0K]  core/
│   └── [4.0K]  common/
│   └── [4.0K]  mcir/
│   └── [4.0K]  mcis/
├── [ 156]  Makefile
├── [3.2K]  mcism.go
├── [4.0K]  resource/
│   └── [5.5K]  cloudlocation.csv
└── [4.0K]  webadmin/

For reference:
in cb-tumblebug/src/api/rest

❯ tree -h
└── [4.0K]  server
    ├── [4.0K]  common
    │   ├── [3.9K]  namespace.go
    │   └── [1.4K]  utility.go
    ├── [4.0K]  mcir
    │   ├── [6.7K]  common.go
    │   ├── [3.6K]  image.go
    │   ├── [3.7K]  securitygroup.go
    │   ├── [6.5K]  spec.go
    │   ├── [3.7K]  sshkey.go
    │   └── [3.4K]  vnet.go
    ├── [4.0K]  mcis
    │   ├── [ 24K]  control.go
    │   └── [1.2K]  utility.go
    └── [ 10K]  server.go

Enhancements for MCIS and MCIR (backlog)

[근시일]

  • 파일 새로 만들기
    • mcism_resource_manage_publicIp.go
    • mcism_resource_manage_vNic.go
  • "csp": "aws" 로 되어 있는 부분을 "connectionName": "aws-connect01" 으로 변경
  • CSP 와 통신하는 부분이 farmoni 코드로 되어 있는데, 이를 Spider 에서 제공할 REST API 로 변경. HTTP client 는 "net/http" 사용. cb-spider/cloud-control-manager/cloud-driver/drivers/cloudit/client 참고. HTTP client 코드는 많이 쓰일 것이므로 모듈화를 잘 해놓는 것이 좋을 것임. Published Postman doc 에서 Go 코드를 얻을 수도 있음. Echo 를 client 로 사용할 수도 있음.

[추후]

  • (Spider 에서 interfaces_v2 가 완성되면) cb-spider/cloud-control-manager/cloud-driver/interfaces/new-resources 에 적혀 있는 struct 를 Tumblebug 에도 도입
  • Tumblebug 에서, Create-Delete 는 메타정보 추가/삭제 + CSP에 명령 이고, Register-Unregister 는 메타정보 추가/삭제만 하는 것임. Register-Unregister 는 Spider 에서는 처리하지 않을 것이고, Tumblebug 에서 처리해야 함
  • Spider 에서 CSP 에 있는 VM / 자원 전체를 긁어오지는 않을 것임. (CB 를 통하지 않고 만들어진 것도 있을 수 있어서.) Tumblebug 에서 메타정보를 보고 loop 을 돌려 긁어와야 할 것임.

[2019-10-17 추가]
TODO:
Support for

  • All files - KeyValueList []KeyValue
  • SecurityHandler.go
    • SecurityRules *[]SecurityRuleInfo
  • VMHandler.go
    • SecurityGroupIds []string
    • Region RegionInfo
  • VNicHandler.go
    • SecurityGroupIds []string

[2019-10-23 추가]
TODO:

Suggestion: Change MCIS funcs' params and returns

@seokho-son

발단:

func createMcis(nsId string, req *mcisReq) string {

check, _ := checkMcis(nsId, req.Name)

if check {
	//temp := mcisInfo{}
	//err := fmt.Errorf("The mcis " + req.Name + " already exists.")
	return ""
}

부분을 넣었더니
TB 가 오동작 합니다.
(API 호출 시 "Internal Server Error" 반환)

"" (빈 string) 을 리턴해서 그런 것으로 보입니다.

그런데 현재 함수의 리턴값이 string 하나만 있어서
에러 발생 시 에러가 발생했음을 모함수에 알려 줄 방법을 모르겠습니다.


  • 다음 함수들이
    sthReq 를 param 으로 받고
    sthInfo 를 return 하도록 하면
    직관적이지 않을까 합니다.
    • func createMcis(nsId string, req *mcisReq) string {
    • func createVm(nsId string, mcisId string, vmInfoData *vmInfo) error {

Call chain 이 다음과 같은데
에러 처리 로직이 필요합니다.
위의 사항들을 적용하면서 에러 처리 로직을 넣을 수도 있겠습니다.

  1. func RestPostMcis(c echo.Context) error {
  2. func createMcis(nsId string, req *mcisReq) string {
  3. func addVmToMcis(wg *sync.WaitGroup, nsId string, mcisId string, vmInfoData *vmInfo) error {
  4. func createVm(nsId string, mcisId string, vmInfoData *vmInfo) error {

conf path issue

환경

  • Ubuntu 18.04
  • Golang 을 apt 로 설치 (apt install golang)

원인 1

  • Golang 을 apt 로 설치한다고 해서, $GOPATH 환경변수가 설정되는 것은 아님 ($GOROOT 도 마찬가지)

원인 2

  • conf/setup.env 에는
export CBSTORE_ROOT=$GOPATH/src/github.com/cloud-barista/cb-tumblebug
export CBLOG_ROOT=$GOPATH/src/github.com/cloud-barista/cb-tumblebug
export SPIDER_URL=http://localhost:1024

이렇게 되어 있음


재현 방법

$GOPATH 환경변수가 설정되어 있지 않은 상태에서

CB-Tumblebug 을 실행하기 위해
cd conf
source setup.env
cd ../src
make (= go build -o cb-tumblebug)
make run (= ./cb-tumblebug)
실행하면

error: open /src/github.com/cloud-barista/cb-tumblebug/conf/log_conf.yaml: no such file or directory

라고 나옴


우리는 다음 중 어떤 가정을 택할 것인가

  1. 사용자 컴퓨터에 $GOPATH 환경변수가 설정되어 있어야 CB-Tumblebug 실행 가능
    => 현재 코드를 수정하지 않아도 됨
    (=> CB-Tumblebug README.md$GOPATH 설정하는 내용을 추가했음:
    https://github.com/golang/go/wiki/SettingGOPATH 에 기재되어 있는 대로
    .bashrcexport GOPATH=$HOME/go 추가 후 shell 재시작)

  2. 사용자 컴퓨터에 $GOPATH 환경변수가 설정되어 있지 않아도 CB-Tumblebug 실행 가능
    => 수정 필요

수정 (안)

  • $HOME 환경변수는 설정되어 있을테니, $GOPATH 대신 $HOME/go 라고 기재
    • 문제점: $GOPATH$HOME/go 이 아닌 다른 곳으로 사용하고 있는 사용자가 있을 수도 있음
  • ...

Suggestion: Refine structs in MCIS codes

@seokho-son

MCIR 코드에서
예를 들어 image.go 를 보면


type SpiderImageReqInfo struct { // Spider
	ConnectionName string
	ReqInfo        ImageReqInfo
}

이것은 TB 가 Spider 에 API call 날릴 때 JSON body 를 만들기 위해 넣은 struct 입니다.
위 struct 를 Marshal 하여 JSON body 를 만듭니다.
=> 현재는 SpiderImageReqInfoWrapper 로 이름을 바꿨습니다.


type ImageReqInfo struct { // Spider
	//IId   IID 	// {NameId, SystemId}
	Name string
	// @todo
}

type ImageInfo struct { // Spider
	//IId     IID    // {NameId, SystemId}
	Name    string
	GuestOS string // Windows7, Ubuntu etc.
	Status  string // available, unavailable

	KeyValueList []common.KeyValue
}

ImageReqInfo 는 위의 SpiderImageReqInfo 에서 필요로 하고,
ImageInfo 는 Spider 의 응답을 Unmarshal 하기 위해 넣은 것입니다.
=> 현재는 SpiderImageReqInfo 는 사용하지 않고 있고,
ImageInfo -> SpiderImageInfo 로 이름을 바꿔서
Req unmarshal & Response unmarshal 에 공통으로 활용하고 있습니다.


type imageReq struct {
	//Id             string `json:"id"`
	Name           string `json:"name"`
	ConnectionName string `json:"connectionName"`
	CspImageId     string `json:"cspImageId"`
	CspImageName   string `json:"cspImageName"`
	//CreationDate   string `json:"creationDate"`
	Description string `json:"description"`
}

type imageInfo struct {
	Id             string            `json:"id"`
	Name           string            `json:"name"`
	ConnectionName string            `json:"connectionName"`
	CspImageId     string            `json:"cspImageId"`
	CspImageName   string            `json:"cspImageName"`
	CreationDate   string            `json:"creationDate"`
	Description    string            `json:"description"`
	GuestOS        string            `json:"guestOS"` // Windows7, Ubuntu etc.
	Status         string            `json:"status"`  // available, unavailable
	KeyValueList   []common.KeyValue `json:"keyValueList"`
}

imageReq 는 사용자가 TB 에 날리는 JSON body 를 Unmarshal 할 때에도 쓰이고,
func createSshKey(nsId string, u *sshKeyReq) (sshKeyInfo, int, []byte, error) { 등에도 쓰입니다.

imageInfo 는 TB Object 생성 결과를 API 로 내어 주기 위해 JSON 으로 Marshal 할 때에도 쓰이고,
func createSshKey(nsId string, u *sshKeyReq) (sshKeyInfo, int, []byte, error) { 등에도 쓰입니다.

=> 각각 TbImageReq, TbImageInfo 로 이름을 바꿨습니다.


위와 같이,
대문자로 시작하는 struct 는 Spider 와 통신하기 위해 넣은 것이며
소문자로 시작하는 struct 는 TB 에서 사용하기 위해 넣은 것입니다.


MCIS 코드에서도 비슷하게 되어 있는 것 같은데
좀 더 정리가 되었으면 좋겠고..
(예: 제가 올릴 예정인 PR 에서 vmCspViewInfo struct 를 주석처리 했습니다.)


struct 내 항목들, JSON 으로 나가는 항목들이
MCIR 코드에는 camelCase 로 되어 있고
MCIS 코드에는 snake_case 로 되어 있는 것도 있습니다.
통일감을 주는 방안도 있고, 그대로 두는 방안도 있겠습니다.

=> Resolved by Change snakeCase to camelCase in MCIS #490

Suggestion: `mcism` -> `cb-tumblebug`

https://github.com/cloud-barista/cb-tumblebug/blob/master/README.md
여기에 mcism 이라고 기술되어 있는데,
처음 보는 사람은 이것이 무엇을 가리키는 것인지 알기 어려울 수 있고, 직관성이 떨어집니다.

Related:
https://github.com/cloud-barista/cb-tumblebug/blob/master/src/Makefile
여기에도, build 결과물로 생성되는 바이너리의 파일명이 mcism 으로 되어 있습니다.

FYI:
https://github.com/cloud-barista/cb-tumblebug/blob/master/Dockerfile
여기에서는,

  • 임시로 생성되는 컨테이너 안의, 바이너리의 파일명
  • docker build 의 결과물인 컨테이너 이미지 안의, 바이너리의 파일명

cb-tumblebug 이라고 하였습니다.

TODO: Implement some functions

As-is:
There are some missing functions in:

  • mcism_namespace.go
  • mcism_mcis.go
  • mcism_resource_manage_image.go
  • mcism_resource_manage_network.go
  • mcism_resource_manage_securityGroup.go
  • mcism_resource_manage_spec.go
  • mcism_resource_manage_sshKey.go
  • mcism_resource_manage_subnet.go

e.g. mcism_resource_manage_image.go

REST-handling func Actual func
restDelAllImage - The logic is implemented in restDelAllImage function.
restDelImage delImage
restGetAllImage getImageList
restGetImage - The logic is implemented in restGetImage function.
restPostImage createImage, registerImage
restPutImage - e.g. modifyImageInfo() function might be needed or not.

Since there is no delAllImage() or getImage() function,
a user cannot delete all images or get image info using gRPC.


To-be:
e.g. mcism_resource_manage_image.go

REST-handling func Actual func
restDelAllImage delAllImage The logic is implemented in delAllImage function.
restDelImage delImage
restGetAllImage getImageList
restGetImage getImageInfo The logic is implemented in getImageInfo function.
restPostImage createImage, registerImage
restPutImage (modifyImageInfo) modifyImageInfo() function might be implemented or not.

TB 오브젝트 ID 생성 방식 변경 (UUID->사용자지정ID)

[개요]
TB 오브젝트 ID 생성 방식 변경 (UUID->사용자지정ID)

[현황]
TB는 오브젝트의 ID (예: MCIS ID)를 시스템이 생성한 UUID로 사용하고 있음.
오브젝트의 Name은 사용자가 지정하는 부가 정보로 사용함.
이 방식에는 장단점이 있으며, 선택의 문제임. 다만 아래의 단점을 고려하기로 함.

  • 주요 연동 프레임워크인 CB-Spider와 처리 방식에 일관성이 다소 떨어짐.
  • UUID는 사람이 인지하기 어려운 ID의 형태이며, 이에 의해 Test 등이 다소 까다로운 측면이 있음.

[수정방향] TB 오브젝트 ID 생성 방식을 변경 (UUID->사용자지정ID)

  • 기존 API 및 처리 방식은 유지하되, API Call시 사용자가 지정한 오브젝트의 Name을 기반으로 ID를 생성.
  • 오브젝트의 ID와 Name은 동일한 값을 가지게 됨. (예: Spec의 Name="goodSpec", ID="goodSpec")
  • 사용자는 오브젝트의 Name을 Namespace 내에서 유일한 값으로 사용해야 함. (예: SpecNameList:["spec1", "spec2", "spec3"]인 경우, Spec의 Name으로 "spec2"를 사용하면, 중복 오류를 리턴)

[수정방식]
GenUuid() 함수 코드 수정.

  • ID 중복 확인 로직 추가 (가능한 별도의 함수로 구성)
  • UUID 스트링 생성 주석 처리
  • Name을 ID로 리턴

Need to determine a database(s) for Spec and Image objects

@seokho-son
현재, Spec 에 대해서는 MySQL 도입이 확정되었습니다.
검색 등의 기능을 고려하면 Image 도 같은 상황 같습니다.

위의 사항을 고려할 때

  • 1안: MySQL + K-V store 동시 저장
    consistency (정합성) 이슈, 불일치 시 롤백 이슈.. 등이 있을 수 있습니다.
    각 이슈/상황에 대한 로직을 넣어 해결할 수 있겠습니다.
  • 2안: K-V store 사용하지 않고 MySQL 만 사용
    이럴 경우, 다른 MCIR, MCIS, NS 등이 K-V store 를 사용하는 것과 배치/상충됩니다.
  • 3안: 모든 MCIR, MCIS, NS 에 대해 K-V store 대신 MySQL 사용하는 것으로 전환
    (이 안으로 선택될 확률은 낮을 것 같습니다.)

1안과 2안, 또는 다른 새로운 안에 대해 고민이 필요할 것 같습니다.

Bug: Fail to delete vNet

GET {{tb_ip}}:{{tb_port}}/tumblebug/ns/{{ns_id}}/resources/vNet/{{cbNetworkId}}

[Response]

{
    "id": "VPC-01",
    "name": "VPC-01",
    "connectionName": "aws-us-east-1-config",
    "cspVNetId": "",
    "cspVNetName": "",
    "cidrBlock": "192.168.0.0/16",
    "subnetInfoList": [
        {
            "Name": "",
            "IPv4_CIDR": "192.168.1.0/24",
            "KeyValueList": [
                {
                    "Key": "VpcId",
                    "Value": "vpc-0c8f9e245d3720fd4"
                },
                {
                    "Key": "MapPublicIpOnLaunch",
                    "Value": "false"
                },
                {
                    "Key": "AvailableIpAddressCount",
                    "Value": "251"
                },
                {
                    "Key": "AvailabilityZone",
                    "Value": "us-east-1d"
                },
                {
                    "Key": "Status",
                    "Value": "pending"
                }
            ]
        }
    ],
    "description": "",
    "status": "",
    "keyValueList": null
}

DELETE {{tb_ip}}:{{tb_port}}/tumblebug/ns/{{ns_id}}/resources/vNet/{{cbNetworkId}}

[Response]

{
    "message": "Not Found"
}

Spider 의 API 변경에 대한 대응

[JSON Array -> JSON Object]
cloud-barista/cb-spider#136

[관련 Spider REST API]

  • CloudOS

    • {"GET", "/cloudos", listCloudOS},
  • CIM (Cloud Info Mgmt)

    • {"GET", "/driver", listCloudDriver},
    • {"GET", "/credential", listCredential},
    • {"GET", "/region", listRegion},
    • {"GET", "/connectionconfig", listConnectionConfig},
  • VM Resources

    • {"GET", "/vmimage", listImage},
    • {"GET", "/vmspec/:RegionName", listVMSpec},
    • {"GET", "/vmorgspec/:RegionName", listOrgVMSpec},
    • {"GET", "/vnetwork", listVNetwork},
    • {"GET", "/securitygroup", listSecurity},
    • {"GET", "/keypair", listKey},
    • {"GET", "/vnic", listVNic},
    • {"GET", "/publicip", listPublicIP},
  • VM

    • {"GET", "/vm", listVM},
    • {"GET", "/vmstatus", listVMStatus},

[Added /spider/ prefix for REST APIs]
cloud-barista/cb-spider#139

Need a guideline for Localization and Globalization of CB-Tumblebug

We don't have a guideline for Localization and Globalization of CB-Tumblebug.

I would like to suggest the following guideline.


Localization and Globalization of CB-Tumblebug.

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 저장소는 한국어 사용을 받아 들일 것입니다.

다른 한편으로, 우리는이 프로젝트가 기여자의 국가에 관계없이 번성하기를 희망합니다.
따라서 최소한 이슈, 풀 요청, 커밋에 대해서는 제목을 영어로 사용하는 것을 추천하며, 내용에는 현지 언어 사용을 수용할 것입니다.

Suggestion: Organize JSON field name

@seokho-son

Current valid JSON body of "Create MCIS" request: (from test/official/6.mcis/create-mcis.sh)

...
"vm": [ {
                        "name": "'${CONN_CONFIG[$INDEX,$REGION]}'-'${POSTFIX}'-01",
                        "config_name": "'${CONN_CONFIG[$INDEX,$REGION]}'",
                        "image_id": "'${CONN_CONFIG[$INDEX,$REGION]}'-'${POSTFIX}'",
                        "ssh_key_id": "'${CONN_CONFIG[$INDEX,$REGION]}'-'${POSTFIX}'",
                        "spec_id": "'${CONN_CONFIG[$INDEX,$REGION]}'-'${POSTFIX}'",
                        "security_group_ids": [
                                "'${CONN_CONFIG[$INDEX,$REGION]}'-'${POSTFIX}'"
                        ],
                        "vnet_id": "'${CONN_CONFIG[$INDEX,$REGION]}'-'${POSTFIX}'",
                        "subnet_id": "'${CONN_CONFIG[$INDEX,$REGION]}'-'${POSTFIX}'",
                        "description": "description",
                        "vm_access_id": "cb-user",
                        "vm_access_passwd": ""
                },
...

Suggestion: (Other field name candidates are also welcome.)

As-is To-be
name -
config_name connectionName
image_id tbImageId or imageId
ssh_key_id tbSshKeyId or sshKeyId
spec_id tbSpecId or specId
security_group_ids tbSecurityGroupIds or securityGroupIds
vnet_id tbVNetId or vNetId
subnet_id tbSubnetId or subnetId
description -
vm_access_id vmUserAccount
vm_access_passwd vmUserPassword

FYI: CB-Spider, and CB-Tumblebug MCIR REST API uses camelCase for JSON field names.

  • cb-tumblebug/test/official/1.vNet/create-vNet.sh
{
                "name": "'${CONN_CONFIG[$INDEX,$REGION]}'-'${POSTFIX}'",
                "connectionName": "'${CONN_CONFIG[$INDEX,$REGION]}'",
                "cidrBlock": "192.168.0.0/16",
                "subnetInfoList": [ {
                        "Name": "'${CONN_CONFIG[$INDEX,$REGION]}'-'${POSTFIX}'",
                        "IPv4_CIDR": "192.168.1.0/24"
                } ]
        }
  • cb-tumblebug/test/official/2.securityGroup/create-securityGroup.sh
{
                "name": "'${CONN_CONFIG[$INDEX,$REGION]}'-'${POSTFIX}'",
                "connectionName": "'${CONN_CONFIG[$INDEX,$REGION]}'",
                "vNetId": "'${CONN_CONFIG[$INDEX,$REGION]}'-'${POSTFIX}'",
                "description": "test description",
                    "firewallRules": [
                            {
                                    "FromPort": "1",
                                    "ToPort": "65535",
                                    "IPProtocol": "tcp",
                                    "Direction": "inbound"
                            },
                                {
                                    "FromPort": "-1",
                                    "ToPort": "-1",
                                    "IPProtocol": "icmp",
                                    "Direction": "inbound"
                            }
                    ]
            }

Issues about MCIR Spec mgmt feature

  • 현재: Tumblebug 에서 Spec 을 등록하면 UUID 가 생성되어 UUID 로 관리되며, connectionName 필드도 있음
  • TODO: UUID 삭제, [connectionName 남겨놓거나, 또는 region 필드 추가], cspSpecID / cspSpecName 을 Identifier 로 사용
  • 고려해야 하는 사항: AWS 는 Region/AZ 별로 사용 가능한 flavor 가 다를 수 있음

  • 현재: RegisterSpecWithInfo API 제공, RegisterSpecWithID API (unstable) 제공
  • TODO: RegisterSpecWithID API 안정화, GetSpecInfo API 제공 (아니면, 이 기능을 Webtool 에서 제공하는 방안도 있음)

  • TODO: vCPU, RAM 등을 제시하면 조건을 만족하는 Spec 제시 (예: normalized weighted distance 기반)

Suggestion: Add `/tumblebug/` prefix for REST APIs

As-Is:

  • /ns
  • /ns/{ns_id}/mcis
  • ...

To-Be:

  • /tumblebug/ns
  • /tumblebug/ns/{ns_id}/mcis
  • ...

[사유]

  • API-GW 에서 지금은 각 API (/ns, /ns/{ns_id}/mcis, ...) 별로 rule 을 적고 있습니다.
  • 향후 http://api-gw:8000/tumblebug/* 로 오는 모든 요청을 http://cb-tumblebug:1323/* 로 보내고 싶습니다.
  • 예를 들어 API-GW 테스트 시 Tumblebug 에 API 요청할 때 1) Tumblebug 로 직접 보내기, 2) API-GW 로 보내기 를 계속 왔다갔다 해야 하는데, 이 때 Tumblebug API 도 /tumblebug/ (또는 /cb-tumblebug/) 로 시작하도록 통일되어 있으면, 테스트도 편리하고, 향후에도 편리할 것으로 예상됩니다.

  • 영향: Tumblebug API 를 이용하는 Dragonfly, Webtool 등도 Tumblebug API 변경에 대한 대응이 필요합니다.
  • 기타: Spider, Dragonfly, Webtool 등도 모두 이런 스타일로 갔으면 좋겠습니다.

Suggestion: Integrate struct pair xxxReq and xxxInfo

E.g.

As-is:

type NsReq struct {
	//Id          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
}

type NsInfo struct {
	Id          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
}

To-be:

type NsInfo struct {
	Id          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
}

Need to apply goroutine for MCIS creation

Need to apply goroutine for MCIS creation

VM creations for MCIS creation are sequential. This reduces the speed of MCIS creation.
Need to make VM creations parallel.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.