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
Move ARM build to Github Actions #3847
Conversation
Build SUCCESS |
ec7c8b5
to
171fdc3
Compare
Build FAILURE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
some additiona notes:
- it seems to me that caching docker image does not work: https://github.com/syslog-ng/syslog-ng/runs/4326195497?check_suite_focus=true#step:3:4037 also do we have information how to cache is invalidated ?
- the arm job is considered as optional, it would be nice if in case of failure it does not block merge.
or maybe we could consider changing our view, and state that it is not optional.
.github/workflows/run-on-arm.yml
Outdated
git clone https://github.com/Snaipe/Criterion.git -b v2.3.3 | ||
cd Criterion | ||
git submodule update --init | ||
cd /tmp && wget https://github.com/Snaipe/Criterion/releases/download/v2.3.3/criterion-v2.3.3.tar.bz2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
optional: that script from dbld could be used here directly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see the benefit of it: logic is not copied, if new Criterion is released it would available instantly, though it would require some changes to dbld: the scripts are expected to run inside the container: e.g. this is in dbld/builddeps:
. /dbld/functions.sh
mkdir build | ||
cd build | ||
cmake -DCMAKE_C_FLAGS=-Werror -DPYTHON_VERSION=3 -DCMAKE_INSTALL_PREFIX=$HOME/install/syslog-ng .. | ||
make --keep-going -j $(nproc) all install |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
optional: we do not really required to do install, you can just skip that (some time can be spared there)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
true, I'll check it.
171fdc3
to
e33714f
Compare
Build FAILURE |
I think it should not be optional. ARM is a famous architecture, which is worth supporting/testing in the CI. We have also found general hard-to-catch bugs using an ARM32/64 environment. (Also, Travis was not configured with |
For security reasons pull requests don't get write-access to the base repository.
https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows#pull_request You can check my fork to see how caching works, here is a workflow that uses the cached image: Image is rebuilt if the
|
I think See code: |
As we focus more on GitHub Actions, for testing builds on ARM we could use a github-action that's using Docker + QEMU on Linux, instead of Travis CI. See: github-action: https://github.com/uraimo/run-on-arch-action This patch migrates the current Travis config to the run-on-arch github-action. Following patches make it functional (some packages that are pre-installed in Travis has to be installed), and extend it. Notes: - It's not a native ARM runner though, it uses QEMU - Build time is slow: even after putting dependency installation (including locally-built ones), syslog-ng build is still around 27 minutes (Github runners have 2-core CPUs, but it was slow on my 4-core i7 CPU too) - It requires a docker image to be built first, in order to run. We can cache the docker images in the Github Packages (similarly to dbld images) Alternative github-action: - https://github.com/pguyot/arm-runner-action Similarly it can run ARM-based binaries with QEMU. Not docker-based, it uses a chroot environment and an image of the given distribution. It also creates an image that can be used on Raspberry PI. Currently it is limited to Raspberry PI. Signed-off-by: Gabor Nagy <gabor.nagy@oneidentity.com>
Signed-off-by: Gabor Nagy <gabor.nagy@oneidentity.com>
With this change only I saw a ~70 minutes runtime changing to ~47 minutes. This would significantly improve the running time once only syslog-ng will be built during runtime: from around ~47 minutes to ~ 25 minutes. Image name it not entirely configurable, it looks like this: "run-on-arch-${GITHUB_REPOSITORY}-${GITHUB_WORKFLOW}-${arch}-${distro}" E.g. `run-on-arch-gaborznagy-syslog-ng-arm-docker-aarch64-bullseye ` Signed-off-by: Gabor Nagy <gabor.nagy@oneidentity.com>
run-on-arch doesn't support Debian Testing (yet) https://github.com/uraimo/run-on-arch-action Signed-off-by: Gabor Nagy <gabor.nagy@oneidentity.com>
Travis provided several build-tools by-default. On docker we have to install these manually. Also, enable additional modules by installing their dependencies (e.g. libpaho-mqtt-c). Signed-off-by: Gabor Nagy <gabor.nagy@oneidentity.com>
This way we don't have to fetch criterion's submodules This is how we build criterion in dbld too. Also remove sudo usage, and build criterion under /tmp/ Signed-off-by: Gabor Nagy <gabor.nagy@oneidentity.com>
Also remove usage of sudo. Signed-off-by: Gabor Nagy <gabor.nagy@oneidentity.com>
Signed-off-by: Gabor Nagy <gabor.nagy@oneidentity.com>
…age build Since they have to be updated manually, we can build and install them during image build to save significant time. - bison build time is around 16 minutes 30 seconds - criterion build time is 5 minutes 30 seconds (syslog-ng build time is around 20 minutes) Signed-off-by: Gabor Nagy <gabor.nagy@oneidentity.com>
Signed-off-by: Gabor Nagy <gabor.nagy@oneidentity.com>
Signed-off-by: Gabor Nagy <gabor.nagy@oneidentity.com>
e33714f
to
b0ac078
Compare
@kira-syslogng retest this please; |
Build SUCCESS |
There were some improvements around ARM runners by GitHub: https://resources.github.com/devops/actions/arm-virtual-hardware/ Haven't read it thoroughly, but we could take a look. |
Thanks for the info. It still looks like it requires AWS. |
One thing to consider, is that we already use AWS for Kira, maybe we can utilize that. |
Hi there! Any news? |
Fyi: the folks at Axoflow started to build an alpine based container for
arm, here:
https://github.com/axoflow/syslog-ng-docker
You can find the images in the "packages" section of GitHub, they are
hosted on ghcr.io
Those builds are automatically built as a new syslog-ng release is made,
nightly is also available.
Disclaimer: I am also affiliated with axoflow.
…On Fri, Apr 7, 2023, 04:07 Nicolas Rodriguez ***@***.***> wrote:
Hi there! Any news?
—
Reply to this email directly, view it on GitHub
<#3847 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFOK5RWEMNWELORYI3ZC3LW75SEDANCNFSM5IUHPG6A>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
We need something that runs per-PR on ARM. We can close this PR and open an issue instead, if that's convenient for you. |
Testing ARM should be a lot faster now, as instead of emulation, it runs now on Ampere servers. At least my Twitter feed was loud about it a few weeks ago. |
Also, a bit out of topic, but still "aarch64": |
i could sware that i checked this multiple times at that time and did not yet work for none large or xlarge targets, thanks for pointing this out again! |
I'll revisit this topic and add an ARM-based workflow for running our tests, so let's close this one for now. |
As we focus more on GitHub Actions, we could use a github-action for testing builds on ARM instead of Travis CI.
The github-action: https://github.com/uraimo/run-on-arch-action
It is using Docker + QEMU on Linux and it can build on
armv7
andppc64le
too.This PR migrates the current Travis config to the
run-on-arch
github-action.Notes:
syslog-ng build is still around 27 minutes (Github runners have 2-core CPUs, but it was slow on my 4-core i7 CPU too)
We can cache the docker images in the Github Packages (similarly to dbld images).
image name is:
run-on-arch-${GITHUB_REPOSITORY}-${GITHUB_WORKFLOW}-${arch}-${distro}
The image is used as a cache for later runs, so any change in the image (e.g. new dependency), will trigger the docker build.
Alternative github-action:
Similarly it can run ARM binaries with QEMU.
Not docker-based, it uses a chroot environment and an image of the given distribution.
It also creates an image that can be used on Raspberry PI.
Currently it is limited to Raspberry PI.
Some example runs: https://github.com/gaborznagy/syslog-ng/actions/workflows/run-on-arm.yml
TODO:
This is just an interesting idea, unfortunately the runtime is long. The PR is open to discussions. :)