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
Support linux/arm #1767
Comments
Cool initiative, +1. One thing to note here is that currently, there are two main arm platforms in use, older 32 bit one is called armhf (RPi 1 + 2, odroid U/XU), and newer is called aarch64/arm64 (RPi 3, odroid C). I think that by meaning 'arm', you mean 'armhf' here? |
@sokoow yes I think starting with armhf makes sense, and getting the drone agent and git plugin ported would be the most important. I'm thinking one of the first things we can do is create a sample const (
BaseImage = "busybox"
GitImage = "plugins/git"
) sample const (
BaseImage = "armhf/alpine"
GitImage = "plugins/git:arm"
) |
in response to #1766 (comment)
@firecyberice drone uses CGO to compile with sqlite. This means that if you compile on amd64 for arm that CGO will be disabled and as a result, the C sqlite library won't be compiled into the binary. so in order to build an official drone arm image, with sqlite support and server support, we would need to build drone on an arm environment. We should be able to build an arm image by modifying the
this will still require some agent modifications to change the ambassador container, as mentioned above. And it will still require arm versions of at least the git plugin. But perhaps it is a good start? |
I setup drone on ARM over the weekend. It wasn't so hard and I'm planning to document the process sometime this week. Most of the needed work seems to be already in place. In summary:
If you want to take a look, this is a simple example. All the components used are part of the organisation. I think the main challenge is finding proper ARM base images that are dependable (eg. I had to use It also looks like it'd be possible to integrate ARM agents and restrict builds on certain architectures, so this could potentially be part of the official pipelines (using constraints and the |
@alkar you can also see a lot of arm plugins at https://github.com/armhf-drone-plugins |
@alkar if you are interested, I would love a pull request to extract the ambassador image name as a constant into separate files, using build tags as described in #1767 (comment)
yes these parameters are in place so that we can eventually have separate queues per operating system and architecture. This should land in 0.6 |
I'm guessing for slack we could use The Git and Docker plugins will be a bit more tricky since we'll need to install git and other software when we build the image. This means we'll therefore need to build the images on arm machines, which I don't have setup yet. So we can possibly setup automated builds for Slack arm images today using my existing build infrastructure. The others we might have to manually push in the short term. |
@tboerger strange I didn't come across those, thanks!
@bradrydzewski I think I might be able to throw in a few hours this weekend.
That sounds like an easy win!
I'd be more than happy to donate an agent node to the cause. |
I will have a look at updating that image for 1.12 tonight. |
@alkar I like your idea in the last paragraph for working with constraints on docker-arch :-) I think all drone plugins should use the same base image e.g. https://hub.docker.com/r/armhf/alpine/ for arm and the official counterpart https://hub.docker.com/_/alpine/ for amd64. Or maybe use a self build image with ca-certs that exists in the same namespace like the plugins and can also be used as ambassador image. |
The best option should be to define arch specific default ambassador images but to also provide a flash for the agent to override the image |
@djmaze that's great, thanks! @firecyberice I saw that but I thought it's based off the 0.4 version of drone? And I agree that drone plugins should use the respective images for ARM, but as I said, that might be a bit difficult because someone would have to provide those base images and make sure they are equivalent to the x86 images. |
@alkar The images mentioned in my previous post are from the upstream (official) docker library even the arm ones :) |
@alkar FYI, |
I just submitted pull request #1771 that allows us to change the ambassador image based on os and architecture. Can I get a code review just to make sure I'm using the correct armhf ambassador image? This pull request will allow you to start the agent with the
Once merged, this should allow you to use the official arm binary to start the agent on an arm server, connect to a drone server on an amd64 machine, and run builds. Note that this will still require you to provide your own arm plugin implementations:
... but hopefully this is an important first step toward native arm support |
@djmaze thanks for the update, much appreciated! @bradrydzewski I just had a look at your PR, it's a good starting point indeed, thanks! I'm afraid I won't have time to test this out until next week but I'll post back when I do so. |
This is a bit of a late response but amidst holidays and a busy work schedule, I've finally managed to put it all together in a (hopefully) user-friendly format in armswarm/drone-on-arm. I've now got a drone setup on ARM which works without any hacks and which uses the most recent versions of base ARM images. |
anyone have some quick / easy instructions to install |
@DieterReuter can you give a hint how to setup qemu on a mac? |
@bradrydzewski I have an idea for providing the plugins for another architecture. |
@firecyberice I'm going to start playing around with this in the coming weeks. I might do something similar to what you suggested, providing In the |
I might be completely off here (been a while since I worked on drone & ARM) but I thought the Git and Drone plugins should already work using |
@alkar we removed the reason we stopped automatically prefixing image names is because it caused a bit of confusion among users. For example |
Any progress on this since November? I will note that the requirement for a |
For everyone out there, i managed to compile succesfully drone on arm using this custom FROM armhf/alpine:3.5
EXPOSE 8000
ENV DATABASE_DRIVER=sqlite3
ENV DATABASE_CONFIG=/var/lib/drone/drone.sqlite
ENV GODEBUG=netdns=go
RUN apk add --no-cache ca-certificates
ADD release/drone /drone
ENTRYPOINT ["/drone"]
CMD ["server"] Firstly, you need to compile drone yourself. Instructions here are fine even for ARM. Then, use the following version: '2'
services:
drone-server:
image: <your-built-image-tag>
ports:
- 23456:8000
volumes:
- drone:/var/lib/drone
restart: always
environment:
- DRONE_OPEN=false
- DRONE_SECRET=${DRONE_SECRET}
- DRONE_ADMIN=<your-drone-username>
drone-agent:
image: <your-built-image-tag>
command:
- agent
- --namespace=<your-docker-registry-userename>
- --privileged=<your-built-docker-plugin-image-tag> # These lines are for the docker plugin
- --privileged=<your-built-docker-plugin-image-tag>:*
- --timeout=30m
- --docker-os=linux # Declare explicitly os and architecture, otherwise it will default to x86-64
- --docker-arch=arm
restart: always
depends_on: [ drone-server ]
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
- DRONE_SERVER=ws://drone-server:8000/ws/broker
- DRONE_SECRET=${DRONE_SECRET}
- DOCKER_OS=linux # Same as above
- DOCKER_ARCH=arm
volumes:
drone: Then, build your git plugin. Clone this repo and edit pipeline:
clone:
image: <your-built-git-plugin-image-tag> The docker plugin is more tricky. You firstly need to build a dind (docker-in-docker) image that will be the base image of the plugin. Clone this repo (which is mine) and Hope you find this helpful. |
This is not really useful because drone lacks done stuff for multi arch support. Beside that somebody is already maintaining a drone port for arm |
The setup shown in my previous post works fine: it can run basic pipelines. The problem is that several images should be mantained and built in order to get the thing up and running. |
At https://discuss.drone.io/t/drone-ported-to-arm/55/10 you can see an old thread related to arm builds |
@tboerger do you have a link? |
Looks like they have not migrated it to 0.5 yet :( |
@NicolasPetton @tboerger Yes, this is currently a bit of a mess since we haven't updated the automated builds yet, but I manually built 0.5 versions of the most important images already. I just pushed the latest ones: armhfbuild/drone, armhfplugins/git and just now armhfplugins/docker. I will update the code for the automated builds soon, when I find some time. See armhfbuild/traefik for a working example where these are in use. |
Maybe it is even possible to build multiarch Images so it does not matter on which platform the image is used because the docker-engine decides which arch to pull. |
Note that the |
Publishing mutli-arch images does not mean Drone supports multi-arch. If we built and published a Drone windows image, for example, Drone would still not be able to execute a pipeline for a windows project. This is being worked on, but requires code changes and other pre-requisites in place. |
locking this issue. please direct message me on gitter for updates |
I have started publishing I will continue posting to this thread as I have more information to share, specifically with regards to official git and docker plugins for arm. |
there are now official armhf images for the git and docker plugins. They are tagged as
|
there are now official arm64 images for the git and docker plugins. They are tagged as
|
I am closing this issue as complete. We now have official agent, git and docker images for armhf and aarch64 architectures compatible with drone 0.8 (release candidate should be available this week). armhf and aarch64 agents:
armhf git and docker plugins:
aarch64 git and docker plugins:
When using drone with multiple architectures you should specify the target architecture in your yaml file as demonstrated below
Example yaml configuration for an arm pipeline:
At this time I am not publishing the drone server for arm architectures. You can run the drone server on amd64 and connect agents running on arm architectures. I may reconsider in the future, but if you need to run the drone server on arm you will need to manually compile or download a community supported drone server image. |
@bradrydzewski This is really awesome, thank you for your work! It would be even nicer if we pushed multiple-platform images for the plugins someday, so there would be no extra configuration needed. Also, +1 for drone server on arm. |
@djmaze thanks :) I definitely would like to push multi-platform images if they can simplify the tooling. Although maybe we could have a edit: looks like there are plans to support this capability in mainline docker docker/cli#138 |
I'm a bit late but will drone server support the architecture of Raspberry Pi (arm) ? |
@HelloEdit we have experimental arm and arm64 images available for the agent only, as well as the git and docker plugins. The server image is amd64 only. The arm images are not yet officially supported (by me) and not yet documented. So if you would like to use them you will need to through this comment thread for usage details. I would start with #1767 (comment). |
I built drone-server on an rpi a few weeks ago. I don't see why it shouldn't build on arm. |
I am not against the images of the community, but they are no longer update :( |
@HelloEdit these images are official and are updated frequently, on every commit to master
The server is the only image for which an official Docker image is not provided, but you can build the drone server for arm using the existing Dockerfile in the root of the repository. No modifications to the Dockerfile are required. Simply run the following commands on arm, from the root of the repository:
When official documentation is available and official server images are available I will post updates here. In the mean time I am locking the issue since this discussion should probably be moved to our community channel at https://gitter.im/drone/drone |
this issue will discuss a strategy for an official arm image for drone.
cc @firecyberice @sokoow @djmaze
The text was updated successfully, but these errors were encountered: