Code Monkey home page Code Monkey logo

beekeeper's Introduction

Beekeeper Server

The beekeeper server is the administration server for the SAGE cyberinfrastructure. All nodes must register with the beekeeper in order to be added to the SAGE ecosystem.

The beekeeper is responsible for the following:

  1. front end for provisioning and administrative management of all nodes
  2. certificate authority responsible for generating and validating all communication keys used by the nodes (i.e. services running on them)
  3. administrative portal for collecting the general health of all nodes

start beekeeper

./create-keys.sh init --nopassword
./create-keys.sh cert untilforever forever
docker-compose up --build

Note: Options above like --nopassword and forever should not be used in production.

Register a beehive with beekeeper (example)

  1. The first step creates a beehive but credentials will be missing.
kubectl port-forward service/beekeeper-api 5000:5000  # if needed

curl localhost:5000/beehives -d '{"id": "my-beehive", "key-type": "rsa-sha2-256", "rmq-host":"host", "rmq-port": 5, "upload-host":"host", "upload-port": 6}'

Verify:

curl localhost:5000/beehives | jq .
  1. Create beehive (not beekeeper) CA credentials: https://github.com/waggle-sensor/waggle-pki-tools

  2. Add credentials for beehive to beekeeper

cd test-data/beehive_ca
curl -F "tls-key=@tls/cakey.pem" -F "tls-cert=@tls/cacert.pem"  -F "ssh-key=@ssh/ca" -F "ssh-pub=@ssh/ca.pub" -F "ssh-cert=@ssh/ca-cert.pub"  localhost:5000/beehives/my-beehive

Verify

curl localhost:5000/beehives/my-beehive | jq .

assign node to a beehive

This will only work once node has registered.

curl localhost:5000/node/0000000000000001 -d '{"assign_beehive": "my-beehive"}'
curl localhost:5000/node/0000000000000001 -d '{"deploy_wes": true}'

Check the logs:

docker logs beekeeper_bk-api_1

SSH to the node (via reverse ssh tunnel)

ssh -i ./beekeeper-keys/nodes-key/nodes.pem -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o IdentitiesOnly=true -o ProxyCommand="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@localhost -p 2201 -i ./beekeeper-keys/admin/admin.pem  netcat -U /home_dirs/node-0000000000000001/rtun.sock" root@foo

Node registration example:

ssh -o UserKnownHostsFile=./known_hosts  sage_registration@localhost -p 20022 -i id_rsa_sage_registration register 0000000000000001

OR within bk-config container

ssh -o UserKnownHostsFile=./known_hosts  sage_registration@bk-sshd -p 22 -i registration_keys/id_rsa_sage_registration register 0000000000000001

/etc/ssh/ssh_known_hosts example:

@cert-authority beehive.honeyhouse.one ssh-ed25519 AAAAC.....

example: copy key files into vagrant

cp known_hosts register.pem register.pem-cert.pub ~/git/waggle-edge-stack/ansible/private/

ansible will copy these files if detected

create Certs for node

Got to the directory that contains your beekeeper-keys folder. Copy create-keys.sh, then create the certificate file, for example:

cp ~/git/beekeeper/create-keys.sh .
./create-keys.sh cert until20220530 +20220530

Unit Testing

Unit-testing is executed via

  • ./unit-tests.sh

Requires running docker-compose enviornment.

Development

Access MySQL

docker exec -ti  beekeeper_db_1 mysql -u root -ptesttest -D Beekeeper

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.