Skip to content

Commit adb5571

Browse files
authored
Merge branch 'cloud-barista:master' into master
2 parents d4a7968 + 184e610 commit adb5571

766 files changed

Lines changed: 40736 additions & 24935 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/copilot-instructions.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Copilot Instructions (for CB-Spider)
2+
3+
## Overview
4+
- CB-Spider: Cloud-Barista sub-framework, unified API for multiple CSPs.
5+
- Main runtime: REST (`api-runtime/rest-runtime`, Swagger).
6+
- Drivers: `cloud-control-manager/*`, `cloud-driver-libs/*`.
7+
- Env: Ubuntu 22.04, Go 1.25, Docker 19.03+.
8+
9+
## Style
10+
- Format: `gofmt`, `goimports`.
11+
- No `panic`. Return `error`, wrap with `fmt.Errorf("...: %w", err)`.
12+
- Always use `context.Context` for I/O, network, drivers.
13+
- Logging: use `cb-log` (logrus). No direct print. No sensitive data.
14+
- cb-log: https://github.com/cloud-barista/cb-log
15+
- Naming:
16+
- Types: `*Info`, `*Req`, `*Resp`.
17+
- Const: `UPPER_SNAKE_CASE`.
18+
- Vars: short, standard abbreviations only.
19+
- Dependencies: minimal, in `go.mod`, no license conflicts.
20+
21+
## Layers
22+
- **REST runtime**: validate input → call common runtime → map response. Keep Swagger updated. Wrap CSP “Original*” responses. Consistent HTTP error mapping.
23+
- **gRPC runtime**: deprecated.
24+
- **Drivers**: implement full common interface. Separate model ↔ SDK mapping. Document limits. Use exponential backoff. Track CSP calls with call-log.
25+
26+
## Testing
27+
- Server: Run with `AdminWeb.
28+
29+
- Drivers: run the dedicated test programs provided for each CSP driver.
30+
31+
## Performance/Security
32+
- Timeouts default for all external calls. Retries only if idempotent.
33+
- Pagination/filter for list APIs.
34+
- Avoid data races.
35+
- Secrets only via env/secret. Never log sensitive data. Validate all inputs. Enforce CSP-specific constraints.
36+
37+
## Docs
38+
- Sync Swagger with API changes.
39+
- Keep README/wiki links valid.
40+
41+
## Git Rules
42+
- Commits: Conventional Commits.
43+
- PRs: one feature/issue, with tests/docs.
44+
- Driver PRs: update resource table, document limits, add tests.
45+
46+
## Build/Run
47+
- Local: `make`.
48+
- Container: official image.
49+
- Config: `setup.env`, `conf/*.conf`.

.gitignore

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,13 @@ cloud-driver-libs/.ssh-aliyun/*
3131
cloud-driver-libs/.ssh-tencent/*
3232
cloud-driver-libs/.ssh-ncp/*
3333
cloud-driver-libs/.ssh-nhn/*
34-
cloud-driver-libs/.ssh-ktcloud/*
35-
cloud-driver-libs/.vpc-ncp/*
34+
cloud-driver-libs/.ssh-ktclassic/*
3635
cloud-driver-libs/.vpc-nhn/*
3736
cloud-driver-libs/.vpc-kt/*
3837
cloud-driver-libs/.securitygroup-kt/*
3938

39+
.venv/*
40+
__pycache__/*
4041
vendor/*
4142
cloud-driver-libs/*.so
4243
meta_db/*
@@ -63,13 +64,12 @@ utils/clone-mc-meta-info/vm-image/az-data/*
6364

6465
cloud-control-manager/cloud-driver/drivers/azure/main/conf/config.yaml
6566
cloud-control-manager/cloud-driver/drivers/ibm/main/conf/config.yaml
66-
cloud-control-manager/cloud-driver/drivers/ibmcloud-vpc/main/conf/config.yaml
6767
cloud-control-manager/cloud-driver/drivers/openstack/main/conf/config.yaml
6868
cloud-control-manager/cloud-driver/drivers/tencent/main/conf/testConfigTencent.yaml
6969
cloud-control-manager/cloud-driver/drivers/ncp/main/config/config.yaml
70-
cloud-control-manager/cloud-driver/drivers/ncpvpc/main/config/config.yaml
71-
cloud-control-manager/cloud-driver/drivers/nhncloud/main/conf/config.yaml
72-
cloud-control-manager/cloud-driver/drivers/ktcloud/main/config/config.yaml
70+
cloud-control-manager/cloud-driver/drivers/nhn/main/conf/config.yaml
71+
cloud-control-manager/cloud-driver/drivers/kt/main/config/config.yaml
72+
cloud-control-manager/cloud-driver/drivers/ktclassic/main/config/config.yaml
7373

7474
test/vm-cb-user-validation-cli/2.6-csp-test/connection/.*-credential
7575
utils/default-connection-helper/.*-credential

Dockerfile

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22
## Stage 1 - Go Build
33
##############################################################
44

5-
#FROM golang:alpine AS builder
6-
FROM golang:1.23.0 AS builder
5+
FROM golang:1.25.0 AS builder
76

8-
ENV GO111MODULE on
7+
ENV GO111MODULE=on
98

109
#RUN apk update && apk add --no-cache bash
1110
#RUN apt update
@@ -26,7 +25,7 @@ RUN GOOS=linux go build -tags cb-spider -o cb-spider -v
2625
## Stage 2 - Application Setup
2726
##############################################################
2827

29-
FROM ubuntu:latest as prod
28+
FROM ubuntu:22.04 AS prod
3029

3130
RUN apt update
3231

@@ -51,10 +50,10 @@ COPY --from=builder /go/src/github.com/cloud-barista/cb-spider/api/ /root/go/src
5150

5251
#COPY --from=builder /go/src/github.com/cloud-barista/cb-spider/setup.env /root/go/src/github.com/cloud-barista/cb-spider/
5352
#RUN /bin/bash -c "source /root/go/src/github.com/cloud-barista/cb-spider/setup.env"
54-
ENV CBSPIDER_ROOT /root/go/src/github.com/cloud-barista/cb-spider
55-
ENV CBLOG_ROOT /root/go/src/github.com/cloud-barista/cb-spider
56-
ENV PLUGIN_SW OFF
53+
ENV CBSPIDER_ROOT=/root/go/src/github.com/cloud-barista/cb-spider
54+
ENV CBLOG_ROOT=/root/go/src/github.com/cloud-barista/cb-spider
55+
ENV PLUGIN_SW=OFF
5756

5857
ENTRYPOINT [ "/root/go/src/github.com/cloud-barista/cb-spider/api-runtime/cb-spider" ]
5958

60-
EXPOSE 1024
59+
EXPOSE 1024

README.md

Lines changed: 75 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@
77

88

99
- CB-Spider is a sub-framework of the Cloud-Barista Multi-Cloud Platform.<br>
10-
- CB-Spider offers a unified view and interface for multi-cloud management.
10+
- CB-Spider provides a unified interface and view for multi-cloud management.
1111

1212
<p align="center">
1313
<img width="850" alt="image" src="https://github.com/user-attachments/assets/c1e5328b-151d-4b24-ad62-947e8bfcbbcf">
1414
</p>
1515

16+
1617
```
1718
[NOTE]
1819
CB-Spider is currently under development and has not yet reached version 1.0.
@@ -22,39 +23,42 @@ Exercise caution if you plan to use the current release in a production environm
2223
If you encounter any difficulties while using Cloud-Barista, please let us know.
2324
(You can open an issue or join the Cloud-Barista Slack community.)
2425
```
26+
2527
***
28+
2629
### **[Quick Guide](https://github.com/cloud-barista/cb-spider/wiki/Quick-Start-Guide)**
2730
***
2831

29-
#### [목 차]
30-
31-
1. [권장 환경](#1-권장-환경)
32-
2. [실행 방법](#2-실행-방법)
33-
3. [제공 자원](#3-제공-자원)
34-
4. [VM 계정](#4-VM-계정)
35-
5. [활용 방법](#5-활용-방법)
36-
6. [API 규격](#6-API-규격)
37-
7. [특이 사항](#7-특이-사항)
38-
8. [활용 정보](#8-활용-정보)
39-
40-
***
32+
#### Table of Contents
33+
34+
1. [Recommended Environment](#1-recommended-environment)
35+
2. [How to Run](#2-how-to-run)
36+
3. [Supported Resources](#3-supported-resources)
37+
4. [VM Accounts](#4-vm-accounts)
38+
5. [Usage](#5-usage)
39+
6. [API Specifications](#6-api-specifications)
40+
7. [Notes](#7-notes)
41+
8. [References](#8-references)
4142

42-
#### 1. 권장 환경
43+
***
4344

44-
- OS: Ubuntu 22.04
45-
- Build: Go 1.23, Swag v1.16.3
46-
- Container: Docker v19.03
45+
#### 1. Recommended Environment
4746

47+
- OS: Ubuntu 22.04
48+
- Build: Go 1.25, Swag v1.16.3
49+
- Container: Docker v19.03
4850

49-
#### 2. 실행 방법
51+
---
5052

51-
- ##### 소스 기반 실행: https://github.com/cloud-barista/cb-spider/wiki/Quick-Start-Guide
52-
- ##### 컨테이너 기반 실행: https://github.com/cloud-barista/cb-spider/wiki/Docker-based-Start-Guide
53+
#### 2. How to Run
5354

55+
- ##### Source-based: https://github.com/cloud-barista/cb-spider/wiki/Quick-Start-Guide
56+
- ##### Container-based: https://github.com/cloud-barista/cb-spider/wiki/Docker-based-Start-Guide
5457

55-
#### 3. 제공 자원
56-
- #### ※ 참고: [Tagging Guide](https://github.com/cloud-barista/cb-spider/wiki/Tag-and-Cloud-Driver-API)
58+
---
5759

60+
#### 3. Supported Resources
61+
- #### Reference: [Tagging Guide](https://github.com/cloud-barista/cb-spider/wiki/Tag-and-Cloud-Driver-API)
5862

5963
| Provider | Price<br>Info | Region/Zone<br>Info | Image<br>Info | VMSpec<br>Info | VPC<br>Subnet | Security<br>Group | VM KeyPair | VM | Disk | MyImage | NLB | managed-K8S | Object<br> Storage |
6064
|:-------------:|:-------------:|:-------------------:|:-------------:|:--------------:|:-------------------:|:-----------------:|:---------------:|:--------------:|:----:|:---:|:-------:|:-----------:|:-----------:|
@@ -63,76 +67,53 @@ If you encounter any difficulties while using Cloud-Barista, please let us know.
6367
| GCP | O | O | O | O | O | O | O | O | O | O | O | O | O |
6468
| Alibaba | O | O | O | O | O | O | O | O | O | O | O | O | O |
6569
| Tencent | O | O | O | O | O | O | O | O | O | O | O | O | WIP |
66-
| IBM VPC | O | O | O | O | O | O | O | O | O | O | O | WIP | O |
70+
| IBM | O | O | O | O | O | O | O | O | O | O | O | O | O |
6771
| OpenStack | NA | O | O | O | O | O | O | O | O | O | O | ? | WIP |
68-
| NCP VPC | O | O | O | O | O | O | O | O | O | O | O | WIP | O |
69-
| NHN | NA | O | O | O | O<br>(Type1) | O | O | O<br>(Note2) | O | O | O | O | O |
70-
| KT VPC | NA | O | O | O | O<br>(Type2) | O | O | O | O | O | O<br>(Note3)| Wait API | O |
71-
| KT Classic | NA | O | O | O | O<br>(Type3) | O | O | O | O | O | O | NA | - |
72-
| NCP Classic<br> (25.9.18.부터 VM 생성 불가) | - | O | O | O | O<br>(Type3) | O<br>(Note1) | O | O | O | O | O | NA | - |
73-
74-
※ WIP: Work In Progress, NA: Not Applicable, Wait API: CSP API 공개 대기, ?: 미정/분석필요, -: 연동 제외 Classic 자원
75-
76-
※ VPC 특이사항(세부 내용: 각 드라이버 Readme 참고)
77-
◉ Type1: Console에서 사전 생성 후 등록 활용
78-
- CSP(NHN) IG(Internet Gateway) 제어 API 부재(추후 제공 예정)
79-
- 사전 작업: Console에서 VPC 사전 생성 및 IG(Internet Gateway) 맵핑 필요(#1109 참고)
80-
- CB-Spider: Register/UnRegister API 활용
81-
- 등록 예시
82-
curl -sX POST http://localhost:1024/spider/regvpc -H 'Content-Type: application/json' -d \
83-
'{
84-
"ConnectionName": "'${CONN_CONFIG}'",
85-
"ReqInfo": { "Name": "'${VPC_NAME}'", "CSPId": "'${VPC_CSPID}'"}
86-
}'
87-
88-
◉ Type2: default VPC 활용 (KT VPC)
89-
- CSP: 생성 제공 없이 고정된 default VPC 1개만 제공
90-
- CB-Spider: API 추상화를 위한 단일 VPC 생성만 제공 (이름 등록 수준)
91-
- 두개 이상 VPC 생성 불가, Subnet은 추가/삭제 가능
92-
93-
◉ Type3: VPC/Subnet Emulation
94-
- CSP: VPC 개념 제공하지 않음
95-
- CB-Spider: API 추상화를 위한 단일 VPC/Subnet 생성 제공 (두개 이상 VPC/Subnet 생성 불가)
96-
- CIDR: 제공하지 않음(설정 무의미)
97-
98-
99-
※ Security Group 특이사항(세부 내용: 각 드라이버 Readme 참고)
100-
◉ Note1: Console에서 사전 생성 후 등록 활용
101-
- CSP: Security Group Create API 부재
102-
- 사전 작업: Console에서 Security Group 사전 생성
103-
- CB-Spider: Register/UnRegister API 활용
104-
- 등록 예시
105-
curl -sX POST http://localhost:1024/spider/regsecuritygroup -H 'Content-Type: application/json' -d \
106-
'{
107-
"ConnectionName": "'${CONN_CONFIG}'",
108-
"ReqInfo": { "VPCName": "'${VPC_NAME}'", "Name": "'${SG_NAME}'", "CSPId": "'${SG_CSPID}'"}
109-
}'
110-
111-
※ VM 특이사항(세부 내용: 각 드라이버 Readme 참고)
112-
◉ Note2: Wdindows VM일 경우 SSH Key 사용한 VM 생성 후 Console에서 Key를 이용하여 PW 확인 필요
113-
114-
※ NLB 특이사항(세부 내용: 각 드라이버 Readme 참고)
115-
◉ Note3: NLB에 등록할 VM은 NLB와 동일 Subnet에 존재해야 함
116-
117-
118-
#### 4. VM 계정
119-
- Ubuntu, Debian VM User: cb-user
120-
- Windows VM User: Administrator
121-
122-
123-
#### 5. 활용 방법
124-
- [사용자 기능 및 활용 가이드 참고](https://github.com/cloud-barista/cb-spider/wiki/features-and-usages)
125-
126-
127-
#### 6. API 규격
128-
- [Swagger Documentations](https://github.com/cloud-barista/cb-spider/tree/master/api)
129-
- [Swagger Guide](https://github.com/cloud-barista/cb-spider/wiki/Swagger-Guide)
130-
131-
132-
133-
#### 7. 특이 사항
134-
- 개발상태: 주요기능 중심 개발추진 중 / 기술개발용 / 상용활용시 보완필요
135-
136-
137-
#### 8. 활용 정보
138-
- 위키: https://github.com/cloud-barista/cb-spider/wiki
72+
| NCP | O | O | O | O | O | O | O | O | O | O | O | WIP | O |
73+
| NHN | NA | O | O | O | O | O | O | O<br>(Note1) | O | O | O | O | O |
74+
| KT | NA | O | O | O | O<br>(Type1) | O | O | O | O | O | O<br>(Note2)| Wait API | O |
75+
| KT Classic | NA | O | O | O | O<br>(Type2) | O | O | O | O | O | O | NA | - |
76+
77+
※ WIP: Work In Progress, NA: Not Applicable, Wait API: Pending CSP API Release, ?: TBD/Analysis Needed, -: Excluded (Classic Resource)
78+
79+
**VPC Notes (see each driver’s README for details):**
80+
- **Type1:** Default VPC (KT VPC)
81+
- CSP: Provides one fixed default VPC only
82+
- CB-Spider: Only one VPC can be created (for abstraction)
83+
84+
- **Type2:** VPC/Subnet Emulation
85+
- CSP: No VPC concept provided
86+
- CB-Spider: Provides single emulated VPC/Subnet
87+
88+
**VM Notes:**
89+
- **Note1:** For Windows VMs, after creating a VM with SSH key, the password must be checked in Console.
90+
91+
**NLB Notes:**
92+
- **Note2:** VMs registered to NLB must be in the same Subnet as the NLB.
93+
94+
---
95+
96+
#### 4. VM Accounts
97+
- Ubuntu, Debian: `cb-user`
98+
- Windows: `Administrator`
99+
100+
---
101+
102+
#### 5. Usage
103+
- [Feature and Usage Guide](https://github.com/cloud-barista/cb-spider/wiki/features-and-usages)
104+
105+
---
106+
107+
#### 6. API Specifications
108+
- [Swagger Documentation](https://github.com/cloud-barista/cb-spider/tree/master/api)
109+
- [Swagger Guide](https://github.com/cloud-barista/cb-spider/wiki/Swagger-Guide)
110+
111+
---
112+
113+
#### 7. Notes
114+
- Development status: Focused on core features / For R&D use / Needs reinforcement for production use
115+
116+
---
117+
118+
#### 8. References
119+
- Wiki: https://github.com/cloud-barista/cb-spider/wiki

0 commit comments

Comments
 (0)