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 2020/04/07 17:37:21 UTC
[GitHub] [camel-quarkus] aldettinger opened a new pull request #1052: Moved the guide to promote a JVM Only extension to native to a dedica…
aldettinger opened a new pull request #1052: Moved the guide to promote a JVM Only extension to native to a dedica…
URL: https://github.com/apache/camel-quarkus/pull/1052
…ted page #1021
[ ] An issue should be filed for the change unless this is a trivial change (fixing a typo or similar). One issue should ideally be fixed by not more than one commit and the other way round, each commit should fix just one issue, without pulling in other changes.
[ ] Each commit in the pull request should have a meaningful and properly spelled subject line and body. Copying the title of the associated issue is typically enough. Please include the issue number in the commit message prefixed by #.
[ ] The pull request description should explain what the pull request does, how, and why. If the info is available in the associated issue or some other external document, a link is enough.
[ ] Phrases like Fix #<issueNumber> or Fixes #<issueNumber> will auto-close the named issue upon merging the pull request. Using them is typically a good idea.
[ ] Please run mvn process-resources -Pformat (and amend the changes if necessary) before sending the pull request.
[ ] Contributor guide is your good friend: https://camel.apache.org/camel-quarkus/latest/contributor-guide.html
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [camel-quarkus] aldettinger commented on a change in pull request #1052: Moved the guide to promote a JVM Only extension to native to a dedica…
Posted by GitBox <gi...@apache.org>.
aldettinger commented on a change in pull request #1052: Moved the guide to promote a JVM Only extension to native to a dedica…
URL: https://github.com/apache/camel-quarkus/pull/1052#discussion_r405321467
##########
File path: docs/modules/ROOT/pages/promote-jvm-only-extensions.adoc
##########
@@ -0,0 +1,123 @@
+[[promote-jvm-only-extensions]]
+= Promote JVM Only extensions Native
+
+The directory `extensions-jvm` contains some extensions that need to be tested in link:https://quarkus.io/guides/building-native-image[native mode]. Configuring the link:https://quarkus.io/guides/writing-native-applications-tips[native build] and implementing integration tests of such extensions may open the door to even faster startup and lower footprint.
+Please find some guiding steps below to start this quest:
+
+1. Make sure that nobody else works on promoting the same extension by searching through the
+ https://github.com/apache/camel-quarkus/issues[GitHub issues].
+
+2. Let others know that you work on promoting the given extension by either creating a
+ https://github.com/apache/camel-quarkus/issues/new[new issue] or asking to assign an existing one to you.
+
+3. Select the JVM Only extension to be promoted, for instance the grpc extension like below:
++
+[source,shell]
+----
+$ cd camel-quarkus
+$ export EXT='grpc'
+----
+
+4. Split the JVM Only extension into `extensions` and `integration-tests` folders, from a shell execute:
++
+[source,shell]
+----
+$ {
+ sed -i '/integration-test/d' "extensions-jvm/${EXT}/pom.xml"
+ sed -i "/<module>${EXT}<\/module>/d" "extensions-jvm/pom.xml"
+ git mv "extensions-jvm/${EXT}/integration-test/" "integration-tests/${EXT}"
+ git mv "extensions-jvm/${EXT}" "extensions/${EXT}"
+ sed -i -r "s/(.*)activemq(.*)/\1activemq\2\n\1${EXT}\2/g" extensions/pom.xml
+ sed -i -r "s/(.*)activemq(.*)/\1activemq\2\n\1${EXT}\2/g" integration-tests/pom.xml
+ sed -i "s/camel-quarkus-grpc-parent/camel-quarkus-integration-tests/g" "integration-tests/${EXT}/pom.xml"
+ sed -i "s/camel-quarkus-grpc-integration-test/camel-quarkus-integration-test-${EXT}/g" "integration-tests/${EXT}/pom.xml"
+ sed -i -r "s/Quarkus :: (.*) :: Integration Test/Quarkus :: Integration Test :: \1/g" "integration-tests/${EXT}/pom.xml"
+ }
+----
+
+5. Add the native profile at the end of `integration-tests/${EXT}/pom.xml`:
++
+[source,xml]
+----
+ <profiles>
+ <profile>
+ <id>native</id>
+ <activation>
+ <property>
+ <name>native</name>
+ </property>
+ </activation>
+ <properties>
+ <quarkus.package.type>native</quarkus.package.type>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>integration-test</goal>
+ <goal>verify</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+----
+
+6. Remove the warning link:https://quarkus.io/guides/writing-extensions#build-step-processors[build step] from `extensions/${EXT}/deployment/src/main/java/org/apache/camel/quarkus/component/${EXT}/deployment/${EXT}Processor.java`:
++
+[source,java]
+----
+ /**
+ * Remove this once this extension starts supporting the native mode.
+ */
+ @BuildStep(onlyIf = NativeBuild.class)
+ @Record(value = ExecutionTime.RUNTIME_INIT)
+ void warnJvmInNative(JvmOnlyRecorder recorder) {
+ JvmOnlyRecorder.warnJvmInNative(LOG, FEATURE); // warn at build time
+ recorder.warnJvmInNative(FEATURE); // warn at runtime
+ }
+----
+
+7. Create a native test at `integration-tests/${EXT}/src/test/java/org/apache/camel/quarkus/component/${EXT}/it/${EXT}IT.java`
+
+8. Check `extensions/${EXT}/runtime/src/main/resources/META-INF/quarkus-extension.yaml`:
+* Ensure guide is set to `"https://quarkus.io/guides/camel"`
+* Ensure keyword `camel` is present
+* Remove the `preview` status
Review comment:
Opened follow up issue #1058.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [camel-quarkus] aldettinger commented on a change in pull request #1052: Moved the guide to promote a JVM Only extension to native to a dedica…
Posted by GitBox <gi...@apache.org>.
aldettinger commented on a change in pull request #1052: Moved the guide to promote a JVM Only extension to native to a dedica…
URL: https://github.com/apache/camel-quarkus/pull/1052#discussion_r404993454
##########
File path: docs/modules/ROOT/pages/promote-jvm-only-extensions.adoc
##########
@@ -0,0 +1,123 @@
+[[promote-jvm-only-extensions]]
+= Promote JVM Only extensions Native
+
+The directory `extensions-jvm` contains some extensions that need to be tested in link:https://quarkus.io/guides/building-native-image[native mode]. Configuring the link:https://quarkus.io/guides/writing-native-applications-tips[native build] and implementing integration tests of such extensions may open the door to even faster startup and lower footprint.
+Please find some guiding steps below to start this quest:
+
+1. Make sure that nobody else works on promoting the same extension by searching through the
+ https://github.com/apache/camel-quarkus/issues[GitHub issues].
+
+2. Let others know that you work on promoting the given extension by either creating a
+ https://github.com/apache/camel-quarkus/issues/new[new issue] or asking to assign an existing one to you.
+
+3. Select the JVM Only extension to be promoted, for instance the grpc extension like below:
++
+[source,shell]
+----
+$ cd camel-quarkus
+$ export EXT='grpc'
+----
+
+4. Split the JVM Only extension into `extensions` and `integration-tests` folders, from a shell execute:
++
+[source,shell]
+----
+$ {
+ sed -i '/integration-test/d' "extensions-jvm/${EXT}/pom.xml"
+ sed -i "/<module>${EXT}<\/module>/d" "extensions-jvm/pom.xml"
+ git mv "extensions-jvm/${EXT}/integration-test/" "integration-tests/${EXT}"
+ git mv "extensions-jvm/${EXT}" "extensions/${EXT}"
+ sed -i -r "s/(.*)activemq(.*)/\1activemq\2\n\1${EXT}\2/g" extensions/pom.xml
+ sed -i -r "s/(.*)activemq(.*)/\1activemq\2\n\1${EXT}\2/g" integration-tests/pom.xml
+ sed -i "s/camel-quarkus-grpc-parent/camel-quarkus-integration-tests/g" "integration-tests/${EXT}/pom.xml"
+ sed -i "s/camel-quarkus-grpc-integration-test/camel-quarkus-integration-test-${EXT}/g" "integration-tests/${EXT}/pom.xml"
+ sed -i -r "s/Quarkus :: (.*) :: Integration Test/Quarkus :: Integration Test :: \1/g" "integration-tests/${EXT}/pom.xml"
+ }
+----
+
+5. Add the native profile at the end of `integration-tests/${EXT}/pom.xml`:
++
+[source,xml]
+----
+ <profiles>
+ <profile>
+ <id>native</id>
+ <activation>
+ <property>
+ <name>native</name>
+ </property>
+ </activation>
+ <properties>
+ <quarkus.package.type>native</quarkus.package.type>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>integration-test</goal>
+ <goal>verify</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+----
+
+6. Remove the warning link:https://quarkus.io/guides/writing-extensions#build-step-processors[build step] from `extensions/${EXT}/deployment/src/main/java/org/apache/camel/quarkus/component/${EXT}/deployment/${EXT}Processor.java`:
++
+[source,java]
+----
+ /**
+ * Remove this once this extension starts supporting the native mode.
+ */
+ @BuildStep(onlyIf = NativeBuild.class)
+ @Record(value = ExecutionTime.RUNTIME_INIT)
+ void warnJvmInNative(JvmOnlyRecorder recorder) {
+ JvmOnlyRecorder.warnJvmInNative(LOG, FEATURE); // warn at build time
+ recorder.warnJvmInNative(FEATURE); // warn at runtime
+ }
+----
+
+7. Create a native test at `integration-tests/${EXT}/src/test/java/org/apache/camel/quarkus/component/${EXT}/it/${EXT}IT.java`
+
Review comment:
@ppalaga Would the step 8 not be executed, we end up with a build issue:
[ERROR] Failed to execute goal org.codehaus.gmaven:groovy-maven-plugin:2.1.1:execute (validate-extension-metadata) on project camel-quarkus: Execution validate-extension-metadata of goal org.codehaus.gmaven:groovy-maven-plugin:2.1.1:execute failed:
[ERROR] Quarkus extension metadata validation failures:
[ERROR]
[ERROR] extensions/grpc/runtime/src/main/resources/META-INF/quarkus-extension.yaml must contain a link to the guide https://quarkus.io/guides/camel
[ERROR] extensions/grpc/runtime/src/main/resources/META-INF/quarkus-extension.yaml metadata must contain a list of keywords with at least "camel" present
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
Is it a non expected build issue that would need to be fixed ?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [camel-quarkus] aldettinger commented on a change in pull request #1052: Moved the guide to promote a JVM Only extension to native to a dedica…
Posted by GitBox <gi...@apache.org>.
aldettinger commented on a change in pull request #1052: Moved the guide to promote a JVM Only extension to native to a dedica…
URL: https://github.com/apache/camel-quarkus/pull/1052#discussion_r404993454
##########
File path: docs/modules/ROOT/pages/promote-jvm-only-extensions.adoc
##########
@@ -0,0 +1,123 @@
+[[promote-jvm-only-extensions]]
+= Promote JVM Only extensions Native
+
+The directory `extensions-jvm` contains some extensions that need to be tested in link:https://quarkus.io/guides/building-native-image[native mode]. Configuring the link:https://quarkus.io/guides/writing-native-applications-tips[native build] and implementing integration tests of such extensions may open the door to even faster startup and lower footprint.
+Please find some guiding steps below to start this quest:
+
+1. Make sure that nobody else works on promoting the same extension by searching through the
+ https://github.com/apache/camel-quarkus/issues[GitHub issues].
+
+2. Let others know that you work on promoting the given extension by either creating a
+ https://github.com/apache/camel-quarkus/issues/new[new issue] or asking to assign an existing one to you.
+
+3. Select the JVM Only extension to be promoted, for instance the grpc extension like below:
++
+[source,shell]
+----
+$ cd camel-quarkus
+$ export EXT='grpc'
+----
+
+4. Split the JVM Only extension into `extensions` and `integration-tests` folders, from a shell execute:
++
+[source,shell]
+----
+$ {
+ sed -i '/integration-test/d' "extensions-jvm/${EXT}/pom.xml"
+ sed -i "/<module>${EXT}<\/module>/d" "extensions-jvm/pom.xml"
+ git mv "extensions-jvm/${EXT}/integration-test/" "integration-tests/${EXT}"
+ git mv "extensions-jvm/${EXT}" "extensions/${EXT}"
+ sed -i -r "s/(.*)activemq(.*)/\1activemq\2\n\1${EXT}\2/g" extensions/pom.xml
+ sed -i -r "s/(.*)activemq(.*)/\1activemq\2\n\1${EXT}\2/g" integration-tests/pom.xml
+ sed -i "s/camel-quarkus-grpc-parent/camel-quarkus-integration-tests/g" "integration-tests/${EXT}/pom.xml"
+ sed -i "s/camel-quarkus-grpc-integration-test/camel-quarkus-integration-test-${EXT}/g" "integration-tests/${EXT}/pom.xml"
+ sed -i -r "s/Quarkus :: (.*) :: Integration Test/Quarkus :: Integration Test :: \1/g" "integration-tests/${EXT}/pom.xml"
+ }
+----
+
+5. Add the native profile at the end of `integration-tests/${EXT}/pom.xml`:
++
+[source,xml]
+----
+ <profiles>
+ <profile>
+ <id>native</id>
+ <activation>
+ <property>
+ <name>native</name>
+ </property>
+ </activation>
+ <properties>
+ <quarkus.package.type>native</quarkus.package.type>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>integration-test</goal>
+ <goal>verify</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+----
+
+6. Remove the warning link:https://quarkus.io/guides/writing-extensions#build-step-processors[build step] from `extensions/${EXT}/deployment/src/main/java/org/apache/camel/quarkus/component/${EXT}/deployment/${EXT}Processor.java`:
++
+[source,java]
+----
+ /**
+ * Remove this once this extension starts supporting the native mode.
+ */
+ @BuildStep(onlyIf = NativeBuild.class)
+ @Record(value = ExecutionTime.RUNTIME_INIT)
+ void warnJvmInNative(JvmOnlyRecorder recorder) {
+ JvmOnlyRecorder.warnJvmInNative(LOG, FEATURE); // warn at build time
+ recorder.warnJvmInNative(FEATURE); // warn at runtime
+ }
+----
+
+7. Create a native test at `integration-tests/${EXT}/src/test/java/org/apache/camel/quarkus/component/${EXT}/it/${EXT}IT.java`
+
Review comment:
@ppalaga Would the step 8 not be executed, we end up with a build issue:
[ERROR] Failed to execute goal org.codehaus.gmaven:groovy-maven-plugin:2.1.1:execute (validate-extension-metadata) on project camel-quarkus: Execution validate-extension-metadata of goal org.codehaus.gmaven:groovy-maven-plugin:2.1.1:execute failed:
[ERROR] Quarkus extension metadata validation failures:
[ERROR]
[ERROR] extensions/grpc/runtime/src/main/resources/META-INF/quarkus-extension.yaml must contain a link to the guide https://quarkus.io/guides/camel
[ERROR] extensions/grpc/runtime/src/main/resources/META-INF/quarkus-extension.yaml metadata must contain a list of keywords with at least "camel" present
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
Is it a non expected build issue that would need to be fixed ?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [camel-quarkus] aldettinger commented on a change in pull request #1052: Moved the guide to promote a JVM Only extension to native to a dedica…
Posted by GitBox <gi...@apache.org>.
aldettinger commented on a change in pull request #1052: Moved the guide to promote a JVM Only extension to native to a dedica…
URL: https://github.com/apache/camel-quarkus/pull/1052#discussion_r404993454
##########
File path: docs/modules/ROOT/pages/promote-jvm-only-extensions.adoc
##########
@@ -0,0 +1,123 @@
+[[promote-jvm-only-extensions]]
+= Promote JVM Only extensions Native
+
+The directory `extensions-jvm` contains some extensions that need to be tested in link:https://quarkus.io/guides/building-native-image[native mode]. Configuring the link:https://quarkus.io/guides/writing-native-applications-tips[native build] and implementing integration tests of such extensions may open the door to even faster startup and lower footprint.
+Please find some guiding steps below to start this quest:
+
+1. Make sure that nobody else works on promoting the same extension by searching through the
+ https://github.com/apache/camel-quarkus/issues[GitHub issues].
+
+2. Let others know that you work on promoting the given extension by either creating a
+ https://github.com/apache/camel-quarkus/issues/new[new issue] or asking to assign an existing one to you.
+
+3. Select the JVM Only extension to be promoted, for instance the grpc extension like below:
++
+[source,shell]
+----
+$ cd camel-quarkus
+$ export EXT='grpc'
+----
+
+4. Split the JVM Only extension into `extensions` and `integration-tests` folders, from a shell execute:
++
+[source,shell]
+----
+$ {
+ sed -i '/integration-test/d' "extensions-jvm/${EXT}/pom.xml"
+ sed -i "/<module>${EXT}<\/module>/d" "extensions-jvm/pom.xml"
+ git mv "extensions-jvm/${EXT}/integration-test/" "integration-tests/${EXT}"
+ git mv "extensions-jvm/${EXT}" "extensions/${EXT}"
+ sed -i -r "s/(.*)activemq(.*)/\1activemq\2\n\1${EXT}\2/g" extensions/pom.xml
+ sed -i -r "s/(.*)activemq(.*)/\1activemq\2\n\1${EXT}\2/g" integration-tests/pom.xml
+ sed -i "s/camel-quarkus-grpc-parent/camel-quarkus-integration-tests/g" "integration-tests/${EXT}/pom.xml"
+ sed -i "s/camel-quarkus-grpc-integration-test/camel-quarkus-integration-test-${EXT}/g" "integration-tests/${EXT}/pom.xml"
+ sed -i -r "s/Quarkus :: (.*) :: Integration Test/Quarkus :: Integration Test :: \1/g" "integration-tests/${EXT}/pom.xml"
+ }
+----
+
+5. Add the native profile at the end of `integration-tests/${EXT}/pom.xml`:
++
+[source,xml]
+----
+ <profiles>
+ <profile>
+ <id>native</id>
+ <activation>
+ <property>
+ <name>native</name>
+ </property>
+ </activation>
+ <properties>
+ <quarkus.package.type>native</quarkus.package.type>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>integration-test</goal>
+ <goal>verify</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+----
+
+6. Remove the warning link:https://quarkus.io/guides/writing-extensions#build-step-processors[build step] from `extensions/${EXT}/deployment/src/main/java/org/apache/camel/quarkus/component/${EXT}/deployment/${EXT}Processor.java`:
++
+[source,java]
+----
+ /**
+ * Remove this once this extension starts supporting the native mode.
+ */
+ @BuildStep(onlyIf = NativeBuild.class)
+ @Record(value = ExecutionTime.RUNTIME_INIT)
+ void warnJvmInNative(JvmOnlyRecorder recorder) {
+ JvmOnlyRecorder.warnJvmInNative(LOG, FEATURE); // warn at build time
+ recorder.warnJvmInNative(FEATURE); // warn at runtime
+ }
+----
+
+7. Create a native test at `integration-tests/${EXT}/src/test/java/org/apache/camel/quarkus/component/${EXT}/it/${EXT}IT.java`
+
Review comment:
@ppalaga Would the step below not be executed, we end up with a build issue:
The step "8" is needed otherwise we have:
[ERROR] Failed to execute goal org.codehaus.gmaven:groovy-maven-plugin:2.1.1:execute (validate-extension-metadata) on project camel-quarkus: Execution validate-extension-metadata of goal org.codehaus.gmaven:groovy-maven-plugin:2.1.1:execute failed:
[ERROR] Quarkus extension metadata validation failures:
[ERROR]
[ERROR] extensions/grpc/runtime/src/main/resources/META-INF/quarkus-extension.yaml must contain a link to the guide https://quarkus.io/guides/camel
[ERROR] extensions/grpc/runtime/src/main/resources/META-INF/quarkus-extension.yaml metadata must contain a list of keywords with at least "camel" present
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
Is it a non expected build issue that would need to be fixed ?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [camel-quarkus] aldettinger merged pull request #1052: Moved the guide to promote a JVM Only extension to native to a dedica…
Posted by GitBox <gi...@apache.org>.
aldettinger merged pull request #1052: Moved the guide to promote a JVM Only extension to native to a dedica…
URL: https://github.com/apache/camel-quarkus/pull/1052
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [camel-quarkus] aldettinger commented on a change in pull request #1052: Moved the guide to promote a JVM Only extension to native to a dedica…
Posted by GitBox <gi...@apache.org>.
aldettinger commented on a change in pull request #1052: Moved the guide to promote a JVM Only extension to native to a dedica…
URL: https://github.com/apache/camel-quarkus/pull/1052#discussion_r404994382
##########
File path: docs/modules/ROOT/pages/promote-jvm-only-extensions.adoc
##########
@@ -0,0 +1,123 @@
+[[promote-jvm-only-extensions]]
+= Promote JVM Only extensions Native
+
+The directory `extensions-jvm` contains some extensions that need to be tested in link:https://quarkus.io/guides/building-native-image[native mode]. Configuring the link:https://quarkus.io/guides/writing-native-applications-tips[native build] and implementing integration tests of such extensions may open the door to even faster startup and lower footprint.
+Please find some guiding steps below to start this quest:
+
+1. Make sure that nobody else works on promoting the same extension by searching through the
+ https://github.com/apache/camel-quarkus/issues[GitHub issues].
+
+2. Let others know that you work on promoting the given extension by either creating a
+ https://github.com/apache/camel-quarkus/issues/new[new issue] or asking to assign an existing one to you.
+
+3. Select the JVM Only extension to be promoted, for instance the grpc extension like below:
++
+[source,shell]
+----
+$ cd camel-quarkus
+$ export EXT='grpc'
+----
+
+4. Split the JVM Only extension into `extensions` and `integration-tests` folders, from a shell execute:
++
+[source,shell]
+----
+$ {
+ sed -i '/integration-test/d' "extensions-jvm/${EXT}/pom.xml"
+ sed -i "/<module>${EXT}<\/module>/d" "extensions-jvm/pom.xml"
+ git mv "extensions-jvm/${EXT}/integration-test/" "integration-tests/${EXT}"
+ git mv "extensions-jvm/${EXT}" "extensions/${EXT}"
+ sed -i -r "s/(.*)activemq(.*)/\1activemq\2\n\1${EXT}\2/g" extensions/pom.xml
+ sed -i -r "s/(.*)activemq(.*)/\1activemq\2\n\1${EXT}\2/g" integration-tests/pom.xml
+ sed -i "s/camel-quarkus-grpc-parent/camel-quarkus-integration-tests/g" "integration-tests/${EXT}/pom.xml"
+ sed -i "s/camel-quarkus-grpc-integration-test/camel-quarkus-integration-test-${EXT}/g" "integration-tests/${EXT}/pom.xml"
+ sed -i -r "s/Quarkus :: (.*) :: Integration Test/Quarkus :: Integration Test :: \1/g" "integration-tests/${EXT}/pom.xml"
+ }
+----
+
+5. Add the native profile at the end of `integration-tests/${EXT}/pom.xml`:
++
+[source,xml]
+----
+ <profiles>
+ <profile>
+ <id>native</id>
+ <activation>
+ <property>
+ <name>native</name>
+ </property>
+ </activation>
+ <properties>
+ <quarkus.package.type>native</quarkus.package.type>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>integration-test</goal>
+ <goal>verify</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+----
+
+6. Remove the warning link:https://quarkus.io/guides/writing-extensions#build-step-processors[build step] from `extensions/${EXT}/deployment/src/main/java/org/apache/camel/quarkus/component/${EXT}/deployment/${EXT}Processor.java`:
++
+[source,java]
+----
+ /**
+ * Remove this once this extension starts supporting the native mode.
+ */
+ @BuildStep(onlyIf = NativeBuild.class)
+ @Record(value = ExecutionTime.RUNTIME_INIT)
+ void warnJvmInNative(JvmOnlyRecorder recorder) {
+ JvmOnlyRecorder.warnJvmInNative(LOG, FEATURE); // warn at build time
+ recorder.warnJvmInNative(FEATURE); // warn at runtime
+ }
+----
+
+7. Create a native test at `integration-tests/${EXT}/src/test/java/org/apache/camel/quarkus/component/${EXT}/it/${EXT}IT.java`
+
+8. Check `extensions/${EXT}/runtime/src/main/resources/META-INF/quarkus-extension.yaml`:
+* Ensure guide is set to `"https://quarkus.io/guides/camel"`
+* Ensure keyword `camel` is present
+* Remove the `preview` status
Review comment:
@ppalaga Would the step below not be executed, we end up with a build issue:
The step "8" is needed otherwise we have:
[ERROR] Failed to execute goal org.codehaus.gmaven:groovy-maven-plugin:2.1.1:execute (validate-extension-metadata) on project camel-quarkus: Execution validate-extension-metadata of goal org.codehaus.gmaven:groovy-maven-plugin:2.1.1:execute failed:
[ERROR] Quarkus extension metadata validation failures:
[ERROR]
[ERROR] extensions/grpc/runtime/src/main/resources/META-INF/quarkus-extension.yaml must contain a link to the guide https://quarkus.io/guides/camel
[ERROR] extensions/grpc/runtime/src/main/resources/META-INF/quarkus-extension.yaml metadata must contain a list of keywords with at least "camel" present
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
Is it a non expected build issue that would need to be fixed ?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #1052: Moved the guide to promote a JVM Only extension to native to a dedica…
Posted by GitBox <gi...@apache.org>.
ppalaga commented on a change in pull request #1052: Moved the guide to promote a JVM Only extension to native to a dedica…
URL: https://github.com/apache/camel-quarkus/pull/1052#discussion_r405156687
##########
File path: docs/modules/ROOT/pages/promote-jvm-only-extensions.adoc
##########
@@ -0,0 +1,123 @@
+[[promote-jvm-only-extensions]]
+= Promote JVM Only extensions Native
+
+The directory `extensions-jvm` contains some extensions that need to be tested in link:https://quarkus.io/guides/building-native-image[native mode]. Configuring the link:https://quarkus.io/guides/writing-native-applications-tips[native build] and implementing integration tests of such extensions may open the door to even faster startup and lower footprint.
+Please find some guiding steps below to start this quest:
+
+1. Make sure that nobody else works on promoting the same extension by searching through the
+ https://github.com/apache/camel-quarkus/issues[GitHub issues].
+
+2. Let others know that you work on promoting the given extension by either creating a
+ https://github.com/apache/camel-quarkus/issues/new[new issue] or asking to assign an existing one to you.
+
+3. Select the JVM Only extension to be promoted, for instance the grpc extension like below:
++
+[source,shell]
+----
+$ cd camel-quarkus
+$ export EXT='grpc'
+----
+
+4. Split the JVM Only extension into `extensions` and `integration-tests` folders, from a shell execute:
++
+[source,shell]
+----
+$ {
+ sed -i '/integration-test/d' "extensions-jvm/${EXT}/pom.xml"
+ sed -i "/<module>${EXT}<\/module>/d" "extensions-jvm/pom.xml"
+ git mv "extensions-jvm/${EXT}/integration-test/" "integration-tests/${EXT}"
+ git mv "extensions-jvm/${EXT}" "extensions/${EXT}"
+ sed -i -r "s/(.*)activemq(.*)/\1activemq\2\n\1${EXT}\2/g" extensions/pom.xml
+ sed -i -r "s/(.*)activemq(.*)/\1activemq\2\n\1${EXT}\2/g" integration-tests/pom.xml
+ sed -i "s/camel-quarkus-grpc-parent/camel-quarkus-integration-tests/g" "integration-tests/${EXT}/pom.xml"
+ sed -i "s/camel-quarkus-grpc-integration-test/camel-quarkus-integration-test-${EXT}/g" "integration-tests/${EXT}/pom.xml"
+ sed -i -r "s/Quarkus :: (.*) :: Integration Test/Quarkus :: Integration Test :: \1/g" "integration-tests/${EXT}/pom.xml"
+ }
+----
+
+5. Add the native profile at the end of `integration-tests/${EXT}/pom.xml`:
++
+[source,xml]
+----
+ <profiles>
+ <profile>
+ <id>native</id>
+ <activation>
+ <property>
+ <name>native</name>
+ </property>
+ </activation>
+ <properties>
+ <quarkus.package.type>native</quarkus.package.type>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>integration-test</goal>
+ <goal>verify</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+----
+
+6. Remove the warning link:https://quarkus.io/guides/writing-extensions#build-step-processors[build step] from `extensions/${EXT}/deployment/src/main/java/org/apache/camel/quarkus/component/${EXT}/deployment/${EXT}Processor.java`:
++
+[source,java]
+----
+ /**
+ * Remove this once this extension starts supporting the native mode.
+ */
+ @BuildStep(onlyIf = NativeBuild.class)
+ @Record(value = ExecutionTime.RUNTIME_INIT)
+ void warnJvmInNative(JvmOnlyRecorder recorder) {
+ JvmOnlyRecorder.warnJvmInNative(LOG, FEATURE); // warn at build time
+ recorder.warnJvmInNative(FEATURE); // warn at runtime
+ }
+----
+
+7. Create a native test at `integration-tests/${EXT}/src/test/java/org/apache/camel/quarkus/component/${EXT}/it/${EXT}IT.java`
+
+8. Check `extensions/${EXT}/runtime/src/main/resources/META-INF/quarkus-extension.yaml`:
+* Ensure guide is set to `"https://quarkus.io/guides/camel"`
+* Ensure keyword `camel` is present
+* Remove the `preview` status
Review comment:
I was only proposing to remove the "Ensure keyword `camel` is present" line.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #1052: Moved the guide to promote a JVM Only extension to native to a dedica…
Posted by GitBox <gi...@apache.org>.
ppalaga commented on a change in pull request #1052: Moved the guide to promote a JVM Only extension to native to a dedica…
URL: https://github.com/apache/camel-quarkus/pull/1052#discussion_r405156687
##########
File path: docs/modules/ROOT/pages/promote-jvm-only-extensions.adoc
##########
@@ -0,0 +1,123 @@
+[[promote-jvm-only-extensions]]
+= Promote JVM Only extensions Native
+
+The directory `extensions-jvm` contains some extensions that need to be tested in link:https://quarkus.io/guides/building-native-image[native mode]. Configuring the link:https://quarkus.io/guides/writing-native-applications-tips[native build] and implementing integration tests of such extensions may open the door to even faster startup and lower footprint.
+Please find some guiding steps below to start this quest:
+
+1. Make sure that nobody else works on promoting the same extension by searching through the
+ https://github.com/apache/camel-quarkus/issues[GitHub issues].
+
+2. Let others know that you work on promoting the given extension by either creating a
+ https://github.com/apache/camel-quarkus/issues/new[new issue] or asking to assign an existing one to you.
+
+3. Select the JVM Only extension to be promoted, for instance the grpc extension like below:
++
+[source,shell]
+----
+$ cd camel-quarkus
+$ export EXT='grpc'
+----
+
+4. Split the JVM Only extension into `extensions` and `integration-tests` folders, from a shell execute:
++
+[source,shell]
+----
+$ {
+ sed -i '/integration-test/d' "extensions-jvm/${EXT}/pom.xml"
+ sed -i "/<module>${EXT}<\/module>/d" "extensions-jvm/pom.xml"
+ git mv "extensions-jvm/${EXT}/integration-test/" "integration-tests/${EXT}"
+ git mv "extensions-jvm/${EXT}" "extensions/${EXT}"
+ sed -i -r "s/(.*)activemq(.*)/\1activemq\2\n\1${EXT}\2/g" extensions/pom.xml
+ sed -i -r "s/(.*)activemq(.*)/\1activemq\2\n\1${EXT}\2/g" integration-tests/pom.xml
+ sed -i "s/camel-quarkus-grpc-parent/camel-quarkus-integration-tests/g" "integration-tests/${EXT}/pom.xml"
+ sed -i "s/camel-quarkus-grpc-integration-test/camel-quarkus-integration-test-${EXT}/g" "integration-tests/${EXT}/pom.xml"
+ sed -i -r "s/Quarkus :: (.*) :: Integration Test/Quarkus :: Integration Test :: \1/g" "integration-tests/${EXT}/pom.xml"
+ }
+----
+
+5. Add the native profile at the end of `integration-tests/${EXT}/pom.xml`:
++
+[source,xml]
+----
+ <profiles>
+ <profile>
+ <id>native</id>
+ <activation>
+ <property>
+ <name>native</name>
+ </property>
+ </activation>
+ <properties>
+ <quarkus.package.type>native</quarkus.package.type>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>integration-test</goal>
+ <goal>verify</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+----
+
+6. Remove the warning link:https://quarkus.io/guides/writing-extensions#build-step-processors[build step] from `extensions/${EXT}/deployment/src/main/java/org/apache/camel/quarkus/component/${EXT}/deployment/${EXT}Processor.java`:
++
+[source,java]
+----
+ /**
+ * Remove this once this extension starts supporting the native mode.
+ */
+ @BuildStep(onlyIf = NativeBuild.class)
+ @Record(value = ExecutionTime.RUNTIME_INIT)
+ void warnJvmInNative(JvmOnlyRecorder recorder) {
+ JvmOnlyRecorder.warnJvmInNative(LOG, FEATURE); // warn at build time
+ recorder.warnJvmInNative(FEATURE); // warn at runtime
+ }
+----
+
+7. Create a native test at `integration-tests/${EXT}/src/test/java/org/apache/camel/quarkus/component/${EXT}/it/${EXT}IT.java`
+
+8. Check `extensions/${EXT}/runtime/src/main/resources/META-INF/quarkus-extension.yaml`:
+* Ensure guide is set to `"https://quarkus.io/guides/camel"`
+* Ensure keyword `camel` is present
+* Remove the `preview` status
Review comment:
I was only proposing to remove the "Ensure keyword `camel` is present" line. If there is a groovy check for that it can be removed 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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services