You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2022/05/31 07:09:16 UTC

[GitHub] [camel-k] squakez commented on a diff in pull request #3309: MultiArchitecture support

squakez commented on code in PR #3309:
URL: https://github.com/apache/camel-k/pull/3309#discussion_r885267026


##########
pkg/apis/camel/v1/build_types.go:
##########
@@ -107,6 +107,8 @@ type PublishTask struct {
 type BuildahTask struct {
 	BaseTask    `json:",inline"`
 	PublishTask `json:",inline"`
+	// The platform of build image
+	Platform string `json:"baseImage,omitempty"`

Review Comment:
   I think it should be `json:"platform,omitempty"`



##########
pkg/util/defaults/defaults.go:
##########
@@ -29,13 +29,13 @@ const (
 	DefaultRuntimeVersion = "1.13.0"
 
 	// BuildahVersion --
-	BuildahVersion = "1.14.0"
+	BuildahVersion = "1.23.3"
 
 	// KanikoVersion --
 	KanikoVersion = "0.17.1"
 
 	// baseImage --
-	baseImage = "adoptopenjdk/openjdk11:slim"
+	baseImage = "docker.io/adoptopenjdk/openjdk11:slim"

Review Comment:
   Is this needed by the new Buildah?



##########
script/Makefile:
##########
@@ -19,16 +19,17 @@ OPERATOR_VERSION := $(subst -SNAPSHOT,,$(VERSION))
 LAST_RELEASED_IMAGE_NAME := camel-k-operator
 LAST_RELEASED_VERSION := 1.9.1
 RUNTIME_VERSION := 1.13.0
-BUILDAH_VERSION := 1.14.0
+BUILDAH_VERSION := 1.23.3
 KANIKO_VERSION := 0.17.1
 INSTALL_DEFAULT_KAMELETS := true
 CONTROLLER_GEN_VERSION := v0.6.1
 OPERATOR_SDK_VERSION := v1.14.0
 KUSTOMIZE_VERSION := v4.1.2
 OPM_VERSION := v1.21.0
-BASE_IMAGE := adoptopenjdk/openjdk11:slim
+BASE_IMAGE := docker.io/adoptopenjdk/openjdk11:slim
 LOCAL_REPOSITORY := /tmp/artifacts/m2
 IMAGE_NAME := docker.io/apache/camel-k
+IMAGE_TARGET_PLATFORM := linux/amd64

Review Comment:
   Better move as part of the `images-arch` procedure



##########
pkg/trait/builder.go:
##########
@@ -101,7 +102,14 @@ func (t *builderTrait) Apply(e *Environment) error {
 		}})
 
 	case v1.IntegrationPlatformBuildPublishStrategyBuildah:
+		var platform string
+		var found bool
+		if platform, found = e.Platform.Status.Build.PublishStrategyOptions[builder.BuildahPlatform]; !found {
+			platform = platforms.DefaultSpec().OS + "/" + platforms.DefaultSpec().Architecture + "/" + platforms.DefaultSpec().Variant

Review Comment:
   We're still forcing the build within the architecture where the Camel K operator Pod Node is running. Since we now have the platform as a parameter we should let the user manually provide that information without involving any `platforms` dependency.



##########
script/Makefile:
##########
@@ -90,6 +91,15 @@ TEST_PREBUILD = build
 #GOLDFLAGS += -X github.com/apache/camel-k/pkg/util/olm.DefaultStartingCSV=
 #GOLDFLAGS += -X github.com/apache/camel-k/pkg/util/olm.DefaultGlobalNamespace=openshift-operators
 
+# Define target platform for docker build

Review Comment:
   We better move this check inside the `images-arch` to make sure it will be exclusively used when it is called by that procedure.



##########
pkg/controller/build/build_pod.go:
##########
@@ -243,6 +242,9 @@ func addBuildahTaskToPod(ctx context.Context, c ctrl.Reader, build *v1.Build, ta
 		"buildah",
 		"bud",
 		"--storage-driver=vfs",
+		"--platform",

Review Comment:
   We better add this to the slice conditionally. Ie, if there is a platform, then include this into the slice.



##########
script/Makefile:
##########
@@ -547,3 +581,9 @@ endif
 # Build the bundle image.
 bundle-build: bundle
 	cd bundle && docker build -f Dockerfile -t $(BUNDLE_IMAGE_NAME) .
+
+# Build the bundle image.
+bundle-build-arch: bundle

Review Comment:
   It seems it is not used by any other makefile part



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org