Requesting access to rancher/agent repository

I just had a conversation with David Getzler about building a 32-bit version of rancher/agent container to run on ARM-based hosts. Please grant me access to the necessary repo(s) to be able to generate such container; feel free to contact David Getzler or Will Chan with any questions in regards to this request. Thanks!

Adam Blazczak

1 Like

Everything in Rancher is open-source, so you don’t need any permission… We use the normal GitHub fork/pull-request workflow if you’d like to contribute your changes back (which we would of course appreciate.)

The agent is in https://github.com/rancher/python-agent ; as the name says it’s Python, so the bulk of the work is probably to get a 32-bit ARM python underneath it.

Thanks, Vincent - I saw the repo earlier but the name threw me for a loop. :wink: So, to build rancher/agent-v0.7.11 I would build from rancher/python-agent? What confused me was, I didn’t see v0.7.11 in the releases tab for that repo; I guess the github versions differ from the internal revision numbers.

@blazczak The repo that houses the rancher/agent container is actually here:
https://github.com/rancher/rancher/tree/master/agent.

As you can see, there isn’t much code there. At a high level, when the docker run ... rancher/agent command is ran on a host, the initial container does some bootstrapping and then actually launches another rancher/agent container with additional configuration. You can see that happening here: https://github.com/rancher/rancher/blob/master/agent/run.sh#L68-L96

At that point, the new rancher/agent container connects to the Rancher server and the Rancher server gives it the URLs to specific versions of the software it needs to download. Specifically, it tells the container which version of python-agent, host-api, and some other downloadables. Those version care configured on the Rancher server side and you can view them here: https://github.com/rancher/cattle/blob/master/resources/content/cattle-global.properties#L11-L17

So, there’s a bit of complexity, but hopefully this gets you set down the right path.

Thanks Craig, that makes much more sense.

I was able to build rancher/agent successfully, and Rancher appears to also need rancher/agent-instance on the device to be able to (for example) add containers through the UI. However, when building that image, I get the following errors related to the racoon install:

Generating /etc/default/racoon…
update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults
insserv: warning: script ‘agent-instance-startup’ missing LSB tags and overrides
insserv: There is a loop between service monit and agent-instance-startup if stopped
insserv: loop involving service agent-instance-startup at depth 2
insserv: loop involving service monit at depth 1
insserv: Stopping agent-instance-startup depends on monit and therefore on system facility `$all’ which can not be true!
insserv: exiting now without changing boot order!
update-rc.d: error: insserv rejected the script header
dpkg: error processing package racoon (–configure):
subprocess installed post-installation script returned error exit status 1
Processing triggers for libc-bin (2.19-18) …
Processing triggers for systemd (215-17+deb8u1) …
Errors were encountered while processing:
racoon
E: Sub-process /usr/bin/dpkg returned an error code (1)

How do I fix it? Thanks

did you get this to work?

also which Linux distro did you try this with?

I did, I was able to add Raspberry Pi, Raspberry Pi 2 and BeagleBone Black hosts to a Rancher server and monitor and perform rudimentary maintenance tasks (start, stop, restart, remove) of containers on these machines. I ran Ubuntu 14.04 on Raspberry Pi 2 + BBB and hypriot-rpi-20150727-151455.img.zip image on Raspberry Pi (at the time provided docker 1.x, available from http://blog.hypriot.com/post/moving-docker-from-wheezy-to-jessie/). Now that Raspbian has its own Jessie-based image you should be able to run on the offician raspbian-jessie image when working with the original Pi.

It’s been a while (this was back in August) but I remember having to rebuild rancher-agent and thin-provisioning-tools; change the base image of the rancher-agent Dockerfile to an arm-based image and you will need a few other changes in the Dockerfile to work around the 64 vs 32 bit differences.

Let me know if you need more info.

1 Like

does somebody have a docker image for the rancher agent for arm devices built? or a post explains how. i’m using armbian

Have a look on: https://github.com/rancher/rancher/issues/4703

It’s not so easy anymore to prepare portable rancher agent image. AFAIK agent downloads some binary dependencies from cattle etc.