Skip to content

Commit 1e4a40a

Browse files
Improve for the release
2 parents b11f0d2 + 6d74c4b commit 1e4a40a

File tree

16 files changed

+280
-164
lines changed

16 files changed

+280
-164
lines changed

README.md

Lines changed: 5 additions & 127 deletions
Original file line numberDiff line numberDiff line change
@@ -18,137 +18,15 @@ Computing Infrastructure Migration framework (codename: cm-beetle) is going to s
1818
- Operating system (OS):
1919
- Ubuntu 22.04
2020
- Languages:
21-
- Go: 1.21
22-
- Python: 3.8.10
21+
- Go: 1.21.6
22+
- Python: 3.10.12
2323
- Container runtime:
24-
- Docker: 20.10.12
24+
- Docker: 24.0.7
2525

2626

27-
## How to run CM-Beetle
28-
29-
### Source code based installation and execution
30-
31-
#### Configure build environment
32-
33-
1. Install dependencies
34-
35-
```bash
36-
# Ensure that your system is up to date
37-
sudo apt update -y
38-
39-
# Ensure that you have installed the dependencies,
40-
# such as `ca-certificates`, `curl`, and `gnupg` packages.
41-
sudo apt install make gcc git
42-
```
43-
2. Install Go
44-
45-
Note - **Install the latest stable version of Go** for CM-Beetle contribution/development since backward compatibility is supported.
46-
For example, install Go 1.21.4, which is stable version on 2023-11-30, even though `go.mod` says `go 1.19`. (In the opposite case, you will encounter a build error.)
47-
48-
Example - Install Go 1.21.4, see [Go all releases](https://golang.org/dl/) and [Download and install](https://go.dev/doc/install)
49-
50-
```bash
51-
# Set Go version
52-
GO_VERSION=1.21.4
53-
54-
# Get Go archive
55-
wget https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz
56-
57-
# Remove any previous Go installation and
58-
# Extract the archive into /usr/local/
59-
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go${GO_VERSION}.linux-amd64.tar.gz
60-
61-
# Append /usr/local/go/bin to .bashrc
62-
echo 'export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin' >> ~/.bashrc
63-
echo 'export GOPATH=$HOME/go' >> ~/.bashrc
64-
65-
# Apply the .bashrc changes
66-
source ~/.bashrc
67-
68-
# Verify the installation
69-
echo $GOPATH
70-
go version
71-
72-
```
73-
74-
#### Download source code
75-
76-
Clone CM-Beetle repository
77-
78-
```bash
79-
git clone https://github.com/cloud-barista/cm-beetle.git ${HOME}/cm-beetle
80-
```
81-
82-
#### Build CM-Beetle
83-
84-
Build CM-Beetle source code
85-
86-
```bash
87-
cd ${HOME}/cm-beetle
88-
make
89-
```
90-
91-
(Optional) Update Swagger API document
92-
```bash
93-
cd ${HOME}/cm-beetle
94-
make swag
95-
```
96-
97-
If you got an error because of missing `swag`, install `swag`:
98-
```bash
99-
go install github.com/swaggo/swag/cmd/swag@latest
100-
```
101-
102-
#### Run CM-Beetle binary
103-
104-
Set enviroment variable (See [setup.env](https://github.com/cloud-barista/cm-beetle/blob/main/conf/setup.env))
105-
106-
```bash
107-
source ./conf/setup.env
108-
```
109-
110-
Run CM-Beetle server
111-
112-
```bash
113-
cd ${HOME}/cm-beetle
114-
make run
115-
```
116-
117-
#### Health-check CM-Beetle
118-
119-
Check if CM-Beetle is running
120-
121-
```bash
122-
curl http://localhost:8056/beetle/health
123-
124-
# Output if it's running successfully
125-
# {"message":"CM-Beetle API server is running"}
126-
```
127-
128-
129-
### Container based execution
130-
131-
Check a tag of CM-Beetle container image in [cloudbaristaorg/cm-beetle](https://hub.docker.com/r/cloudbaristaorg/cm-beetle/tags)
132-
133-
#### Run CM-Beetle container
134-
135-
```bash
136-
docker run -p 8056:8056 \
137-
--name cm-beetle \
138-
cloudbaristaorg/cm-beetle:latest
139-
```
140-
141-
#### Health-check CM-Beetle
142-
143-
Check if CM-Beetle is running
144-
145-
```bash
146-
curl http://localhost:8056/beetle/health
147-
148-
# Output if it's running successfully
149-
# {"message":"CM-Beetle API server is running"}
150-
```
27+
## How to run and use CM-Beetle
15128

29+
See [the discussion #73](https://github.com/cloud-barista/cm-beetle/discussions/73)
15230

15331
---
15432

api/docs.go

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -733,6 +733,7 @@ const docTemplate = `{
733733
"subGroupSize": {
734734
"description": "if subGroupSize is (not empty) \u0026\u0026 (\u003e 0), subGroup will be gernetad. VMs will be created accordingly.",
735735
"type": "string",
736+
"default": "1",
736737
"example": "3"
737738
},
738739
"vmUserPassword": {
@@ -977,7 +978,7 @@ const docTemplate = `{
977978
"type": "string"
978979
},
979980
"location": {
980-
"$ref": "#/definitions/common.GeoLocation"
981+
"$ref": "#/definitions/common.Location"
981982
},
982983
"monAgentStatus": {
983984
"description": "Montoring agent status",
@@ -1150,6 +1151,20 @@ const docTemplate = `{
11501151
}
11511152
}
11521153
},
1154+
"common.Location": {
1155+
"type": "object",
1156+
"properties": {
1157+
"display": {
1158+
"type": "string"
1159+
},
1160+
"latitude": {
1161+
"type": "number"
1162+
},
1163+
"longitude": {
1164+
"type": "number"
1165+
}
1166+
}
1167+
},
11531168
"common.NsInfo": {
11541169
"type": "object",
11551170
"properties": {
@@ -1268,7 +1283,7 @@ const docTemplate = `{
12681283
},
12691284
"name": {
12701285
"type": "string",
1271-
"example": "mig01"
1286+
"example": "cloud-infra01"
12721287
},
12731288
"systemLabel": {
12741289
"description": "SystemLabel is for describing the mcis in a keyword (any string can be used) for special System purpose",
@@ -1430,7 +1445,7 @@ const docTemplate = `{
14301445
},
14311446
"name": {
14321447
"type": "string",
1433-
"example": "mig01"
1448+
"example": "cloud-infra01"
14341449
},
14351450
"systemLabel": {
14361451
"description": "SystemLabel is for describing the mcis in a keyword (any string can be used) for special System purpose",

api/swagger.json

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -726,6 +726,7 @@
726726
"subGroupSize": {
727727
"description": "if subGroupSize is (not empty) \u0026\u0026 (\u003e 0), subGroup will be gernetad. VMs will be created accordingly.",
728728
"type": "string",
729+
"default": "1",
729730
"example": "3"
730731
},
731732
"vmUserPassword": {
@@ -970,7 +971,7 @@
970971
"type": "string"
971972
},
972973
"location": {
973-
"$ref": "#/definitions/common.GeoLocation"
974+
"$ref": "#/definitions/common.Location"
974975
},
975976
"monAgentStatus": {
976977
"description": "Montoring agent status",
@@ -1143,6 +1144,20 @@
11431144
}
11441145
}
11451146
},
1147+
"common.Location": {
1148+
"type": "object",
1149+
"properties": {
1150+
"display": {
1151+
"type": "string"
1152+
},
1153+
"latitude": {
1154+
"type": "number"
1155+
},
1156+
"longitude": {
1157+
"type": "number"
1158+
}
1159+
}
1160+
},
11461161
"common.NsInfo": {
11471162
"type": "object",
11481163
"properties": {
@@ -1261,7 +1276,7 @@
12611276
},
12621277
"name": {
12631278
"type": "string",
1264-
"example": "mig01"
1279+
"example": "cloud-infra01"
12651280
},
12661281
"systemLabel": {
12671282
"description": "SystemLabel is for describing the mcis in a keyword (any string can be used) for special System purpose",
@@ -1423,7 +1438,7 @@
14231438
},
14241439
"name": {
14251440
"type": "string",
1426-
"example": "mig01"
1441+
"example": "cloud-infra01"
14271442
},
14281443
"systemLabel": {
14291444
"description": "SystemLabel is for describing the mcis in a keyword (any string can be used) for special System purpose",

api/swagger.yaml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ definitions:
3838
example: default, TYPE1, ...
3939
type: string
4040
subGroupSize:
41+
default: "1"
4142
description: if subGroupSize is (not empty) && (> 0), subGroup will be gernetad.
4243
VMs will be created accordingly.
4344
example: "3"
@@ -209,7 +210,7 @@ definitions:
209210
label:
210211
type: string
211212
location:
212-
$ref: '#/definitions/common.GeoLocation'
213+
$ref: '#/definitions/common.Location'
213214
monAgentStatus:
214215
description: Montoring agent status
215216
example: '[installed, notInstalled, failed]'
@@ -324,6 +325,15 @@ definitions:
324325
value:
325326
type: string
326327
type: object
328+
common.Location:
329+
properties:
330+
display:
331+
type: string
332+
latitude:
333+
type: number
334+
longitude:
335+
type: number
336+
type: object
327337
common.NsInfo:
328338
properties:
329339
description:
@@ -404,7 +414,7 @@ definitions:
404414
example: rehosting infra
405415
type: string
406416
name:
407-
example: mig01
417+
example: cloud-infra01
408418
type: string
409419
systemLabel:
410420
description: SystemLabel is for describing the mcis in a keyword (any string
@@ -527,7 +537,7 @@ definitions:
527537
example: rehosting infra
528538
type: string
529539
name:
530-
example: mig01
540+
example: cloud-infra01
531541
type: string
532542
systemLabel:
533543
description: SystemLabel is for describing the mcis in a keyword (any string

0 commit comments

Comments
 (0)