Old Installation Guide(until Cappuccino) - cloud-barista/cb-spider GitHub Wiki
cb-spider
CB-Spider is a sub-Framework of the Cloud-Barista Multi-Cloud Project.
The CB-Spider Mission is to connect all the clouds with a single interface.
[NOTE]
CB-Spider is currently under development. (the latest version is 0.2 cappuccino)
So, we do not recommend using the current release in production.
Please note that the functionalities of CB-Spider are not stable and secure yet.
If you have any difficulties in using CB-Spider, please let us know.
(Open an issue or Join the cloud-barista Slack)
[๋ชฉ ์ฐจ]
[์คํ ํ๊ฒฝ]
- ๋ฆฌ๋ ์ค (๊ฒ์ฆ์ํ:Ubuntu 18.04, Raspbian GNU/Linux 10, Android aarch64)
[์คํ ๋ฐฉ๋ฒ]
(1) ์ปจํ ์ด๋ ๊ธฐ๋ฐ ์คํ
- CB-Spider ์ด๋ฏธ์ง ํ์ธ (https://hub.docker.com/r/cloudbaristaorg/cb-spider/tags)
- CB-Spider ์ปจํ ์ด๋ ์คํ (ํ์์ Tag Version ์์ )
# sudo docker run -p 1024:1024 \
-v /root/go/src/github.com/cloud-barista/cb-spider/meta_db:/root/go/src/github.com/cloud-barista/cb-spider/meta_db \
--name cb-spider \
cloudbaristaorg/cb-spider:v0.2.0-20200819
(2) ์์ค ๊ธฐ๋ฐ ์คํ
(a) ์์ค ์ค์น
-
Git ์ค์น
-
Go ์ค์น (1.12 ์ด์)
- go download link (https://golang.org/dl/)
-
Cloud-Barista alliance ์ค์น (CB-Log)
go get -u -v github.com/cloud-barista/cb-log
- https://github.com/cloud-barista/cb-log README๋ฅผ ์ฐธ๊ณ ํ์ฌ ์ค์น ๋ฐ ์ค์
-
Cloud-Barista alliance ์ค์น (CB-Store)
go get -u -v github.com/cloud-barista/cb-store
- https://github.com/cloud-barista/cb-store README๋ฅผ ์ฐธ๊ณ ํ์ฌ ์ค์น ๋ฐ ์ค์
-
CB-Spider ์ค์น
go get -u -v github.com/cloud-barista/cb-spider
-
์ค์น ์ค๋ฅ์ ์ฐธ๊ณ
-
์ค๋ฅ ๋ฉ์์ง:
"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
- ํด๊ฒฐ๋ฐฉ๋ฒ:
-
์ค๋ฅ ๋ฉ์์ง:
"gosrc/src/go.etcd.io/etcd/vendor/google.golang.org/grpc/clientconn.go:49:2: use of internal package google.golang.org/grpc/internal/resolver/dns not allowed"
- ํด๊ฒฐ๋ฐฉ๋ฒ:
$ rm -rf $GOPATH/gosrc/src/go.etcd.io/etcd/vendor/google.golang.org/grpc
- ํด๊ฒฐ๋ฐฉ๋ฒ:
-
(b) ์คํ ์ค๋น
-
CB-Spider ์คํ์ ํ์ํ ํ๊ฒฝ๋ณ์ ์ค์
setup.env ์ ํ๊ฒฝ๋ณ์๋ฅผ ์ค์ ํ๋ค
-
ํด๋น ํ์ผ์ด ์์นํ ๊ฒฝ๋ก๋ก ์ด๋
cd $GOPATH/src/github.com/cloud-barista/cb-spider
-
ํ๊ฒฝ๋ณ์ ์ค์
-
vi setup.env
-
ex)
export CBSPIDER_ROOT=$GOPATH/src/github.com/cloud-barista/cb-spider export CBSTORE_ROOT=$GOPATH/src/github.com/cloud-barista/cb-spider export CBLOG_ROOT=$GOPATH/src/github.com/cloud-barista/cb-spider export PLUGIN_SW=OFF
-
PLUGIN_SW ํ๊ฒฝ๋ณ์
PLUGIN_SW=ON
์ผ๋ก ์ค์ ๋ ๊ฒฝ์ฐ- CSP๋ณ driver๊ฐ build๋๊ณ plugin ๋ฐฉ์์ผ๋ก (๋์ ์ผ๋ก) driver๋ฅผ ์ถ๊ฐํ ์ ์๋ค
PLUGIN_SW=OFF
๋ก ์ค์ ๋ ๊ฒฝ์ฐ- OFF mode๋ก ์ค์ ํ๊ณ buildํ์ฌ Android ํ๊ฒฝ ๋ฑ plugin์ ์ง์ํ์ง ์๋ ์คํ ํ๊ฒฝ์์ ์ฌ์ฉ ๊ฐ๋ฅํ๋ค
-
-
ํ๊ฒฝ๋ณ์ ๋ฐ์
$ source setup.env
(์์น: ./cb-spider)
-
-
driver shared library ์์ฑ ๋ฐฉ๋ฒ (์ค์น ์์คํ ๋น 1ํ ์คํ, driver source ๋ณ๊ฒฝ์ ์คํ)
./build_all_driver_lib.sh
์คํ- ๊ฒฐ๊ณผ:
cb-spider/cloud-driver-libs/xxx-driver-v1.0.so
์์ฑ - ์ฐธ๊ณ : ํน์ CSP driver๋ง buildํ๋ ๋ฐฉ๋ฒ
cd cb-spider/cloud-control-manager/cloud-driver/drivers/aws-plugin
# AWS Driver ๊ฒฝ์ฐbuild_driver_lib.sh
์คํ
(c) ์๋ฒ ์คํ
-
cd cb-spider/api-runtime/
-
์์ ์์น์์ ์๋์ ๋๊ฐ์ง ๋ฐฉ๋ฒ์ผ๋ก cb-spider ์๋ฒ๋ฅผ ์คํํ ์ ์์. # 1024 ํฌํธ๋ก REST API Server ๊ตฌ๋๋จ
-
๋ฐฉ๋ฒ 1)
go run *.go
๋ก build ๋ฐ ์คํ
-
๋ฐฉ๋ฒ 2)
make
๋ก build ํ./cb-spider
๋ก ์คํ
-
-
์ฐธ๊ณ : ๋ฉํ ์ ๋ณด ์์์ ์ด๊ธฐํ ๋ฐฉ๋ฒ
cb-spider/cloud-driver-libs/.ssh-*/*
ํ์ผ ์ญ์ cb-spider/meta_db/dat
๊ฒฝ๋ก ์ญ์ (ex: 0.dat) ํ ์๋ฒ ์ฌ๊ฐ๋
(3) Cloud-Barista ํ๋ซํผ ํตํฉ ์คํ ๋ฐฉ๋ฒ (Docker-Compose ๊ธฐ๋ฐ)
- cb-operator ์ฐธ๊ณ : https://github.com/cloud-barista/cb-operator
[API ๊ท๊ฒฉ]
- ํด๋ผ์ฐ๋ ์ธํ๋ผ ์ฐ๋ ์ ๋ณด ๊ด๋ฆฌ: https://cloud-barista.github.io/rest-api/v0.2.0/spider/ccim/
- ํด๋ผ์ฐ๋ ๋๋ผ์ด๋ฒ ์ ๋ณด ๊ด๋ฆฌ
- ํด๋ผ์ฐ๋ ์ธํ๋ผ ์ธ์ฆ์ ๋ณด ๊ด๋ฆฌ
- ํด๋ผ์ฐ๋ ์ธํ๋ผ ๋ฆฌ์ ผ ์ ๋ณด ๊ด๋ฆฌ
- ํด๋ผ์ฐ๋ ์ธํ๋ผ ๊ณตํต ์ ์ด ๊ด๋ฆฌ: https://cloud-barista.github.io/rest-api/v0.2.0/spider/cctm/
- ์ด๋ฏธ์ง ์์ ์ ์ด
- ๋คํธ์ํฌ ์์ ์ ์ด
- Security Group ์์ ์ ์ด
- ํคํ์ด ์์ ์ ์ด
- VM ์ ์ด ๋ฐ ์ ๋ณด ์ ๊ณต
[ํ์ฉ ์์]
-
์ํ ๋๊ตฌ:
cb-spier/api-runtime/rest-runtime/test/[fulltest|eachtest|parallel-test]
(AWS ๊ฒฝ์ฐ:aws) -
์ํ ์์: ์ฐ๋ ์ ๋ณด ์ถ๊ฐ => ์์๋ฑ๋ก => VM ์์ฑ ๋ฐ ์ ์ด ์ํ
-
์ํ ๋ฐฉ๋ฒ:
- (์ฐ๋์ ๋ณด๊ด๋ฆฌ)
cb-spider/api-runtime/rest-runtime/test/connect-config
์ฐธ๊ณ (Credential ์ ๋ณด ์์ ํ ์คํ) - (์์๊ด๋ฆฌ)
cb-spider/api-runtime/rest-runtime/test/fulltest
์๋ ์์ ๋ณ ์ํ ์คํฌ๋ฆฝํธ ์กด์ฌ- (์์๊ด๋ฆฌ) ์์ ์์ฑ ์์
- (1) vpc, security group, keypair ์์ฑ
- (2) vm ์์ฑ ๋ฐ ์ ์ด
- (3) ์ญ์ ๋ ์์ ์์ฑ ์ญ์
- (์ฐ๋์ ๋ณด๊ด๋ฆฌ)
-
CSP๋ณ VM User: 2020.05.29.ํ์ฌ
CSP user ID ๋น๊ณ AWS ubuntu ๋๋ ec2-user ๋ฑ Image ์์กด Azure cb-user Driver์์ ๊ณ ์ GCP cb-user Driver์์ ๊ณ ์ Alibaba root CSP์์ ๊ณ ์ , PW ์ค์ ๊ฐ๋ฅ OpenStack ubuntu ๋ฑ Image์ ์์กด Cloudit root sshkey ์ ๊ณต ์ํจ. PW ์ค์ ๊ฐ๋ฅ - ๊ฐ์ ์์ (๊ด๋ จ์ด์:https://github.com/cloud-barista/cb-spider/issues/230)
[ํน์ด ์ฌํญ]
- ๊ฐ๋ฐ์ํ: ์ด๊ธฐ ์ฃผ์ ๊ธฐ๋ฅ ์ค์ฌ ๊ฐ๋ฐ์ถ์ง ์ค / ๊ธฐ์ ๊ฐ๋ฐ์ฉ / ์์ฉํ์ฉ์ ๋ณด์ํ์
- Key๊ด๋ฆฌ: CSP๊ฐ ์ ๊ณตํ์ง ์๋ ๊ฒฝ์ฐ Key ์์ฒด ์์ฑ ๋ฐ Key ํ์ผ ๋ด๋ถ ๊ด๋ฆฌ
- ๊ด๋ฆฌ์์น:
cb-spider/cloud-driver-libs/.ssh-CSPName/*
(์์๋ฐฉ๋ฒ) - ๊ณต์ ์๋ฒ์์ ์ด์์ ๋ณด์ ์ด์ ์กด์ฌ
- ๊ด๋ฆฌ์์น:
[์์ค ํธ๋ฆฌ]
. Dockerfile: docker image build์ฉ
. setup.env: spider ์ด์์ ํ์ํ ํ๊ฒฝ๋ณ์ ์ค์
. build_all_driver_lib.sh: ๋๋ผ์ด๋ฒ build ์คํฌ๋ฆฝํธ
|-- api-runtime
| |-- grpc-runtime: grpc runtime
| `-- rest-runtime: REST runtime
| `-- test: REST API ํ์ฉ ์ฐธ์กฐ
| |-- connect-config: ์ฐ๊ฒฐ ์ค์ ์ฐธ์กฐ(driver๋ฑ๋ก -> credential ๋ฑ๋ก -> region ๋ฑ๋ก -> connection config ๋ฑ๋ก)
| |-- each-test: ์์๋ณ ๊ธฐ๋ฅ ์ํ ์ฐธ์กฐ(VPC->SecurityGroup->KeyPair->VM)
| |-- full-test: ๋ชจ๋ ์์ ์ ์ฒด ๊ธฐ๋ฅ ์ํ ์ฐธ์กฐ(create -> list -> get -> delete)
| |-- parallel-test: VM ๋์ ์คํ ์ํ ์ฐธ์กฐ(VPC์์ฑ -> SecurityGroup์์ฑ -> KeyPair์์ฑ -> N๊ฐ VM ๋์ Start)
|-- cloud-control-manager
| |-- cloud-driver
| | |-- drivers: ๋๋ผ์ด๋ฒ ๊ตฌํ์ฒด ์์น
| | | |-- alibaba
| | | |-- alibaba-plugin
| | | |-- aws
| | | |-- aws-plugin
| | | |-- azure
| | | |-- azure-plugin
| | | |-- cloudit
| | | |-- cloudit-plugin
| | | |-- gcp
| | | |-- gcp-plugin
| | | |-- docker
| | | |-- docker-plugin
| | | |-- openstack
| | | |-- openstack-plugin
| | `-- interfaces: ๋ฉํฐ ํด๋ผ์ฐ๋ ์ฐ๋ ์ธํฐํ์ด์ค(๋๋ผ์ด๋น ๊ณตํต ์ธํฐํ์ด์ค)
| | |-- connect
| | |-- resources
| |-- iid-manager: Integrated ID ๊ด๋ฆฌ, IID ๊ตฌ์กฐ:{User-defined ID, System-defined ID}
|-- cloud-driver-libs: ๋๋ผ์ด๋ฒ ๊ณต์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ, SSH Key ์์ฑ ํ์ผ ๊ด๋ฆฌ ์์น
|-- cloud-info-manager
| |-- driver-info-manager: ๋๋ผ์ด๋ฒ ์ ๋ณด ๊ด๋ฆฌ
| |-- credential-info-manager: ํฌ๋ฆฌ๋ด์
์ ๋ณด ๊ด๋ฆฌ
| |-- region-info-manager: ๋ฆฌ์ ผ ์ ๋ณด ๊ด๋ฆฌ
| |-- connection-config-info-manager:
|-- conf: Spider ์ด์์ ์ํ ์ค์ ์ ๋ณด(spider์ค์ , ๋ฉํ ์ ๋ณด ๊ด๋ฆฌ ์ค์ , ๋ก๊ทธ ์ค์ )
|-- interface
| |-- api: Go API ๊ธฐ๋ฐ ์์ฉ ๊ฐ๋ฐ์ ์ํ Client Package
| |-- cli: CLI ๊ธฐ๋ฐ ์ด์ฉ์ ์ํ Client Package
`-- meta_db: ๋ฉํ ์ ๋ณด local FS(nutsdb) ํ์ฉ์ ์ ์ฅ์ ์์น
`-- dat
`-- utils
|-- import-info: Cloud Driver ๋ฐ Region ์ ๋ณด ์๋ ๋ฑ๋ก ์ง์ ๋๊ตฌ
- CB-Spider ์์ค ํธ๋ฆฌ ๊ด๋ จ ์์ธ ์ค๋ช : https://han.gl/3IOVD