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/07/08 18:14:17 UTC

[GitHub] [camel-k] SubhasmitaSw opened a new pull request, #3427: Add mvnd build strategy

SubhasmitaSw opened a new pull request, #3427:
URL: https://github.com/apache/camel-k/pull/3427

   Resolves 2nd part of #2832 
   
   
   
   **Release Note** 
   
   ```
   feat(builder): Add Maven Daemon support
   ```
   
   cc @astefanutti 


-- 
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


[GitHub] [camel-k] SubhasmitaSw commented on pull request #3427: Add mvnd build strategy

Posted by GitBox <gi...@apache.org>.
SubhasmitaSw commented on PR #3427:
URL: https://github.com/apache/camel-k/pull/3427#issuecomment-1182903367

   `gnu-sed` is failing, causing the post processing steps to abort returning an error like: 
   
   ```
   ➜  camel-k git:(mvnd-support) ✗ make generate-crd
   go: creating new go.mod: module tmp
   CONTROLLER_GEN=/Users/chikki/go/bin/controller-gen ./script/gen_crd.sh
   sed: 1: "/creationTimestamp:/a\  ...": extra characters after \ at the end of a command
   make: *** [generate-crd] Error 1
   ``` 
   


-- 
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


[GitHub] [camel-k] astefanutti commented on a diff in pull request #3427: Add mvnd build strategy

Posted by GitBox <gi...@apache.org>.
astefanutti commented on code in PR #3427:
URL: https://github.com/apache/camel-k/pull/3427#discussion_r917622518


##########
pkg/apis/camel/v1/common_types.go:
##########
@@ -48,7 +48,12 @@ const (
 	// BuildStrategyPod performs the build in a `Pod` (will schedule a new builder ephemeral `Pod` which will take care of the build action).
 	// This strategy has the limitation that every build will have to download all the dependencies required by the Maven build.
 	BuildStrategyPod BuildStrategy = "pod"
-)
+	// BuildStrategyType is the type of strategy that should be used to perform the build.

Review Comment:
   Can be removed.



##########
pkg/apis/camel/v1/common_types.go:
##########
@@ -48,7 +48,12 @@ const (
 	// BuildStrategyPod performs the build in a `Pod` (will schedule a new builder ephemeral `Pod` which will take care of the build action).
 	// This strategy has the limitation that every build will have to download all the dependencies required by the Maven build.
 	BuildStrategyPod BuildStrategy = "pod"
-)
+	// BuildStrategyType is the type of strategy that should be used to perform the build.
+ 	// It will trigger a Maven daemon process that will take care of producing the expected Camel/Camel-Quarkus runtime. 
+ 	// The Maven daemon will be run in a container. 
+ 	// +kubebuilder:validation:Enum=routine;pod
+ 	BuildStrategType BuildStrategy = "mvnd"

Review Comment:
   `BuildStrategType` -> `BuildStrategyMvnd`



##########
pkg/apis/camel/v1/common_types.go:
##########
@@ -48,7 +48,12 @@ const (
 	// BuildStrategyPod performs the build in a `Pod` (will schedule a new builder ephemeral `Pod` which will take care of the build action).
 	// This strategy has the limitation that every build will have to download all the dependencies required by the Maven build.
 	BuildStrategyPod BuildStrategy = "pod"
-)
+	// BuildStrategyType is the type of strategy that should be used to perform the build.
+ 	// It will trigger a Maven daemon process that will take care of producing the expected Camel/Camel-Quarkus runtime. 
+ 	// The Maven daemon will be run in a container. 
+ 	// +kubebuilder:validation:Enum=routine;pod
+ 	BuildStrategType BuildStrategy = "mvnd"
+) 
 
 // BuildStrategies is a list of strategies allowed for the build
 var BuildStrategies = []BuildStrategy{

Review Comment:
   The new strategy should be listed there.



##########
pkg/apis/camel/v1/common_types.go:
##########
@@ -48,7 +48,12 @@ const (
 	// BuildStrategyPod performs the build in a `Pod` (will schedule a new builder ephemeral `Pod` which will take care of the build action).
 	// This strategy has the limitation that every build will have to download all the dependencies required by the Maven build.
 	BuildStrategyPod BuildStrategy = "pod"
-)
+	// BuildStrategyType is the type of strategy that should be used to perform the build.
+ 	// It will trigger a Maven daemon process that will take care of producing the expected Camel/Camel-Quarkus runtime. 
+ 	// The Maven daemon will be run in a container. 
+ 	// +kubebuilder:validation:Enum=routine;pod

Review Comment:
   Can be removed.



##########
pkg/builder/quarkus.go:
##########
@@ -143,14 +143,16 @@ func GenerateQuarkusProjectCommon(camelQuarkusVersion string, runtimeVersion str
 					},
 				},
 			},
+			Extensions: true,
 		},
 	)
 
 	return p
 }
 
 func buildQuarkusRunner(ctx *builderContext) error {
-	mc := maven.NewContext(path.Join(ctx.Path, "maven"))
+	// Build the project using the new Maven daemon build strategy 
+	mc := maven.NewContext(path.Join(ctx.Path, "mvnd"))

Review Comment:
   That argument is the directory where the Maven project is created, that can be kept as is.



##########
pkg/apis/camel/v1/common_types.go:
##########
@@ -36,8 +36,8 @@ const (
 )
 
 // BuildStrategy specifies how the Build should be executed.
-// It will trigger a Maven process that will take care of producing the expected Camel/Camel-Quarkus runtime.
-// +kubebuilder:validation:Enum=routine;pod
+// It will trigger a Maven daemon process that will take care of producing the expected Camel/Camel-Quarkus runtime. The Maven daemon will be run in a container. 
+// +kubebuilder:validation:Enum=routine;pod 

Review Comment:
   `+kubebuilder:validation:Enum=routine;pod ` -> `+kubebuilder:validation:Enum=routine;pod;mvnd` 



##########
build/Dockerfile:
##########
@@ -22,26 +22,36 @@ ARG BASE_URL="https://archive.apache.org/dist/maven/maven-3/${MAVEN_VERSION}/bin
 
 USER 0
 
-RUN mkdir -p ${MAVEN_HOME} \
-    && curl -Lso /tmp/maven.tar.gz ${BASE_URL}/apache-maven-${MAVEN_VERSION}-bin.tar.gz \
-    && echo "${SHA} /tmp/maven.tar.gz" | sha512sum -c - \
-    && tar -xzC ${MAVEN_HOME} --strip-components=1 -f /tmp/maven.tar.gz \
-    && rm -v /tmp/maven.tar.gz \
-    && ln -s ${MAVEN_HOME}/bin/mvn /usr/bin/mvn \
-    && rm ${MAVEN_HOME}/lib/maven-slf4j-provider*
+RUN microdnf update && microdnf install procps
+
+RUN temp=$(mktemp -d) \
+&& curl -Lso "$temp"/mvnd.zip https://github.com/mvndaemon/mvnd/releases/download/0.7.1/mvnd-0.7.1-linux-amd64.zip \

Review Comment:
   That can be updated to use the latest Mvnd release.



##########
pkg/apis/camel/v1/common_types.go:
##########
@@ -36,8 +36,8 @@ const (
 )
 
 // BuildStrategy specifies how the Build should be executed.
-// It will trigger a Maven process that will take care of producing the expected Camel/Camel-Quarkus runtime.
-// +kubebuilder:validation:Enum=routine;pod
+// It will trigger a Maven daemon process that will take care of producing the expected Camel/Camel-Quarkus runtime. The Maven daemon will be run in a container. 

Review Comment:
   I'd suggest to keep the existing documentation, that's generic enough to cover the new strategy as well.



##########
pkg/builder/quarkus.go:
##########
@@ -143,14 +143,16 @@ func GenerateQuarkusProjectCommon(camelQuarkusVersion string, runtimeVersion str
 					},
 				},
 			},
+			Extensions: true,
 		},
 	)
 
 	return p
 }
 
 func buildQuarkusRunner(ctx *builderContext) error {
-	mc := maven.NewContext(path.Join(ctx.Path, "maven"))
+	// Build the project using the new Maven daemon build strategy 
+	mc := maven.NewContext(path.Join(ctx.Path, "mvnd"))

Review Comment:
   The strategy from the `builderContext` should be set on the `maven.Context` variable.



##########
pkg/util/maven/maven_command.go:
##########
@@ -48,13 +48,15 @@ func (c *Command) Do(ctx context.Context) error {
 		return err
 	}
 
-	mvnCmd := "mvn"
+	mvnCmd := "mvnd"

Review Comment:
   That should be set depending on the strategy set on the context.



##########
build/Dockerfile:
##########
@@ -22,26 +22,36 @@ ARG BASE_URL="https://archive.apache.org/dist/maven/maven-3/${MAVEN_VERSION}/bin
 
 USER 0
 
-RUN mkdir -p ${MAVEN_HOME} \
-    && curl -Lso /tmp/maven.tar.gz ${BASE_URL}/apache-maven-${MAVEN_VERSION}-bin.tar.gz \

Review Comment:
   Even if Mvnd embed its own Maven version, it may be preferable to package a separate version to avoid locking the Maven dependency to the Maven Daemon one.



-- 
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


[GitHub] [camel-k] astefanutti commented on a diff in pull request #3427: Add mvnd build strategy

Posted by GitBox <gi...@apache.org>.
astefanutti commented on code in PR #3427:
URL: https://github.com/apache/camel-k/pull/3427#discussion_r917987846


##########
pkg/builder/quarkus.go:
##########
@@ -151,6 +152,7 @@ func GenerateQuarkusProjectCommon(camelQuarkusVersion string, runtimeVersion str
 
 func buildQuarkusRunner(ctx *builderContext) error {
 	mc := maven.NewContext(path.Join(ctx.Path, "maven"))

Review Comment:
   We should update the other places where `maven.NewContext` is called as well.



-- 
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


[GitHub] [camel-k] claudio4j commented on pull request #3427: Add mvnd build strategy

Posted by GitBox <gi...@apache.org>.
claudio4j commented on PR #3427:
URL: https://github.com/apache/camel-k/pull/3427#issuecomment-1284571407

   Hi @SubhasmitaSw do you plan to continue working on this change ?


-- 
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


[GitHub] [camel-k] ppalaga commented on pull request #3427: Add mvnd build strategy

Posted by GitBox <gi...@apache.org>.
ppalaga commented on PR #3427:
URL: https://github.com/apache/camel-k/pull/3427#issuecomment-1181444568

   > Is there a way to instruct the Maven daemon to use an external Maven installation?
   
   mvnd currently does not support that use case. It would be hard and the result would be very fragile. 


-- 
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


[GitHub] [camel-k] astefanutti commented on a diff in pull request #3427: Add mvnd build strategy

Posted by GitBox <gi...@apache.org>.
astefanutti commented on code in PR #3427:
URL: https://github.com/apache/camel-k/pull/3427#discussion_r950233365


##########
pkg/controller/build/build_controller.go:
##########
@@ -155,7 +155,7 @@ func (r *reconcileBuild) Reconcile(ctx context.Context, request reconcile.Reques
 			newErrorRecoveryAction(),
 			newErrorAction(),
 		}
-	case v1.BuildStrategyRoutine:
+	case v1.BuildStrategyRoutine + v1.BuildStrategyMvnd:

Review Comment:
   I suspect this should be `case v1.BuildStrategyRoutine, v1.BuildStrategyMvnd:` instead.



-- 
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


[GitHub] [camel-k] astefanutti commented on a diff in pull request #3427: Add mvnd build strategy

Posted by GitBox <gi...@apache.org>.
astefanutti commented on code in PR #3427:
URL: https://github.com/apache/camel-k/pull/3427#discussion_r918917396


##########
pkg/util/maven/maven_command.go:
##########
@@ -48,13 +49,21 @@ func (c *Command) Do(ctx context.Context) error {
 		return err
 	}
 
-	mvnCmd := "mvn"
+	mvnCmd := ""
+	switch c.context.Strategy {
+	case "default":

Review Comment:
   `case "default:` -> `default:`



##########
pkg/apis/camel/v1/common_types.go:
##########
@@ -48,12 +47,17 @@ const (
 	// BuildStrategyPod performs the build in a `Pod` (will schedule a new builder ephemeral `Pod` which will take care of the build action).
 	// This strategy has the limitation that every build will have to download all the dependencies required by the Maven build.
 	BuildStrategyPod BuildStrategy = "pod"
+	// BuildStrategyType is the type of strategy that should be used to perform the build.

Review Comment:
   "BuildStrategyMvnd performs the build using Apache Maven Daemon, that's started in the operator Pod."



##########
pkg/apis/camel/v1/common_types.go:
##########
@@ -37,7 +37,6 @@ const (
 
 // BuildStrategy specifies how the Build should be executed.
 // It will trigger a Maven process that will take care of producing the expected Camel/Camel-Quarkus runtime.
-// +kubebuilder:validation:Enum=routine;pod

Review Comment:
   It should be `+kubebuilder:validation:Enum=routine;pod;mvnd`



##########
pkg/apis/camel/v1/common_types.go:
##########
@@ -37,7 +37,6 @@ const (
 
 // BuildStrategy specifies how the Build should be executed.
 // It will trigger a Maven process that will take care of producing the expected Camel/Camel-Quarkus runtime.
-// +kubebuilder:validation:Enum=routine;pod

Review Comment:
   Also the CRDs must be regenerated to take into account the new value.



##########
pkg/apis/camel/v1/build_types.go:
##########
@@ -38,7 +38,6 @@ type BuildSpec struct {
 	// +kubebuilder:validation:Format=duration
 	Timeout metav1.Duration `json:"timeout,omitempty"`
 }
-

Review Comment:
   Should be reverted.



-- 
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


[GitHub] [camel-k] astefanutti commented on pull request #3427: Add mvnd build strategy

Posted by GitBox <gi...@apache.org>.
astefanutti commented on PR #3427:
URL: https://github.com/apache/camel-k/pull/3427#issuecomment-1181420147

   > Not 100% sure what is your aim, @SubhasmitaSw
   > To install mvnd, you need not only the `mvnd` binary. You also need the `mvn` directory from the distribution zip and the `mvnd` binary must be informed where to find that mvn directory via `~/.m2/mvnd.properties` or via env. var `MVND_HOME`.
   
   @ppalaga The Camel K operator image will have both Maven and Maven Daemon. We were wondering whether it's possible to avoid having two Maven versions packaged, that are the standard Maven one and the embedded one into the Maven Daemon distribution. Is there a way to instruct the Maven daemon to use an external Maven installation?


-- 
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


[GitHub] [camel-k] astefanutti commented on a diff in pull request #3427: Add mvnd build strategy

Posted by GitBox <gi...@apache.org>.
astefanutti commented on code in PR #3427:
URL: https://github.com/apache/camel-k/pull/3427#discussion_r937513707


##########
config/crd/bases/camel.apache.org_camelcatalogs.yaml:
##########
@@ -21,9 +21,6 @@ metadata:
   annotations:
     controller-gen.kubebuilder.io/version: v0.6.1
   creationTimestamp: null
-  labels:
-    app: camel-k
-  name: camelcatalogs.camel.apache.org

Review Comment:
   That should be reverted.



##########
helm/camel-k/crds/crd-integration-platform.yaml:
##########
@@ -21,9 +21,7 @@ metadata:
   annotations:
     controller-gen.kubebuilder.io/version: v0.6.1
   creationTimestamp: null
-  labels:
-    app: camel-k
-  name: integrationplatforms.camel.apache.org
+    labels:n    app: camel-k  name: integrationplatforms.camel.apache.org

Review Comment:
   That should be reverted.



##########
pkg/controller/build/build_controller.go:
##########
@@ -163,6 +163,14 @@ func (r *reconcileBuild) Reconcile(ctx context.Context, request reconcile.Reques
 			newErrorRecoveryAction(),
 			newErrorAction(),
 		}
+	case v1.BuildStrategyMvnd:
+		actions = []Action{
+			newInitializeRoutineAction(),
+			newScheduleAction(r.reader),
+			newMonitorRoutineAction(),
+			newErrorRecoveryAction(),
+			newErrorAction(),
+		}

Review Comment:
   That can be collapsed with the `v1.BuildStrategyRoutine` case above.



##########
config/crd/bases/camel.apache.org_integrationplatforms.yaml:
##########
@@ -21,9 +21,6 @@ metadata:
   annotations:
     controller-gen.kubebuilder.io/version: v0.6.1
   creationTimestamp: null
-  labels:
-    app: camel-k
-  name: integrationplatforms.camel.apache.org

Review Comment:
   That should be reverted.



##########
config/crd/bases/camel.apache.org_builds.yaml:
##########
@@ -21,9 +21,6 @@ metadata:
   annotations:
     controller-gen.kubebuilder.io/version: v0.6.1
   creationTimestamp: null
-  labels:
-    app: camel-k
-  name: builds.camel.apache.org

Review Comment:
   That should be reverted.



##########
helm/camel-k/crds/crd-build.yaml:
##########
@@ -21,9 +21,7 @@ metadata:
   annotations:
     controller-gen.kubebuilder.io/version: v0.6.1
   creationTimestamp: null
-  labels:
-    app: camel-k
-  name: builds.camel.apache.org
+    labels:n    app: camel-k  name: builds.camel.apache.org

Review Comment:
   That should be reverted.



##########
config/crd/bases/camel.apache.org_kamelets.yaml:
##########
@@ -21,9 +21,6 @@ metadata:
   annotations:
     controller-gen.kubebuilder.io/version: v0.6.1
   creationTimestamp: null
-  labels:
-    app: camel-k
-  name: kamelets.camel.apache.org

Review Comment:
   That should be reverted.



##########
config/crd/bases/camel.apache.org_integrationkits.yaml:
##########
@@ -21,9 +21,6 @@ metadata:
   annotations:
     controller-gen.kubebuilder.io/version: v0.6.1
   creationTimestamp: null
-  labels:
-    app: camel-k
-  name: integrationkits.camel.apache.org

Review Comment:
   That should be reverted.



##########
config/crd/bases/camel.apache.org_integrations.yaml:
##########
@@ -21,9 +21,6 @@ metadata:
   annotations:
     controller-gen.kubebuilder.io/version: v0.6.1
   creationTimestamp: null
-  labels:
-    app: camel-k
-  name: integrations.camel.apache.org

Review Comment:
   That should be reverted.



##########
helm/camel-k/crds/crd-integration.yaml:
##########
@@ -21,9 +21,7 @@ metadata:
   annotations:
     controller-gen.kubebuilder.io/version: v0.6.1
   creationTimestamp: null
-  labels:
-    app: camel-k
-  name: integrations.camel.apache.org
+    labels:n    app: camel-k  name: integrations.camel.apache.org

Review Comment:
   That should be reverted.



##########
config/crd/bases/camel.apache.org_kameletbindings.yaml:
##########
@@ -21,9 +21,6 @@ metadata:
   annotations:
     controller-gen.kubebuilder.io/version: v0.6.1
   creationTimestamp: null
-  labels:
-    app: camel-k
-  name: kameletbindings.camel.apache.org

Review Comment:
   That should be reverted.



##########
helm/camel-k/crds/crd-camel-catalog.yaml:
##########
@@ -21,9 +21,7 @@ metadata:
   annotations:
     controller-gen.kubebuilder.io/version: v0.6.1
   creationTimestamp: null
-  labels:
-    app: camel-k
-  name: camelcatalogs.camel.apache.org
+    labels:n    app: camel-k  name: camelcatalogs.camel.apache.org

Review Comment:
   That should be reverted.



##########
helm/camel-k/crds/crd-kamelet-binding.yaml:
##########
@@ -21,9 +21,7 @@ metadata:
   annotations:
     controller-gen.kubebuilder.io/version: v0.6.1
   creationTimestamp: null
-  labels:
-    app: camel-k
-  name: kameletbindings.camel.apache.org
+    labels:n    app: camel-k  name: kameletbindings.camel.apache.org

Review Comment:
   That should be reverted.



##########
helm/camel-k/crds/crd-integration-kit.yaml:
##########
@@ -21,9 +21,7 @@ metadata:
   annotations:
     controller-gen.kubebuilder.io/version: v0.6.1
   creationTimestamp: null
-  labels:
-    app: camel-k
-  name: integrationkits.camel.apache.org
+    labels:n    app: camel-k  name: integrationkits.camel.apache.org

Review Comment:
   That should be reverted.



##########
pkg/controller/build/build_controller.go:
##########
@@ -218,6 +226,14 @@ func (r *reconcileBuild) Reconcile(ctx context.Context, request reconcile.Reques
 	return reconcile.Result{}, nil
 }
 
+func newMonitorMvndAction() {
+	panic("unimplemented")
+}
+
+func newInitializeMvndAction() {
+	panic("unimplemented")
+}
+

Review Comment:
   This can be removed.



##########
helm/camel-k/crds/crd-kamelet.yaml:
##########
@@ -21,9 +21,7 @@ metadata:
   annotations:
     controller-gen.kubebuilder.io/version: v0.6.1
   creationTimestamp: null
-  labels:
-    app: camel-k
-  name: kamelets.camel.apache.org
+    labels:n    app: camel-k  name: kamelets.camel.apache.org

Review Comment:
   That should be reverted.



-- 
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


[GitHub] [camel-k] github-actions[bot] commented on pull request #3427: Add mvnd build strategy

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #3427:
URL: https://github.com/apache/camel-k/pull/3427#issuecomment-1396272263

   This PR has been automatically marked as stale due to 90 days of inactivity. 
   It will be closed if no further activity occurs within 15 days.
   If you think that’s incorrect or the issue should never stale, please simply write any comment.
   Thanks for your contributions!


-- 
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


[GitHub] [camel-k] SubhasmitaSw closed pull request #3427: Add mvnd build strategy

Posted by GitBox <gi...@apache.org>.
SubhasmitaSw closed pull request #3427: Add mvnd build strategy 
URL: https://github.com/apache/camel-k/pull/3427


-- 
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


[GitHub] [camel-k] SubhasmitaSw commented on pull request #3427: Add mvnd build strategy

Posted by GitBox <gi...@apache.org>.
SubhasmitaSw commented on PR #3427:
URL: https://github.com/apache/camel-k/pull/3427#issuecomment-1284957330

   Yes @claudio4j I'll whack this up in the weekends, sorry for the delay.


-- 
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


[GitHub] [camel-k] SubhasmitaSw commented on pull request #3427: Add mvnd build strategy

Posted by GitBox <gi...@apache.org>.
SubhasmitaSw commented on PR #3427:
URL: https://github.com/apache/camel-k/pull/3427#issuecomment-1180548476

   ```
   RUN temp=$(mktemp -d) \
   && curl -Lso "$temp"/mvnd.zip https://github.com/mvndaemon/mvnd/releases/download/0.8.0/mvnd-0.8.0-linux-amd64.zip \
   && unzip -d "$temp" "$temp"/mvnd.zip \
   && rm -v "$temp"/mvnd.zip \
   && mv "$temp"/mvnd /usr/bin/mvnd \
   && rm -rf "$temp"
   ```
   
   This is the current way we are trying to have both the maven and mvnd versions in the operator image by replacing the embedded maven version in mvnd, which is not quite accurate. Do we have any other ways where we can achieve this? @gnodet @ppalaga your suggestions could come handy. Thanks! 


-- 
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


[GitHub] [camel-k] astefanutti commented on a diff in pull request #3427: Add mvnd build strategy

Posted by GitBox <gi...@apache.org>.
astefanutti commented on code in PR #3427:
URL: https://github.com/apache/camel-k/pull/3427#discussion_r953004542


##########
e2e/global/builder/build_test.go:
##########
@@ -72,6 +72,28 @@ func TestKitTimerToLogFullNativeBuild(t *testing.T) {
 	})
 }
 
+<<<<<<< HEAD

Review Comment:
   There are conflicts that have to be resolved.



-- 
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


[GitHub] [camel-k] astefanutti commented on a diff in pull request #3427: Add mvnd build strategy

Posted by GitBox <gi...@apache.org>.
astefanutti commented on code in PR #3427:
URL: https://github.com/apache/camel-k/pull/3427#discussion_r917967781


##########
pkg/util/maven/maven_command.go:
##########
@@ -47,8 +48,14 @@ func (c *Command) Do(ctx context.Context) error {
 	if err := generateProjectStructure(c.context, c.project); err != nil {
 		return err
 	}
-
-	mvnCmd := "mvnd"
+    
+	mvnCmd := ""
+	switch c.context.Strategy {
+	case "maven":

Review Comment:
   I'd suggest to change it to the `default` case that sets it to `mvn`.



##########
pkg/apis/camel/v1/common_types.go:
##########
@@ -48,17 +48,14 @@ const (
 	// BuildStrategyPod performs the build in a `Pod` (will schedule a new builder ephemeral `Pod` which will take care of the build action).
 	// This strategy has the limitation that every build will have to download all the dependencies required by the Maven build.
 	BuildStrategyPod BuildStrategy = "pod"
-	// BuildStrategyType is the type of strategy that should be used to perform the build.
- 	// It will trigger a Maven daemon process that will take care of producing the expected Camel/Camel-Quarkus runtime. 
- 	// The Maven daemon will be run in a container. 
- 	// +kubebuilder:validation:Enum=routine;pod
- 	BuildStrategType BuildStrategy = "mvnd"
+ 	BuildStrategyMvnd BuildStrategy = "mvnd"

Review Comment:
   I didn't meant to remove the whole block :) It was specifically about removing ` +kubebuilder:validation:Enum=routine;pod`



##########
build/Dockerfile:
##########
@@ -22,10 +22,18 @@ ARG BASE_URL="https://archive.apache.org/dist/maven/maven-3/${MAVEN_VERSION}/bin
 
 USER 0
 
+RUN mkdir -p ${MAVEN_HOME} \
+    && curl -Lso /tmp/maven.tar.gz ${BASE_URL}/apache-maven-${MAVEN_VERSION}-bin.tar.gz \

Review Comment:
   We should look to using that version with Mvnd as well, that is removing the embedded one from the Maven Daemon.



##########
pkg/util/maven/maven_command.go:
##########
@@ -47,8 +48,14 @@ func (c *Command) Do(ctx context.Context) error {
 	if err := generateProjectStructure(c.context, c.project); err != nil {
 		return err
 	}
-
-	mvnCmd := "mvnd"
+    
+	mvnCmd := ""
+	switch c.context.Strategy {
+	case "maven":
+		mvnCmd = "mvn"
+	case "maven_daemon":

Review Comment:
   should be `mvnd`



-- 
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


[GitHub] [camel-k] ppalaga commented on pull request #3427: Add mvnd build strategy

Posted by GitBox <gi...@apache.org>.
ppalaga commented on PR #3427:
URL: https://github.com/apache/camel-k/pull/3427#issuecomment-1180640393

   Not 100% sure what is your aim, @SubhasmitaSw 
   To install mvnd, you need not only the `mvnd` binary. You also need the `mvn` directory from the distribution zip and the `mvnd` binary must be informed where to find that mvn directory via `~/.m2/mvnd.properties` or via env. var `MVND_HOME`.


-- 
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


[GitHub] [camel-k] github-actions[bot] closed pull request #3427: Add mvnd build strategy

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #3427: Add mvnd build strategy 
URL: https://github.com/apache/camel-k/pull/3427


-- 
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