Code Monkey home page Code Monkey logo

beekeeper's Introduction

Beekeeper Server

The beekeeper server is the administration server for the cyberinfrastructure. All nodes must register with the beekeeper in order to be added to the 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

docker run --rm -it \
    -v ${PWD}:/workdir:rw \
    waggle/beekeeper-key-tools:latest \
    create-init-keys.sh -p -o beekeeper-keys
docker run --rm -it \
    -v ${PWD}:/workdir:rw \
    waggle/beekeeper-key-tools:latest \
    create-key-cert.sh \
    -b my-beehive \
    -c beekeeper-keys/bk-ca/beekeeper_ca_key \
    -k beekeeper-keys/node-registration-key/registration \
    -o beekeeper-keys/registration_certs/untilforever
docker-compose up --build

Note: the above options are for testing only and 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

The next set of commands will only work once the node has registered.

VSN can be obtained from the node by:

curl localhost:5000/node/0000000000000001 -d '{"vsn": true}'

Getting the VSN can be done before or after the assignment of beehive or deploying the wes services.

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/node-ssh-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/bk-admin-ssh-key/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. Follow the instructions outlined at https://github.com/waggle-sensor/beekeeper-key-tools for creating a node registration certificate file.

Unit Testing

Unit-testing is executed via

  • ./unit-tests.sh

Requires running docker-compose enviornment.

Development

Access MySQL Console

docker-compose exec db mysql -u root -ptesttest -D Beekeeper

Access Shell on Test Node

docker-compose exec node1 bash

beekeeper's People

Contributors

iperezx avatar jswantek avatar nconrad avatar seanshahkarami avatar wgerlach avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

beekeeper's Issues

Swap out wes-minimal

The WES image used for the docker-compose dev file uses a 7 month old image.

Ideally we will want to use the most up-to-date version of https://github.com/waggle-sensor/waggle-edge-stack so a user is using something similar to prod.

We could setup github actions and do the releases for wes so I can pull from the latest or some specific tag.

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.