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

ci(multiarch): build archs in separate runners #585

Merged
merged 30 commits into from
Jul 29, 2024

Conversation

andrewazores
Copy link
Member

@andrewazores andrewazores commented Jul 26, 2024

Welcome to Cryostat! 👋

Before contributing, make sure you have:

  • Read the contributing guidelines
  • Linked a relevant issue which this PR resolves
  • Linked any other relevant issues, PR's, or documentation, if any
  • Resolved all conflicts, if any
  • Rebased your branch PR on top of the latest upstream main branch
  • Attached at least one of the following labels to the PR: [chore, ci, docs, feat, fix, test]
  • Signed all commits using a GPG signature

To recreate commits with GPG signature git fetch upstream && git rebase --force --gpg-sign upstream/main


Fixes #372
See #373

Description of the change:

As described in #372 (comment).

This ends up being rather similar to how 2.4 was built: https://github.com/cryostatio/cryostat-legacy/blob/b8d239aa4435569b36785d4cf10a79538c06decf/.github/workflows/push-ci.yml#L24

except this approach uses a build matrix instead of hardcoding the arch cases.

Some hacking around with using docker instead of podman so that the docker.buildx Quarkus container image extension property can be used, and other similar workarounds, are taken here to get things working without needing to upgrade to a newer Quarkus version where the podman extension supports setting the platform/architecture differently than the build host. It was simpler in a way with 2.4 since there the image build is a bit more manually/explicitly controlled using jib, but this worked out in the end after a lot of tinkering.

My testing on an M1 machine, using the image from the sample run below, shows successful loading of netty epoll:

cryostat-1        | ERROR: Podman API request failed
cryostat-1        | io.netty.channel.AbstractChannel$AnnotatedConnectException: connect(..) failed: Permission denied: /run/user/1000/podman/podman.sock
cryostat-1        | Caused by: java.net.ConnectException: connect(..) failed: Permission denied
cryostat-1        |     at io.netty.channel.unix.Errors.newConnectException0(Errors.java:166)
cryostat-1        |     at io.netty.channel.unix.Errors.handleConnectErrno(Errors.java:131)
cryostat-1        |     at io.netty.channel.unix.Socket.connect(Socket.java:351)
cryostat-1        |     at io.netty.channel.epoll.AbstractEpollChannel.doConnect0(AbstractEpollChannel.java:778)
cryostat-1        |     at io.netty.channel.epoll.AbstractEpollChannel.doConnect(AbstractEpollChannel.java:763)
cryostat-1        |     at io.netty.channel.epoll.EpollDomainSocketChannel.doConnect(EpollDomainSocketChannel.java:89)
cryostat-1        |     at io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.connect(AbstractEpollChannel.java:602)
cryostat-1        |     at io.netty.channel.DefaultChannelPipeline$HeadContext.connect(DefaultChannelPipeline.java:1342)
cryostat-1        |     at io.netty.channel.AbstractChannelHandlerContext.invokeConnect(AbstractChannelHandlerContext.java:655)
cryostat-1        |     at io.netty.channel.AbstractChannelHandlerContext.connect(AbstractChannelHandlerContext.java:634)
cryostat-1        |     at io.netty.channel.AbstractChannelHandlerContext.connect(AbstractChannelHandlerContext.java:618)
cryostat-1        |     at io.netty.channel.DefaultChannelPipeline.connect(DefaultChannelPipeline.java:978)
cryostat-1        |     at io.netty.channel.AbstractChannel.connect(AbstractChannel.java:265)
cryostat-1        |     at io.netty.bootstrap.Bootstrap$3.run(Bootstrap.java:264)
cryostat-1        |     at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:173)
cryostat-1        |     at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:166)
cryostat-1        |     at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)
cryostat-1        |     at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:416)
cryostat-1        |     at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
cryostat-1        |     at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
cryostat-1        |     at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
cryostat-1        |     at java.base/java.lang.Thread.run(Thread.java:840)

now there is a different permissions error since that machine is using rootfull podman instead of rootless, but the original problem of the native library not being loaded is resolved.

Motivation for the change:

#372 , and faster approach compared to #373

Sample Run

https://github.com/andrewazores/cryostat3/actions/runs/10120899555

image

@andrewazores andrewazores marked this pull request as ready for review July 27, 2024 04:26
@andrewazores andrewazores requested a review from a team as a code owner July 27, 2024 04:26
@andrewazores
Copy link
Member Author

/build_test

Copy link

Workflow started at 7/27/2024, 12:40:09 AM. View Actions Run.

Copy link

No GraphQL schema changes detected.

Copy link

No OpenAPI schema changes detected.

Copy link

CI build and push: All tests pass ✅
https://github.com/cryostatio/cryostat/actions/runs/10120922839

Copy link
Contributor

@aali309 aali309 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@andrewazores andrewazores merged commit 1d6cd5c into cryostatio:main Jul 29, 2024
8 checks passed
@andrewazores andrewazores deleted the ci-arch-matrix branch July 29, 2024 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] epoll for container discovery is only packaged for amd64 images
2 participants