-
Notifications
You must be signed in to change notification settings - Fork 14
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
Fix BUILDPLATFORM redefinition issue in some Containerfiles #121
Fix BUILDPLATFORM redefinition issue in some Containerfiles #121
Conversation
@msherif1234 I didn't change either of:
These two files also redefine |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #121 +/- ##
=======================================
Coverage 27.61% 27.61%
=======================================
Files 81 81
Lines 6999 6999
=======================================
Hits 1933 1933
Misses 4877 4877
Partials 189 189
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
534da80
to
0925565
Compare
Is there any issue with my change w.r.t. multi-arch builds? |
Yes make sense while u there to remove the duplicate as well for openshift version |
I've seen the following warning when building the operator and agent images:
Is this a similar issue? |
I was wary of "fixing" this in the same way in case that breaks multi-arch builds. But if you're game we can find out. |
I was too. It still seems to work, so let's leave it as is until we get multi-arch builds all worked out, then we can give fixing it a try. |
0925565
to
7b708a9
Compare
|
I wonder if this PR fixes konflux CI issues in #122 |
@Billy99 do you have any concerns with merging this PR? |
7b708a9
to
e274c4f
Compare
@frobware Did you test with docker? I didn't try podman, but a similar change in bpfman repo causes a problem:
Still playing with it. |
I pushed changes today - need to test again with docker. But I think we
should augment the CI workflow to test both docker and podman. It’s much
more efficient than manual testing.
…On Thu, 5 Sep 2024 at 19:21, Billy McFall ***@***.***> wrote:
@Billy99 <https://github.com/Billy99> do you have any concerns with
merging this PR?
@frobware <https://github.com/frobware> Did you test with docker? I
didn't try podman, but a similar change in bpfman repo causes a problem:
$ cat Containerfile.bpfman
ARG BUILDPLATFORM
FROM --platform=$BUILDPLATFORM redhat/ubi9-minimal AS bpfman-build
:
$ docker buildx build --progress=plain --platform linux/arm64 -f ./Containerfile.bpfman . -t quay.io/billy99/bpfman:test
#0 <http://quay.io/billy99/bpfman:test#0> building with "default" instance using docker driver
#1 [internal] load build definition from Containerfile.bpfman
#1 transferring dockerfile: 2.02kB done
#1 DONE 0.0s
Containerfile.bpfman:4
--------------------
2 | ARG BUILDPLATFORM
3 |
4 | >>> FROM --platform=$BUILDPLATFORM redhat/ubi9-minimal AS bpfman-build
5 |
6 | # The following ARGs are set internally by docker/build-push-action in github actions
--------------------
ERROR: failed to solve: failed to parse platform : "" is an invalid component of "": platform specifier component must match "^[A-Za-z0-9_-]+$": invalid argument
Still playing with it.
—
Reply to this email directly, view it on GitHub
<#121 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHGOHYAYE55MVMCOISD223ZVCOLXAVCNFSM6AAAAABNPYE3A6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMZSGM3TGOBRGA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
There is a comment in my bpfman Containerfiles about not using --platform to fill in this ARG, but I didn't write it:
So we could update CI to use both podman and docker (maybe, would have to look at the github actions and make sure there is equivalent for all the actions we are using), but base CI on a push doesn't test for either. Today, images are only built when the PR merges (build and push) or if |
e274c4f
to
9f21992
Compare
It would have tested Docker because the make build-images step is executed prior to running the integration tests. Therefore, even though images are only pushed after a PR merges, the image build itself is still performed during the CI process before the integration tests are executed. I updated the CI steps in commit to run:
This goals was to ensure we validate the image builds with both Docker and Podman. However, the version of Podman that gets installed from the Ubuntu archives (v3.4) is outdated and doesn't catch the redefinition issue, which only appears in Podman 5.2. As a result, while the CI change is valid, it wouldn't have detected the failure due to the older Podman version. The CI output shows that podman is now used in addition to docker for the build-images step. I was trying to avoid manual testing for future PRs by ensuring that |
/hold I want to further understand whether we should be setting any buildplatform/targetplaform/targetarch related ARGS in global scope. Perhaps we only need to define these in build stages and rely on the defaults. |
Removed the hardcoded `ARG BUILDPLATFORM=linux/amd64` from `Containerfile.bpfman-agent{.openshift}` and `Containerfile.bpfman-operator{.openshift}`. This change addresses an issue where Podman fails to build the images if `BUILDPLATFORM` is redefined. By removing the redefinition, the build process is made compatible with Podman. This change remains compatible with Docker. Fixes: bpfman#120 Signed-off-by: Andrew McDermott <amcdermo@redhat.com>
9f21992
to
1dcd857
Compare
/hold cancel I simplified the change in https://github.com/bpfman/bpfman-operator/compare/9f219922bbdc20f27a92518189a449cc96825ad7..1dcd8577e793acd8813ca2c0ba45eb39aa4957c4. We still need to decide whether to keep the CI commit that uses both Podman and Docker for building images. At the very least, it provides some CI coverage for Podman compatibility, even though the version of Podman is very outdated. |
Seems like the same issue looking at the build failure from: https://github.com/bpfman/bpfman-operator/pull/122/checks?check_run_id=29757802714. |
I suspect it's not related. #122 passed multiple integration test cases, then failed on the application one. I wonder if it's just a flake, or if something else changed that's causing that one to fail. I just restarted that test. |
1dcd857
to
58712f0
Compare
I pulled the CI change out as #130. Given how old the version of Podman is on Ubuntu, I'm doubtful of the value of running Podman per the build-images step. This simplifies this PR to focus solely on fixing day-to-day development when using Podman. |
I was focused on the integration test failure, which is cleared up now, but there are still two Konflux failures, so those may be related. |
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
…s/ocp-bpfman-operator-bundle chore(deps): update ocp-bpfman-operator-bundle to 4afcbf5
Removed the hardcoded
ARG BUILDPLATFORM=linux/amd64
fromContainerfile.bpfman-agent{.openshift}
andContainerfile.bpfman-operator{.openshift}
.This change addresses an issue where Podman fails to build the images if
BUILDPLATFORM
is redefined. By removing the redefinition, the buildprocess is made compatible with Podman.
This change remains compatible with Docker, which is more lenient with
ARG redefinitions.
I didn't bisect which version of Podman made this a failure; it doesn't occur with:
but does with:
Fixes: #120