cloud-barista / cm-honeybee

Apache License 2.0
3 stars 2 forks source link

Collecting and Aggregating Information From Source Computing

This repository provides a features of collection and aggregation for all source computing information. This is a sub-system on Cloud-Barista platform and utilizes CM-Beetle to migrate a multi-cloud.

Overview

Collecting and Aggregating Information From Source Computing framework (codename: cm-honeybee) is going to support:

Terminology * Source Computing The source computing, serving as the target for configuration and information collection, for the migration to multi-cloud * Target Computing The target computing is migration target as multi-cloud

Execution and development environment

How to run

1. Build and run server

1.1. Write the configuration file. (Optional)

(You can skip this step and the default settings will be used instead.)

1.2. Build and run the server binary

cd server
make run

Or, you can run it within Docker by this command.

 make run_docker

2. Register source group

Check your source group ID (sgID) after register.

4. Save current source information.

Below example is saving infrastructure information of all connection in the source group.

curl -X 'POST' \
 'http://127.0.0.1:8081/honeybee/source_group/b9e86d53-9fbe-4a96-9e06-627f77fdd6b7/import/infra' \
 -H 'accept: application/json'

5. Get saved source information.

Below example is getting saved infrastructure information of all connection in the source group.

curl -X 'GET' \
 'http://127.0.0.1:8081/honeybee/source_group/b9e86d53-9fbe-4a96-9e06-627f77fdd6b7/infra' \
 -H 'accept: application/json'

6. Get refined, saved source information.

Below example is getting refined, saved infrastructure information of all connection in the source group.

curl -X 'GET' \
 'http://127.0.0.1:8081/honeybee/source_group/b9e86d53-9fbe-4a96-9e06-627f77fdd6b7/infra/refined' \
 -H 'accept: application/json'

Health-check

Server

Check if CM-Honeybee server is running

curl http://localhost:8081/honeybee/readyz

# Output if it's running successfully
# {"message":"CM-Honeybee API server is ready"}

Agent

Check if CM-Honeybee agent is running

curl http://localhost:8081/honeybee/readyz

# Output if it's running successfully
# {"message":"CM-Honeybee Agent API server is ready"}

Check out all APIs

For Docker users

There are default private key and public key used for encrypt connection info's secret values (ssh port, user, password, private key) from the honeybee server. (Located in server/_default_key) For security, run these commands to generate new key files.

docker exec cm-honeybee rm /root/.cm-honeybee/honeybee.key
docker exec cm-honeybee rm /root/.cm-honeybee/honeybee.pub
docker restart cm-honeybee

If you want to use private key file with other modules like cm-grasshopper, run this command.

mkdir keys
docker cp cm-honeybee:/root/.cm-honeybee/honeybee.key keys/
docker cp cm-honeybee:/root/.cm-honeybee/honeybee.pub keys/

Now, mount the created folder to the honeybee server container. For docker compose, add these lines.

    volumes:
        - ./keys/honeybee.key:/root/.cm-honeybee/honeybee.key
        - ./keys/honeybee.pub:/root/.cm-honeybee/honeybee.pub

Now, you can copy ./keys/honeybee.key file to other module.

For who develop modules with Honeybee

About encrypted values of the connection info

Those encrypted values are always changes with each request by RSA algorithm.

How to decrypt encrypted values in the connection info?

  1. Build and run the Honeybee server.
     cd server
     make run
  2. Copy honeybee.key file from ~/.cm-honeybee or the path of 'CMHONEYBEE_ROOT' environment variable.
  3. See this commits to modify your source.