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

build(arch): use build arch profiles for native dependency classification #371

Merged
merged 1 commit into from
Apr 15, 2024

Conversation

andrewazores
Copy link
Member

Welcome to Cryostat3! 👋

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: #369

Description of the change:

Adds Maven build profiles for build arch (ex. amd64, arm64) and for including or excluding epoll. epoll is used for Unix domain sockets, which we use in ContainerDiscovery for Docker/Podman API discovery of potential target containers.

Motivation for the change:

Since the Netty epoll is a native dependency, ie contains compiled code rather than Java bytecode, the correct architecture for this dependency must be selected at build time to match the architecture of the machine that the container will run upon. Before this PR the dependency is hardcoded to amd64, so container discovery cannot function on other architectures such as arm64.

How to manually test:

  1. Run CRYOSTAT_IMAGE=quay.io... bash smoketest.bash...
  2. Ensure Docker/Podman discovery is still working
  3. If an ARM64 machine is available, try a rebuild with ./mvnw -Dbuild.arch=arm64 ... and re-run the smoketest. Docker/Podman discovery should also work here. See https://github.com/cryostatio/cryostat/pull/1548

Still TODO: ensure that the upstream CI builds multiarch images with the correct epoll pulled in for each image within the multiarch manifest

@andrewazores andrewazores requested a review from a team as a code owner April 15, 2024 20:23
@github-actions github-actions bot added the needs-triage Needs thorough attention from code reviewers label Apr 15, 2024
@andrewazores andrewazores added dependencies Pull requests that update a dependency file build chore Refactor, rename, cleanup, etc. safe-to-test and removed needs-triage Needs thorough attention from code reviewers labels Apr 15, 2024
@andrewazores
Copy link
Member Author

/build_test

Copy link

Workflow started at 4/15/2024, 6:40:34 PM. View Actions Run.

Copy link

No OpenAPI schema changes detected.

Copy link

CI build and push: All tests pass ✅ (JDK17)
https://github.com/cryostatio/cryostat3/actions/runs/8697042936

@andrewazores andrewazores merged commit 7cce795 into cryostatio:main Apr 15, 2024
18 of 19 checks passed
@andrewazores andrewazores deleted the epoll-arch branch April 15, 2024 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build chore Refactor, rename, cleanup, etc. dependencies Pull requests that update a dependency file safe-to-test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Request] build arch profiles for epoll and other native dependencies
2 participants