-
Notifications
You must be signed in to change notification settings - Fork 35
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
NETOBSERV-848 eBPF agent multi-arch builds (upstream) #100
Conversation
Makefile
Outdated
@@ -115,14 +112,43 @@ coverage-report-html: cov-exclude-generated | |||
image-build: ## Build OCI image with the manager. | |||
$(OCI_BIN) build --build-arg SW_VERSION="$(SW_VERSION)" -t ${IMG} . |
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.
why we didn't pass in the new build-arg here and make the platform env var and user can pass in the arch it needs to build for instead of having the new targets
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.
so the var will update it's value one after the other for multiarch build ? you will loose the ability to run in parallel like make -j multiarch-manifest-build
🤔
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 was thinking of two make invocation in case of amd and ppc tomorrow could be another platform for ibm or windows
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 didn't found a way to make multiarch-manifest-build
dependencies passing environment variables
The trick here is to concat a simple string that build the dependencies using $(foreach T,$(MULTIARCH_TARGETS),image-push/$T )
Does that work for you ?
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.
another alternative would be to always rely on MULTIARCH_TARGETS
for both image-build
and image-push
and totally get rid of multiarch-manifest-build
and multiarch-manifest-push
commands.
the manifest can either always be created or created only when MULTIARCH_TARGETS
contains at least 2 items.
@OlivierCazade @jotak WDYT ?
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.
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.
sry I'd like to wait for Olivier's input here - he's been the one who has most explored the various options
Makefile
Outdated
OCI_BIN=podman | ||
endif | ||
endif | ||
OCI_BIN_PATH = $(shell which podman || which docker) |
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.
- If podman doesn't exist, for example, it will display an error message. This should be suppressed.
- It should also check that one of podman or docker exists and quit if that is not the case.
- Use := instead of =.
Suggest:
OCI_BIN_PATH := $(shell which podman 2> /dev/null || which docker 2> /dev/null)
ifeq ($(OCI_BIN_PATH),)
$(error Requires podman or docker in PATH)
endif
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.
Yes, I relied on FLP Makefile for such changes. Let's all agree on how to manage that and apply it everywhere !
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.
How about a slight variation:
OCI_BIN_PATH ?= $(shell which podman 2> /dev/null || which docker 2> /dev/null)
ifeq ($(OCI_BIN_PATH),)
$(error Requires OCI-compliant CLI such as podman or docker in PATH)
endif
?=
allows for overriding it, e.g. using a different installation path or another OCI compliant tool
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.
The only problem is that in other parts of the Makefile, it generally uses OCI_BIN, which is the basename of OCI_BIN_PATH (either 'podman' or 'docker') instead of OCI_BIN_PATH which has the absolute path. Therefore, it's possible if you override OCI_BIN_PATH, OCI_BIN could fail or even use a different version depending on PATH.
You could change all OCI_BIN usage to OCI_BIN_PATH. There is at least one case where it's using OCI_BIN to determine if you are running docker or podman.
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.
your suggestions doesn't work with docker.io/library/golang:1.19
image + it's common to simply use $(shell which podman || which docker)
without further checks
I'll keep this as is for now
Codecov Report
@@ Coverage Diff @@
## main #100 +/- ##
=======================================
Coverage 41.80% 41.80%
=======================================
Files 30 30
Lines 2050 2050
=======================================
Hits 857 857
Misses 1155 1155
Partials 38 38
Flags with carried forward coverage won't be shown. Click here to find out more. |
4102b86
to
1c30d65
Compare
/LGTM |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jpinsonneau The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Implements multi arch builds and add documentation and consistency
Please use netobserv/flowlogs-pipeline#426 for main discussion and this PR only for specific items