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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]