Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ARM version of the worker-manager #22

Closed
naorlivne opened this issue Aug 22, 2017 · 6 comments
Closed

Add ARM version of the worker-manager #22

naorlivne opened this issue Aug 22, 2017 · 6 comments

Comments

@naorlivne
Copy link
Member

As a lot of IoT devices are ARM based it could be wise to have an ARM version of the worker-manager to allow managing them as well.

@mr-sour
Copy link

mr-sour commented Jul 12, 2018

I would like to help with this I have a bunch of raspberry pi's I want to manage/provision and nebula seems like a good opensource fit. Any pointers on where to start?

@naorlivne
Copy link
Member Author

naorlivne commented Jul 13, 2018

Hi @mr-sour,
Thanks for stepping up regarding this issue.

I think that the first step is to get a working dev env of nebula (non ARM) which basically boils down to the following steps:

  • For steps 1& 2 I've found that for a dev env registering at MongoDB Atlas free package for the Mongo backend & at CloudAMQP free package for the RabbitMQ message broker greatly simplify things (both are limited in the free offering but more then enough for a dev env).
  1. Get MongoDB installed & configured

  2. Get RabbitMQ installed & configured

  3. Run a container of the api-manager with the following envvars:

    • BASIC_AUTH_USER=admin
    • BASIC_AUTH_PASSWORD=password
    • RABBIT_HOST=<whatever_your_rabbit_host_is>
    • RABBIT_PORT=<whatever_your_rabbit_port_is>
    • RABBIT_PASSWORD=<whatever_your_rabbit_pass_is>
    • RABBIT_VHOST=<whatever_your_rabbit_vhost_is>
    • RABBIT_USER=<whatever_your_rabbit_user_is>
    • RABBIT_HEARTBEAT=3600
    • MONGO_URL= <whatever_your_mongodb_connection_string_is>
    • SCHEMA_NAME=<whatever_your_mongo_schema_name_is>
    • BASIC_AUTH_ENABLED=true
  4. Create a test Nebula app by making the following HTTP request to your api-manager

POST /api/apps/test HTTP/1.1
Host: <your_api_manager_address>
Authorization: Basic <basic_auth_token_of_your_user_pass_combo>
Content-Type: application/json
Cache-Control: no-cache

{
  "starting_ports": [80],
  "containers_per": {"server": 1},
  "env_vars": {},
  "docker_image" : "nginx",
  "running": true,
  "volumes": [],
  "networks": ["nebula"],
  "devices": [],
  "privileged": false
}
  1. You can run a non ARM based container of the worker-manager with appropriate envvars if you want to ensure everything works correctly now (if all configured correctly you will see a container of the test app started by nebula worker-manager):

    • RABBIT_HOST=<whatever_your_rabbit_host_is>
    • RABBIT_PORT=<whatever_your_rabbit_port_is>
    • RABBIT_PASSWORD=<whatever_your_rabbit_pass_is>
    • RABBIT_VHOST=<whatever_your_rabbit_vhost_is>
    • RABBIT_USER=<whatever_your_rabbit_user_is>
    • RABBIT_HEARTBEAT=3600
    • MONGO_URL= <whatever_your_mongodb_connection_string_is>
    • SCHEMA_NAME=<whatever_your_mongo_schema_name_is>
    • BASIC_AUTH_ENABLED=true
    • MAX_RESTART_WAIT_IN_SECONDS=0
    • APP_NAME=test

Now that you have a real dev env running the real work can begin (yes I know it's annoying to create a dev env but on the bright side it only has to be done once), the good news is that the Python base image that the worker-manager uses supports ARM based chipsets so the only steps needed to create the ARM based version is:

  1. Fork the worker-manager repo on the arm device - raspberry Pi in your case
  2. Run a docker build on said repo on that device - make sure to tag it with something appropiate like nebula-worker-manager:arm<whatever_arm_version_raspberry-pi_is>
  3. Checking thew new image works - just repeat step 5 from the dev env setup and use the new container image you created rather then the nebula project one.
  4. push that created Image to Docker Hub - if you give me your dockerhub username I'll create an ARM version of the worker-manager repo under the nebulaorchestrator org there and give you push access to it, another option is for you to create a repo under your own user

After this is done all that's left is a bit of bureaucracy to let the community knows there is now an ARM version available:

  • Create a pull request to add your name to the CONTRIBUTORS.md list of the project
  • Create a pull request to update the worker-manager README.md with a reference about where the ARM image can be found
  • Create a pull request to update the docs repo with reference about where the about where the ARM image can be found
  • Post a reply in this ticket referencing the pull request that refers to README.md & docs repo update.

Let me know if you need any help with any of the steps above, I know starting is always a lot harder then updating something that's already configured.

@naorlivne naorlivne assigned naorlivne and unassigned naorlivne Jul 13, 2018
@mr-sour
Copy link

mr-sour commented Jul 13, 2018

Hopefully because its not my first rodeo with porting to arm it wont be so bad. I've got a arm cluster on order that I was going to use to experiment with so when that shows up I'm sure I'll have plenty of questions when I get into the thick of it. Ideally when Im done I want a digital ocean instance that can push updates to my devices as long as they have internet. But gotta get it working locally first. Thanks for the response!

@mr-sour
Copy link

mr-sour commented Jul 16, 2018

Also my username on the docker hub is mrsour I think my hardware is showing up midweek also I guess this will be supported and will mainly be tested on ARMv7 but I should be able to spit out builds for ARM11(legacy) to ARMv8 and get the matching hardware in to test.

@naorlivne
Copy link
Member Author

naorlivne commented Jul 16, 2018

@mr-sour gave you push privileges to docker hub Nebula worker repo, let's standardize on the tag format being <nebula_version_number>-armv<arm_version>

Also please make sure not to accidentally push to any existing tag as having an ARM version on them will break workers on any existing non ARM auto-pulling system.

@naorlivne
Copy link
Member Author

naorlivne commented Oct 7, 2018

Both the worker and the API now have ARM64v8 automated builds thanks to shippable - the images are stored in docker HUB and are tagged as follows:

  • nebulaorchestrator/worker:arm64v8 & nebulaorchestrator/api:arm64v8 are the latest branch
  • nebulaorchestrator/worker:branch-arm64v8 & nebulaorchestrator/api::branch-arm64v8 match branch

@mr-sour thanks for your offer to assist in that matter but as shippable allows automatic CD I think it's a better way then manually having to build each time.

At the time of writing only the latest is pushed to ARM - I'm not going to manually rebuild older version on ARM but any numbered version & pushes to latest from now on will be automatically built on ARM as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants