Skip to content
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

Mark js-dsl as JVM only #4241

Closed
ppalaga opened this issue Nov 3, 2022 · 3 comments
Closed

Mark js-dsl as JVM only #4241

ppalaga opened this issue Nov 3, 2022 · 3 comments

Comments

@ppalaga
Copy link
Contributor

ppalaga commented Nov 3, 2022

We do not run js-dsl itest native mode on the CI, because it spends too much RAM.

When checking manually, I found that it fails in native mode.

Reproducible as of camel quarkus main cb740e2

# Make sure to have a local GraalVM installation:
export GRAALVM_HOME=/home/ppalaga/.sdkman/candidates/java/22.2.r17-grl

# Make sure js language is installed
$GRAALVM_HOME/bin/gu install js

cd camel-quarkus
git reset --hard cb740e2ae96cd7ded5728a9c7ce7e37585b6262f
mvnd clean install -Dquickly

cd integration-tests/js-dsl
mvn clean verify -Pnative

[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildRunner] /home/ppalaga/.sdkman/candidates/java/22.2.r17-grl/bin/native-image -J-Djava.util.logging.manager=org.jboss.logmanager.LogManager -J-Dsun.nio.ch.maxUpdateArraySize=100 -J-Dlogging.initial-configurator.min-level=500 -J-Dvertx.logger-delegate-factory-class-name=io.quarkus.vertx.core.runtime.VertxLogDelegateFactory -J-Dvertx.disableDnsResolver=true -J-Dio.netty.leakDetection.level=DISABLED -J-Dio.netty.allocator.maxOrder=3 -J-Duser.language=en -J-Duser.country=IE -J-Dfile.encoding=UTF-8 --features=io.quarkus.runner.Feature,io.quarkus.runtime.graal.ResourcesFeature,io.quarkus.runtime.graal.DisableLoggingFeature -J--add-exports=java.security.jgss/sun.security.krb5=ALL-UNNAMED -J--add-opens=java.base/java.text=ALL-UNNAMED -J--add-opens=java.base/java.io=ALL-UNNAMED -J--add-opens=java.base/java.lang.invoke=ALL-UNNAMED -J--add-opens=java.base/java.util=ALL-UNNAMED -H:-BuildOutputColorful -H:+AllowFoldMethods -J-Djava.awt.headless=true --no-fallback --link-at-build-time -H:+ReportExceptionStackTraces -H:-AddAllCharsets --enable-url-protocols=http -H:NativeLinkerOption=-no-pie -H:-UseServiceLoaderFeature -H:+StackTrace -J--add-exports=org.graalvm.sdk/org.graalvm.nativeimage.impl=ALL-UNNAMED -J--add-exports=org.graalvm.nativeimage.builder/com.oracle.svm.core.jdk=ALL-UNNAMED -J--add-exports=org.graalvm.nativeimage.builder/com.oracle.svm.core.configure=ALL-UNNAMED -J--add-exports=org.graalvm.nativeimage.builder/com.oracle.svm.core.jdk.localization=ALL-UNNAMED camel-quarkus-integration-test-js-dsl-2.14.0-SNAPSHOT-runner -jar camel-quarkus-integration-test-js-dsl-2.14.0-SNAPSHOT-runner.jar
[WARN] [stderr] WARNING: Unknown module: org.graalvm.nativeimage.llvm specified to --add-exports
[WARN] [stderr] WARNING: Unknown module: org.graalvm.nativeimage.llvm specified to --add-exports
[WARN] [stderr] WARNING: Unknown module: org.graalvm.nativeimage.llvm specified to --add-exports
[INFO] [stdout] ========================================================================================================================
[INFO] [stdout] GraalVM Native Image: Generating 'camel-quarkus-integration-test-js-dsl-2.14.0-SNAPSHOT-runner' (executable)...
[INFO] [stdout] ========================================================================================================================
[INFO] [stdout] [1/7] Initializing...                                                                                   (12.7s @ 0.23GB)
[INFO] [stdout]  Version info: 'GraalVM 22.2.0 Java 17 CE'
[INFO] [stdout]  Java version info: '17.0.4+8-jvmci-22.2-b06'
[INFO] [stdout]  C compiler: gcc (redhat, x86_64, 11.3.1)
[INFO] [stdout]  Garbage collector: Serial GC
[INFO] [stdout]  3 user-specific feature(s)
[INFO] [stdout]  - io.quarkus.runner.Feature: Auto-generated class by Quarkus from the existing extensions
[INFO] [stdout]  - io.quarkus.runtime.graal.DisableLoggingFeature: Disables INFO logging during the analysis phase for the [org.jboss.threads] categories
[INFO] [stdout]  - io.quarkus.runtime.graal.ResourcesFeature: Register each line in META-INF/quarkus-native-resources.txt as a resource on Substrate VM
[INFO] [stdout] [2/7] Performing analysis...  [*********]                                                               (25.7s @ 2.07GB)
[INFO] [stdout]   14,606 (86.78%) of 16,831 classes reachable
[INFO] [stdout]   20,563 (62.38%) of 32,964 fields reachable
[INFO] [stdout]   72,254 (59.20%) of 122,051 methods reachable
[INFO] [stdout]      785 classes,   131 fields, and 9,093 methods registered for reflection
[INFO] [stdout]       63 classes,    68 fields, and    55 methods registered for JNI access
[INFO] [stdout]        4 native libraries: dl, pthread, rt, z
[INFO] [stdout] [3/7] Building universe...                                                                               (3.7s @ 4.72GB)
[INFO] [stdout] [4/7] Parsing methods...      [**]                                                                       (2.1s @ 4.94GB)
[INFO] [stdout] [5/7] Inlining methods...     [***]                                                                      (1.6s @ 2.49GB)
[INFO] [stdout] [6/7] Compiling methods...    [****]                                                                    (12.5s @ 5.00GB)
[INFO] [stdout] [7/7] Creating image...                                                                                  (5.1s @ 2.88GB)
[INFO] [stdout]   28.01MB (44.32%) for code area:    48,455 compilation units
[INFO] [stdout]   34.88MB (55.19%) for image heap:  335,035 objects and 604 resources
[INFO] [stdout]  318.17KB ( 0.49%) for other data
[INFO] [stdout]   63.20MB in total
[INFO] [stdout] ------------------------------------------------------------------------------------------------------------------------
[INFO] [stdout] Top 10 packages in code area:                               Top 10 object types in image heap:
[INFO] [stdout]    1.65MB sun.security.ssl                                     8.77MB java.lang.Class
[INFO] [stdout]    1.21MB java.util                                            5.98MB byte[] for code metadata
[INFO] [stdout]  840.86KB org.apache.camel.main                                3.05MB java.lang.String
[INFO] [stdout]  744.59KB org.apache.camel.impl.engine                         2.66MB byte[] for java.lang.String
[INFO] [stdout]  735.01KB com.sun.crypto.provider                              2.58MB byte[] for general heap data
[INFO] [stdout]  620.73KB org.apache.camel.model                               2.10MB byte[] for embedded resources
[INFO] [stdout]  566.33KB java.lang.invoke                                     1.23MB com.oracle.svm.core.hub.DynamicHubCompanion
[INFO] [stdout]  547.31KB java.util.concurrent                                 1.08MB byte[] for reflection metadata
[INFO] [stdout]  541.47KB java.lang                                          639.47KB java.util.HashMap$Node
[INFO] [stdout]  511.19KB org.apache.camel.support                           602.34KB java.lang.String[]
[INFO] [stdout]   19.79MB for 489 more packages                                5.42MB for 3186 more object types
[INFO] [stdout] ------------------------------------------------------------------------------------------------------------------------
[INFO] [stdout]                         2.4s (3.4% of total time) in 35 GCs | Peak RSS: 6.94GB | CPU load: 10.49
[INFO] [stdout] ------------------------------------------------------------------------------------------------------------------------
[INFO] [stdout] Produced artifacts:
[INFO] [stdout]  /home/ppalaga/orgs/cq/camel-quarkus/integration-tests/js-dsl/target/camel-quarkus-integration-test-js-dsl-2.14.0-SNAPSHOT-native-image-source-jar/camel-quarkus-integration-test-js-dsl-2.14.0-SNAPSHOT-runner (executable)
[INFO] [stdout]  /home/ppalaga/orgs/cq/camel-quarkus/integration-tests/js-dsl/target/camel-quarkus-integration-test-js-dsl-2.14.0-SNAPSHOT-native-image-source-jar/camel-quarkus-integration-test-js-dsl-2.14.0-SNAPSHOT-runner.build_artifacts.txt (txt)
[INFO] [stdout] ========================================================================================================================
[INFO] [stdout] Finished generating 'camel-quarkus-integration-test-js-dsl-2.14.0-SNAPSHOT-runner' in 1m 8s.
[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildRunner] objcopy --strip-debug camel-quarkus-integration-test-js-dsl-2.14.0-SNAPSHOT-runner
[INFO] [io.quarkus.deployment.QuarkusAugmentor] Quarkus augmentation completed in 71831ms
[INFO] 
[INFO] --- maven-failsafe-plugin:2.22.2:integration-test (default) @ camel-quarkus-integration-test-js-dsl ---
[INFO] 
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running org.apache.camel.quarkus.js.JavaScriptDslIT
[WARN] [stderr] ======================================================================================
[WARN] [stderr]   native.image.path was not set, making a guess for the correct path of native image
[WARN] [stderr]   guessed path: /home/ppalaga/orgs/cq/camel-quarkus/integration-tests/js-dsl/target/camel-quarkus-integration-test-js-dsl-2.14.0-SNAPSHOT-runner
[WARN] [stderr] ======================================================================================
[INFO] [stdout] Executing "/home/ppalaga/orgs/cq/camel-quarkus/integration-tests/js-dsl/target/camel-quarkus-integration-test-js-dsl-2.14.0-SNAPSHOT-runner -Dquarkus.http.port=42257 -Dquarkus.http.ssl-port=43007 -Dtest.url=http://localhost:42257 -Dquarkus.log.file.path=/home/ppalaga/orgs/cq/camel-quarkus/integration-tests/js-dsl/target/quarkus.log -Dquarkus.log.file.enable=true"
[INFO] [stdout] 2022-11-03 16:42:45,069 INFO  [org.apa.cam.qua.cor.CamelBootstrapRecorder] (main) Bootstrap runtime: org.apache.camel.quarkus.main.CamelMainRuntime
[INFO] [stdout] 2022-11-03 16:42:45,071 INFO  [org.apa.cam.mai.MainSupport] (main) Apache Camel (Main) 3.19.0 is starting
[INFO] [stdout] 2022-11-03 16:42:45,079 INFO  [org.apa.cam.mai.BaseMainSupport] (main) Auto-configuration summary
[INFO] [stdout] 2022-11-03 16:42:45,079 INFO  [org.apa.cam.mai.BaseMainSupport] (main)     [MicroProfilePropertiesSource] camel.main.routesIncludePattern=classpath:routes/my-routes.js
[INFO] [stdout] 2022-11-03 16:42:45,080 ERROR [org.apa.cam.qua.mai.CamelMainRuntime] (main) Failed to start application: java.lang.IllegalStateException: No language and polyglot implementation was found on the classpath. Make sure a language is added to the classpath (e.g., native-image --language:js).
[INFO] [stdout]         at org.graalvm.polyglot.Engine$PolyglotInvalid.noPolyglotImplementationFound(Engine.java:1001)
[INFO] [stdout]         at org.graalvm.polyglot.Engine$PolyglotInvalid.createHostAccess(Engine.java:991)
[INFO] [stdout]         at org.graalvm.polyglot.Engine$Builder.build(Engine.java:626)
[INFO] [stdout]         at org.graalvm.polyglot.Context$Builder.build(Context.java:1827)
[INFO] [stdout]         at org.apache.camel.dsl.js.JavaScriptRoutesBuilderLoader.doLoadEndpointRouteBuilder(JavaScriptRoutesBuilderLoader.java:53)
[INFO] [stdout]         at org.apache.camel.builder.endpoint.EndpointRouteBuilder$2.configure(EndpointRouteBuilder.java:79)
[INFO] [stdout]         at org.apache.camel.builder.RouteBuilder.checkInitialized(RouteBuilder.java:677)
[INFO] [stdout]         at org.apache.camel.builder.RouteBuilder.configureRoutes(RouteBuilder.java:619)
[INFO] [stdout]         at org.apache.camel.builder.RouteBuilder.addRoutesToCamelContext(RouteBuilder.java:555)
[INFO] [stdout]         at org.apache.camel.impl.engine.AbstractCamelContext.addRoutes(AbstractCamelContext.java:1202)
[INFO] [stdout]         at org.apache.camel.main.RoutesConfigurer.addDiscoveredRoutes(RoutesConfigurer.java:237)
[INFO] [stdout]         at org.apache.camel.main.RoutesConfigurer.configureRoutes(RoutesConfigurer.java:212)
[INFO] [stdout]         at org.apache.camel.quarkus.main.CamelMain.configureRoutes(CamelMain.java:70)
[INFO] [stdout]         at org.apache.camel.main.BaseMainSupport.postProcessCamelContext(BaseMainSupport.java:703)
[INFO] [stdout]         at org.apache.camel.quarkus.main.CamelMain.initCamelContext(CamelMain.java:116)
[INFO] [stdout]         at org.apache.camel.quarkus.main.CamelMain.doInit(CamelMain.java:86)
[INFO] [stdout]         at org.apache.camel.support.service.BaseService.init(BaseService.java:83)
[INFO] [stdout]         at org.apache.camel.quarkus.main.CamelMain.startEngine(CamelMain.java:137)
[INFO] [stdout]         at org.apache.camel.quarkus.main.CamelMainRuntime.start(CamelMainRuntime.java:49)
[INFO] [stdout]         at org.apache.camel.quarkus.core.CamelBootstrapRecorder.start(CamelBootstrapRecorder.java:45)
[INFO] [stdout]         at io.quarkus.deployment.steps.CamelBootstrapProcessor$boot173480958.deploy_0(Unknown Source)
[INFO] [stdout]         at io.quarkus.deployment.steps.CamelBootstrapProcessor$boot173480958.deploy(Unknown Source)
[INFO] [stdout]         at io.quarkus.runner.ApplicationImpl.doStart(Unknown Source)
[INFO] [stdout]         at io.quarkus.runtime.Application.start(Application.java:101)
[INFO] [stdout]         at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:110)
[INFO] [stdout]         at io.quarkus.runtime.Quarkus.run(Quarkus.java:70)
[INFO] [stdout]         at io.quarkus.runtime.Quarkus.run(Quarkus.java:43)
[INFO] [stdout]         at io.quarkus.runtime.Quarkus.run(Quarkus.java:123)
[INFO] [stdout]         at io.quarkus.runner.GeneratedMain.main(Unknown Source)
[INFO] [stdout] 
[INFO] [stdout] 2022-11-03 16:42:45,083 ERROR [io.qua.run.Application] (main) Failed to start application (with profile prod): java.lang.IllegalStateException: No language and polyglot implementation was found on the classpath. Make sure a language is added to the classpath (e.g., native-image --language:js).
[INFO] [stdout]         at org.graalvm.polyglot.Engine$PolyglotInvalid.noPolyglotImplementationFound(Engine.java:1001)
[INFO] [stdout]         at org.graalvm.polyglot.Engine$PolyglotInvalid.createHostAccess(Engine.java:991)
[INFO] [stdout]         at org.graalvm.polyglot.Engine$Builder.build(Engine.java:626)
[INFO] [stdout]         at org.graalvm.polyglot.Context$Builder.build(Context.java:1827)
[INFO] [stdout]         at org.apache.camel.dsl.js.JavaScriptRoutesBuilderLoader.doLoadEndpointRouteBuilder(JavaScriptRoutesBuilderLoader.java:53)
[INFO] [stdout]         at org.apache.camel.builder.endpoint.EndpointRouteBuilder$2.configure(EndpointRouteBuilder.java:79)
[INFO] [stdout]         at org.apache.camel.builder.RouteBuilder.checkInitialized(RouteBuilder.java:677)
[INFO] [stdout]         at org.apache.camel.builder.RouteBuilder.configureRoutes(RouteBuilder.java:619)
[INFO] [stdout]         at org.apache.camel.builder.RouteBuilder.addRoutesToCamelContext(RouteBuilder.java:555)
[INFO] [stdout]         at org.apache.camel.impl.engine.AbstractCamelContext.addRoutes(AbstractCamelContext.java:1202)
[INFO] [stdout]         at org.apache.camel.main.RoutesConfigurer.addDiscoveredRoutes(RoutesConfigurer.java:237)
[INFO] [stdout]         at org.apache.camel.main.RoutesConfigurer.configureRoutes(RoutesConfigurer.java:212)
[INFO] [stdout]         at org.apache.camel.quarkus.main.CamelMain.configureRoutes(CamelMain.java:70)
[INFO] [stdout]         at org.apache.camel.main.BaseMainSupport.postProcessCamelContext(BaseMainSupport.java:703)
[INFO] [stdout]         at org.apache.camel.quarkus.main.CamelMain.initCamelContext(CamelMain.java:116)
[INFO] [stdout]         at org.apache.camel.quarkus.main.CamelMain.doInit(CamelMain.java:86)
[INFO] [stdout]         at org.apache.camel.support.service.BaseService.init(BaseService.java:83)
[INFO] [stdout]         at org.apache.camel.quarkus.main.CamelMain.startEngine(CamelMain.java:137)
[INFO] [stdout]         at org.apache.camel.quarkus.main.CamelMainRuntime.start(CamelMainRuntime.java:49)
[INFO] [stdout]         at org.apache.camel.quarkus.core.CamelBootstrapRecorder.start(CamelBootstrapRecorder.java:45)
[INFO] [stdout]         at io.quarkus.deployment.steps.CamelBootstrapProcessor$boot173480958.deploy_0(Unknown Source)
[INFO] [stdout]         at io.quarkus.deployment.steps.CamelBootstrapProcessor$boot173480958.deploy(Unknown Source)
[INFO] [stdout]         at io.quarkus.runner.ApplicationImpl.doStart(Unknown Source)
[INFO] [stdout]         at io.quarkus.runtime.Application.start(Application.java:101)
[INFO] [stdout]         at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:110)
[INFO] [stdout]         at io.quarkus.runtime.Quarkus.run(Quarkus.java:70)
[INFO] [stdout]         at io.quarkus.runtime.Quarkus.run(Quarkus.java:43)
[INFO] [stdout]         at io.quarkus.runtime.Quarkus.run(Quarkus.java:123)
[INFO] [stdout]         at io.quarkus.runner.GeneratedMain.main(Unknown Source)
[INFO] [stdout] 
[WARN] [stderr] Failed to launch the application. The application logs can be found at: /home/ppalaga/orgs/cq/camel-quarkus/integration-tests/js-dsl/target/quarkus.log

This might be the case since longer because we do not test js-dsl in native mode on GH Actions.

As confirmed bellow by @lburgazzoli Camel K is neither using nor planning to use this functionality. Hence we should be fine to mark js-dsl as JVM only.

@ppalaga
Copy link
Contributor Author

ppalaga commented Nov 3, 2022

@lburgazzoli haven't you mentioned last time that you use js-dsl in Camel K only in JVM mode anyway? In other words would you mind if we declare js-dsl as jvm only and stop caring for native issues altogether?

@lburgazzoli
Copy link
Contributor

fine with me

@ppalaga ppalaga changed the title js-dsl itest fails in native mode Mark js-dsl as JVM only Nov 7, 2022
@jamesnetherton
Copy link
Contributor

JS-DSL will be marked as deprecated in Camel 4.6.0 / CQ 3.11.0. So there's not much value in investing time here IMO.

@jamesnetherton jamesnetherton closed this as not planned Won't fix, can't repro, duplicate, stale May 9, 2024
@github-actions github-actions bot added this to the No fix/wont't fix milestone May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants