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

Add SmallRye Stork service discovery #68

Closed
wants to merge 13 commits into from

Conversation

edeandrea
Copy link
Collaborator

Adding SmallRye Stork service discovery for both the hero & villain services.

The VillainClient, is implemented by directly using the JAX-RS client API with the RESTEasy Reactive client. Therefore, the Stork API is used directly in order to get the same functionality available in the HeroRestClient.

Fixes #40

@edeandrea
Copy link
Collaborator Author

Hey @cescoffier / @aureamunoz / @michalszynkiewicz would you mind taking a look through this and make sure everything looks ok (including the updated documentation on the README)?

In the VillainClient I used the Stork API directly to implement the service discovery/client load balancing because it directly uses the JAX-RS client API.

@edeandrea
Copy link
Collaborator Author

Wait @cescoffier / @aureamunoz / @michalszynkiewicz is stork supposed to work in native? When I tried to build native image on my machine with these changes I'm getting this:

========================================================================================================================
GraalVM Native Image: Generating 'rest-fights-1.0-runner'...
========================================================================================================================
[1/7] Initializing...                                                                                   (13.5s @ 0.54GB)
 Version info: 'GraalVM 22.0.0.2 Java 11 CE'
 5 user-provided feature(s)
  - io.quarkus.caffeine.runtime.graal.CacheConstructorsAutofeature
  - io.quarkus.hibernate.validator.runtime.DisableLoggingAutoFeature
  - io.quarkus.runner.AutoFeature
  - io.quarkus.runtime.graal.DisableLoggingAutoFeature
  - io.quarkus.runtime.graal.ResourcesFeature
[2/7] Performing analysis...  [*********]                                                              (216.0s @ 4.81GB)
  26,661 (97.18%) of 27,436 classes reachable
  46,452 (74.67%) of 62,206 fields reachable
 162,784 (86.75%) of 187,640 methods reachable
   1,848 classes, 4,876 fields, and 19,361 methods registered for reflection
      68 classes,    89 fields, and    54 methods registered for JNI access

Error: Unsupported features in 2 methods
Detailed message:
Error: Class initialization of io.fabric8.kubernetes.client.internal.CertUtils$1 failed. Use the option --initialize-at-run-time=io.fabric8.kubernetes.client.internal.CertUtils$1 to explicitly request delayed initialization of this class.
Original exception that caused the problem: java.lang.NoClassDefFoundError: org/bouncycastle/jce/provider/BouncyCastleProvider
        at java.base/jdk.internal.misc.Unsafe.ensureClassInitialized0(Native Method)
        at java.base/jdk.internal.misc.Unsafe.ensureClassInitialized(Unsafe.java:1042)
        at jdk.unsupported/sun.misc.Unsafe.ensureClassInitialized(Unsafe.java:698)
        at jdk.internal.vm.compiler/org.graalvm.compiler.serviceprovider.GraalUnsafeAccess.ensureClassInitialized(GraalUnsafeAccess.java:78)
        at com.oracle.svm.hosted.classinitialization.ConfigurableClassInitialization.ensureClassInitialized(ConfigurableClassInitialization.java:178)
        at com.oracle.svm.hosted.classinitialization.ConfigurableClassInitialization.computeInitKindAndMaybeInitializeClass(ConfigurableClassInitialization.java:648)
        at com.oracle.svm.hosted.classinitialization.ConfigurableClassInitialization.computeInitKindAndMaybeInitializeClass(ConfigurableClassInitialization.java:131)
        at com.oracle.svm.hosted.classinitialization.ConfigurableClassInitialization.shouldInitializeAtRuntime(ConfigurableClassInitialization.java:159)
        at com.oracle.svm.hosted.SVMHost.isInitialized(SVMHost.java:304)
        at com.oracle.graal.pointsto.meta.AnalysisType.isInitialized(AnalysisType.java:729)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.maybeEagerlyInitialize(BytecodeParser.java:4449)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genNewInstance(BytecodeParser.java:4647)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genNewInstance(BytecodeParser.java:4636)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genNewInstance(BytecodeParser.java:4631)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBytecode(BytecodeParser.java:5412)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.iterateBytecodesForBlock(BytecodeParser.java:3513)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.handleBytecodeBlock(BytecodeParser.java:3473)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBlock(BytecodeParser.java:3318)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.build(BytecodeParser.java:1149)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.buildRootMethod(BytecodeParser.java:1041)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.GraphBuilderPhase$Instance.run(GraphBuilderPhase.java:84)
        at com.oracle.svm.hosted.phases.SharedGraphBuilderPhase.run(SharedGraphBuilderPhase.java:80)
        at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.run(Phase.java:49)
        at jdk.internal.vm.compiler/org.graalvm.compiler.phases.BasePhase.apply(BasePhase.java:214)
        at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.apply(Phase.java:42)
        at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.apply(Phase.java:38)
        at com.oracle.graal.pointsto.flow.AnalysisParsedGraph.parseBytecode(AnalysisParsedGraph.java:132)
        at com.oracle.graal.pointsto.meta.AnalysisMethod.ensureGraphParsed(AnalysisMethod.java:556)
        at com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.parse(MethodTypeFlowBuilder.java:167)
        at com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.apply(MethodTypeFlowBuilder.java:358)
        at com.oracle.graal.pointsto.flow.MethodTypeFlow.createTypeFlow(MethodTypeFlow.java:297)
        at com.oracle.graal.pointsto.flow.MethodTypeFlow.ensureTypeFlowCreated(MethodTypeFlow.java:286)
        at com.oracle.graal.pointsto.flow.MethodTypeFlow.addContext(MethodTypeFlow.java:107)
        at com.oracle.graal.pointsto.flow.StaticInvokeTypeFlow.update(InvokeTypeFlow.java:428)
        at com.oracle.graal.pointsto.PointsToAnalysis$2.run(PointsToAnalysis.java:598)
        at com.oracle.graal.pointsto.util.CompletionExecutor.executeCommand(CompletionExecutor.java:195)
        at com.oracle.graal.pointsto.util.CompletionExecutor.lambda$executeService$0(CompletionExecutor.java:179)
        at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1426)
        at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
        at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
        at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
        at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
        at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
Caused by: java.lang.ClassNotFoundException: org.bouncycastle.jce.provider.BouncyCastleProvider
        at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:476)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
        ... 43 more
Error: com.oracle.graal.pointsto.constraints.UnresolvedElementException: Discovered unresolved method during parsing: io.fabric8.kubernetes.client.internal.CertUtils$1.<init>(java.io.InputStream). To diagnose the issue you can use the --allow-incomplete-classpath option. The missing method is then reported at run time when it is accessed the first time.
Trace: 
        at parsing io.fabric8.kubernetes.client.internal.CertUtils.handleECKey(CertUtils.java:145)
Call path from entry point to io.fabric8.kubernetes.client.internal.CertUtils.handleECKey(InputStream): 
        at io.fabric8.kubernetes.client.internal.CertUtils.handleECKey(CertUtils.java:145)
        at io.fabric8.kubernetes.client.internal.CertUtils.loadKey(CertUtils.java:134)
        at io.fabric8.kubernetes.client.internal.CertUtils.createKeyStore(CertUtils.java:112)
        at io.fabric8.kubernetes.client.internal.CertUtils.createKeyStore(CertUtils.java:247)
        at io.fabric8.kubernetes.client.internal.SSLUtils.keyManagers(SSLUtils.java:153)
        at io.fabric8.kubernetes.client.internal.SSLUtils.keyManagers(SSLUtils.java:147)
        at io.fabric8.kubernetes.client.utils.HttpClientUtils.applyCommonConfiguration(HttpClientUtils.java:204)
        at io.fabric8.kubernetes.client.okhttp.OkHttpClientFactory.createHttpClient(OkHttpClientFactory.java:89)
        at io.fabric8.kubernetes.client.utils.HttpClientUtils.createHttpClient(HttpClientUtils.java:164)
        at io.fabric8.kubernetes.client.internal.SSLUtils.isHttpsAvailable(SSLUtils.java:67)
        at io.fabric8.kubernetes.client.Config.<init>(Config.java:341)
        at io.fabric8.kubernetes.client.ConfigBuilder.build(ConfigBuilder.java:150)
        at io.fabric8.kubernetes.client.ConfigBuilder.build(ConfigBuilder.java:6)
        at io.fabric8.kubernetes.api.builder.BaseFluent$$Lambda$3123/0x00000007c2d54c40.apply(Unknown Source)
        at sun.security.ec.XECParameters$1.get(XECParameters.java:183)
        at com.oracle.svm.core.jdk.SystemPropertiesSupport.initializeLazyValue(SystemPropertiesSupport.java:216)
        at com.oracle.svm.core.jdk.SystemPropertiesSupport.getProperty(SystemPropertiesSupport.java:169)
        at com.oracle.svm.core.jdk.Target_java_lang_System.getProperty(JavaLangSubstitutions.java:318)
        at com.oracle.svm.jni.JNIJavaCallWrappers.jniInvoke_VARARGS_System_getProperty_deeeaa72a006d330408a3b7d002c7533e108bc28(generated:0)

com.oracle.svm.core.util.UserError$UserException: Unsupported features in 2 methods
Detailed message:
Error: Class initialization of io.fabric8.kubernetes.client.internal.CertUtils$1 failed. Use the option --initialize-at-run-time=io.fabric8.kubernetes.client.internal.CertUtils$1 to explicitly request delayed initialization of this class.
Original exception that caused the problem: java.lang.NoClassDefFoundError: org/bouncycastle/jce/provider/BouncyCastleProvider
        at java.base/jdk.internal.misc.Unsafe.ensureClassInitialized0(Native Method)
        at java.base/jdk.internal.misc.Unsafe.ensureClassInitialized(Unsafe.java:1042)
        at jdk.unsupported/sun.misc.Unsafe.ensureClassInitialized(Unsafe.java:698)
        at jdk.internal.vm.compiler/org.graalvm.compiler.serviceprovider.GraalUnsafeAccess.ensureClassInitialized(GraalUnsafeAccess.java:78)
        at com.oracle.svm.hosted.classinitialization.ConfigurableClassInitialization.ensureClassInitialized(ConfigurableClassInitialization.java:178)
        at com.oracle.svm.hosted.classinitialization.ConfigurableClassInitialization.computeInitKindAndMaybeInitializeClass(ConfigurableClassInitialization.java:648)
        at com.oracle.svm.hosted.classinitialization.ConfigurableClassInitialization.computeInitKindAndMaybeInitializeClass(ConfigurableClassInitialization.java:131)
        at com.oracle.svm.hosted.classinitialization.ConfigurableClassInitialization.shouldInitializeAtRuntime(ConfigurableClassInitialization.java:159)
        at com.oracle.svm.hosted.SVMHost.isInitialized(SVMHost.java:304)
        at com.oracle.graal.pointsto.meta.AnalysisType.isInitialized(AnalysisType.java:729)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.maybeEagerlyInitialize(BytecodeParser.java:4449)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genNewInstance(BytecodeParser.java:4647)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genNewInstance(BytecodeParser.java:4636)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genNewInstance(BytecodeParser.java:4631)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBytecode(BytecodeParser.java:5412)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.iterateBytecodesForBlock(BytecodeParser.java:3513)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.handleBytecodeBlock(BytecodeParser.java:3473)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBlock(BytecodeParser.java:3318)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.build(BytecodeParser.java:1149)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.buildRootMethod(BytecodeParser.java:1041)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.GraphBuilderPhase$Instance.run(GraphBuilderPhase.java:84)
        at com.oracle.svm.hosted.phases.SharedGraphBuilderPhase.run(SharedGraphBuilderPhase.java:80)
        at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.run(Phase.java:49)
        at jdk.internal.vm.compiler/org.graalvm.compiler.phases.BasePhase.apply(BasePhase.java:214)
        at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.apply(Phase.java:42)
        at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.apply(Phase.java:38)
        at com.oracle.graal.pointsto.flow.AnalysisParsedGraph.parseBytecode(AnalysisParsedGraph.java:132)
        at com.oracle.graal.pointsto.meta.AnalysisMethod.ensureGraphParsed(AnalysisMethod.java:556)
        at com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.parse(MethodTypeFlowBuilder.java:167)
        at com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.apply(MethodTypeFlowBuilder.java:358)
        at com.oracle.graal.pointsto.flow.MethodTypeFlow.createTypeFlow(MethodTypeFlow.java:297)
        at com.oracle.graal.pointsto.flow.MethodTypeFlow.ensureTypeFlowCreated(MethodTypeFlow.java:286)
        at com.oracle.graal.pointsto.flow.MethodTypeFlow.addContext(MethodTypeFlow.java:107)
        at com.oracle.graal.pointsto.flow.StaticInvokeTypeFlow.update(InvokeTypeFlow.java:428)
        at com.oracle.graal.pointsto.PointsToAnalysis$2.run(PointsToAnalysis.java:598)
        at com.oracle.graal.pointsto.util.CompletionExecutor.executeCommand(CompletionExecutor.java:195)
        at com.oracle.graal.pointsto.util.CompletionExecutor.lambda$executeService$0(CompletionExecutor.java:179)
        at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1426)
        at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
        at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
        at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
        at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
        at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
Caused by: java.lang.ClassNotFoundException: org.bouncycastle.jce.provider.BouncyCastleProvider
        at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:476)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
        ... 43 more
Error: com.oracle.graal.pointsto.constraints.UnresolvedElementException: Discovered unresolved method during parsing: io.fabric8.kubernetes.client.internal.CertUtils$1.<init>(java.io.InputStream). To diagnose the issue you can use the --allow-incomplete-classpath option. The missing method is then reported at run time when it is accessed the first time.
Trace: 
        at parsing io.fabric8.kubernetes.client.internal.CertUtils.handleECKey(CertUtils.java:145)
Call path from entry point to io.fabric8.kubernetes.client.internal.CertUtils.handleECKey(InputStream): 
        at io.fabric8.kubernetes.client.internal.CertUtils.handleECKey(CertUtils.java:145)
        at io.fabric8.kubernetes.client.internal.CertUtils.loadKey(CertUtils.java:134)
        at io.fabric8.kubernetes.client.internal.CertUtils.createKeyStore(CertUtils.java:112)
        at io.fabric8.kubernetes.client.internal.CertUtils.createKeyStore(CertUtils.java:247)
        at io.fabric8.kubernetes.client.internal.SSLUtils.keyManagers(SSLUtils.java:153)
        at io.fabric8.kubernetes.client.internal.SSLUtils.keyManagers(SSLUtils.java:147)
        at io.fabric8.kubernetes.client.utils.HttpClientUtils.applyCommonConfiguration(HttpClientUtils.java:204)
        at io.fabric8.kubernetes.client.okhttp.OkHttpClientFactory.createHttpClient(OkHttpClientFactory.java:89)
        at io.fabric8.kubernetes.client.utils.HttpClientUtils.createHttpClient(HttpClientUtils.java:164)
        at io.fabric8.kubernetes.client.internal.SSLUtils.isHttpsAvailable(SSLUtils.java:67)
        at io.fabric8.kubernetes.client.Config.<init>(Config.java:341)
        at io.fabric8.kubernetes.client.ConfigBuilder.build(ConfigBuilder.java:150)
        at io.fabric8.kubernetes.client.ConfigBuilder.build(ConfigBuilder.java:6)
        at io.fabric8.kubernetes.api.builder.BaseFluent$$Lambda$3123/0x00000007c2d54c40.apply(Unknown Source)
        at sun.security.ec.XECParameters$1.get(XECParameters.java:183)
        at com.oracle.svm.core.jdk.SystemPropertiesSupport.initializeLazyValue(SystemPropertiesSupport.java:216)
        at com.oracle.svm.core.jdk.SystemPropertiesSupport.getProperty(SystemPropertiesSupport.java:169)
        at com.oracle.svm.core.jdk.Target_java_lang_System.getProperty(JavaLangSubstitutions.java:318)
        at com.oracle.svm.jni.JNIJavaCallWrappers.jniInvoke_VARARGS_System_getProperty_deeeaa72a006d330408a3b7d002c7533e108bc28(generated:0)

        at com.oracle.svm.core.util.UserError.abort(UserError.java:87)
        at com.oracle.svm.hosted.FallbackFeature.reportAsFallback(FallbackFeature.java:233)
        at com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:731)
        at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:537)
        at com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:494)
        at com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:426)
        at com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:587)
        at com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:126)
        at com.oracle.svm.hosted.NativeImageGeneratorRunner$JDK9Plus.main(NativeImageGeneratorRunner.java:617)
Caused by: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: Unsupported features in 2 methods
Detailed message:
Error: Class initialization of io.fabric8.kubernetes.client.internal.CertUtils$1 failed. Use the option --initialize-at-run-time=io.fabric8.kubernetes.client.internal.CertUtils$1 to explicitly request delayed initialization of this class.
Original exception that caused the problem: java.lang.NoClassDefFoundError: org/bouncycastle/jce/provider/BouncyCastleProvider
        at java.base/jdk.internal.misc.Unsafe.ensureClassInitialized0(Native Method)
        at java.base/jdk.internal.misc.Unsafe.ensureClassInitialized(Unsafe.java:1042)
        at jdk.unsupported/sun.misc.Unsafe.ensureClassInitialized(Unsafe.java:698)
        at jdk.internal.vm.compiler/org.graalvm.compiler.serviceprovider.GraalUnsafeAccess.ensureClassInitialized(GraalUnsafeAccess.java:78)
        at com.oracle.svm.hosted.classinitialization.ConfigurableClassInitialization.ensureClassInitialized(ConfigurableClassInitialization.java:178)
        at com.oracle.svm.hosted.classinitialization.ConfigurableClassInitialization.computeInitKindAndMaybeInitializeClass(ConfigurableClassInitialization.java:648)
        at com.oracle.svm.hosted.classinitialization.ConfigurableClassInitialization.computeInitKindAndMaybeInitializeClass(ConfigurableClassInitialization.java:131)
        at com.oracle.svm.hosted.classinitialization.ConfigurableClassInitialization.shouldInitializeAtRuntime(ConfigurableClassInitialization.java:159)
        at com.oracle.svm.hosted.SVMHost.isInitialized(SVMHost.java:304)
        at com.oracle.graal.pointsto.meta.AnalysisType.isInitialized(AnalysisType.java:729)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.maybeEagerlyInitialize(BytecodeParser.java:4449)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genNewInstance(BytecodeParser.java:4647)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genNewInstance(BytecodeParser.java:4636)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genNewInstance(BytecodeParser.java:4631)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBytecode(BytecodeParser.java:5412)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.iterateBytecodesForBlock(BytecodeParser.java:3513)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.handleBytecodeBlock(BytecodeParser.java:3473)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBlock(BytecodeParser.java:3318)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.build(BytecodeParser.java:1149)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.buildRootMethod(BytecodeParser.java:1041)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.GraphBuilderPhase$Instance.run(GraphBuilderPhase.java:84)
        at com.oracle.svm.hosted.phases.SharedGraphBuilderPhase.run(SharedGraphBuilderPhase.java:80)
        at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.run(Phase.java:49)
        at jdk.internal.vm.compiler/org.graalvm.compiler.phases.BasePhase.apply(BasePhase.java:214)
        at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.apply(Phase.java:42)
        at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.apply(Phase.java:38)
        at com.oracle.graal.pointsto.flow.AnalysisParsedGraph.parseBytecode(AnalysisParsedGraph.java:132)
        at com.oracle.graal.pointsto.meta.AnalysisMethod.ensureGraphParsed(AnalysisMethod.java:556)
        at com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.parse(MethodTypeFlowBuilder.java:167)
        at com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.apply(MethodTypeFlowBuilder.java:358)
        at com.oracle.graal.pointsto.flow.MethodTypeFlow.createTypeFlow(MethodTypeFlow.java:297)
        at com.oracle.graal.pointsto.flow.MethodTypeFlow.ensureTypeFlowCreated(MethodTypeFlow.java:286)
        at com.oracle.graal.pointsto.flow.MethodTypeFlow.addContext(MethodTypeFlow.java:107)
        at com.oracle.graal.pointsto.flow.StaticInvokeTypeFlow.update(InvokeTypeFlow.java:428)
        at com.oracle.graal.pointsto.PointsToAnalysis$2.run(PointsToAnalysis.java:598)
        at com.oracle.graal.pointsto.util.CompletionExecutor.executeCommand(CompletionExecutor.java:195)
        at com.oracle.graal.pointsto.util.CompletionExecutor.lambda$executeService$0(CompletionExecutor.java:179)
        at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1426)
        at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
        at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
        at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
        at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
        at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
Caused by: java.lang.ClassNotFoundException: org.bouncycastle.jce.provider.BouncyCastleProvider
        at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:476)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
        ... 43 more
Error: com.oracle.graal.pointsto.constraints.UnresolvedElementException: Discovered unresolved method during parsing: io.fabric8.kubernetes.client.internal.CertUtils$1.<init>(java.io.InputStream). To diagnose the issue you can use the --allow-incomplete-classpath option. The missing method is then reported at run time when it is accessed the first time.
Trace: 
        at parsing io.fabric8.kubernetes.client.internal.CertUtils.handleECKey(CertUtils.java:145)
Call path from entry point to io.fabric8.kubernetes.client.internal.CertUtils.handleECKey(InputStream): 
        at io.fabric8.kubernetes.client.internal.CertUtils.handleECKey(CertUtils.java:145)
        at io.fabric8.kubernetes.client.internal.CertUtils.loadKey(CertUtils.java:134)
        at io.fabric8.kubernetes.client.internal.CertUtils.createKeyStore(CertUtils.java:112)
        at io.fabric8.kubernetes.client.internal.CertUtils.createKeyStore(CertUtils.java:247)
        at io.fabric8.kubernetes.client.internal.SSLUtils.keyManagers(SSLUtils.java:153)
        at io.fabric8.kubernetes.client.internal.SSLUtils.keyManagers(SSLUtils.java:147)
        at io.fabric8.kubernetes.client.utils.HttpClientUtils.applyCommonConfiguration(HttpClientUtils.java:204)
        at io.fabric8.kubernetes.client.okhttp.OkHttpClientFactory.createHttpClient(OkHttpClientFactory.java:89)
        at io.fabric8.kubernetes.client.utils.HttpClientUtils.createHttpClient(HttpClientUtils.java:164)
        at io.fabric8.kubernetes.client.internal.SSLUtils.isHttpsAvailable(SSLUtils.java:67)
        at io.fabric8.kubernetes.client.Config.<init>(Config.java:341)
        at io.fabric8.kubernetes.client.ConfigBuilder.build(ConfigBuilder.java:150)
        at io.fabric8.kubernetes.client.ConfigBuilder.build(ConfigBuilder.java:6)
        at io.fabric8.kubernetes.api.builder.BaseFluent$$Lambda$3123/0x00000007c2d54c40.apply(Unknown Source)
        at sun.security.ec.XECParameters$1.get(XECParameters.java:183)
        at com.oracle.svm.core.jdk.SystemPropertiesSupport.initializeLazyValue(SystemPropertiesSupport.java:216)
        at com.oracle.svm.core.jdk.SystemPropertiesSupport.getProperty(SystemPropertiesSupport.java:169)
        at com.oracle.svm.core.jdk.Target_java_lang_System.getProperty(JavaLangSubstitutions.java:318)
        at com.oracle.svm.jni.JNIJavaCallWrappers.jniInvoke_VARARGS_System_getProperty_deeeaa72a006d330408a3b7d002c7533e108bc28(generated:0)

        at com.oracle.graal.pointsto.constraints.UnsupportedFeatures.report(UnsupportedFeatures.java:129)
        at com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:728)
        ... 6 more
------------------------------------------------------------------------------------------------------------------------
                       25.6s (11.0% of total time) in 47 GCs | Peak RSS: 5.68GB | CPU load: 6.28
------------------------------------------------------------------------------------------------------------------------

@edeandrea
Copy link
Collaborator Author

seems if i add

<dependency>
      <groupId>org.bouncycastle</groupId>
      <artifactId>bcprov-jdk15on</artifactId>
    </dependency>
    <dependency>
      <groupId>org.bouncycastle</groupId>
      <artifactId>bcpkix-jdk15on</artifactId>
    </dependency>

to my pom.xml then native succeeds.

@edeandrea edeandrea force-pushed the stork branch 6 times, most recently from dadd459 to 3978b59 Compare May 6, 2022 18:20
edeandrea and others added 9 commits May 10, 2022 08:31
Bumps `quarkus.platform.version` from 2.8.3.Final to 2.9.0.Final.

Updates `quarkus-bom` from 2.8.3.Final to 2.9.0.Final
- [Release notes](https://github.com/quarkusio/quarkus-platform/releases)
- [Commits](quarkusio/quarkus-platform@2.8.3.Final...2.9.0.Final)

Updates `quarkus-maven-plugin` from 2.8.3.Final to 2.9.0.Final

---
updated-dependencies:
- dependency-name: io.quarkus.platform:quarkus-bom
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: io.quarkus.platform:quarkus-maven-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Eric Deandrea <[email protected]>
* Create multi-arch images

Fixes #70

* Create multi-arch images

Fixes #70
@edeandrea
Copy link
Collaborator Author

Hi @michalszynkiewicz would you be able to take a quick look at this for me?

@michalszynkiewicz
Copy link
Member

I'm at a conference this week, I'll try. Please ping me on zulip if I won't do it before the weekend

@edeandrea
Copy link
Collaborator Author

Oh its fine it can wait until next week! Enjoy the conference!

@aureamunoz
Copy link
Member

Apoligies for the delay @edeandrea, Im in Devoxx UK and I have been working on the talk until now, I'll take a look

@edeandrea
Copy link
Collaborator Author

No worries at all @aureamunoz! Go attend the conference and good luck on your talk! This can wait until after.

Copy link
Member

@aureamunoz aureamunoz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Globally LGTM. Is there a reason to not using the quarkus stork extension? And in that case, you should use the corresponding kubernetes client one for take advantage of all native staff around Kubernetes client (look at #24444)

@aureamunoz
Copy link
Member

LGTM

No worries at all @aureamunoz! Go attend the conference and good luck on your talk! This can wait until after.

Thanks @edeandrea! just did a quick review ;-)

@edeandrea
Copy link
Collaborator Author

edeandrea commented May 12, 2022

Thanks @aureamunoz

Is there a reason to not using the quarkus stork extension?

Isn't this project using it? The guide makes no mention of any Quarkus specific extension. It just mentions the stork libraries.

The rest-fights service has 2 downstream services (rest-heroes & rest-villains). The calls to the rest-heroes service uses the rest client, which integrates directly with stork (just configuration added to application.properties).

The calls to rest-villains use the microprofile rest client. This was done on purpose to showcase the differences (which you can now see glaringly now that Stork has been added :) ). There's lots & lots more code in the VillainClient.

And in that case, you should use the corresponding kubernetes client one for take advantage of all native staff around Kubernetes client

The pom.xml already includes all the stork load balancer & service discovery extensions. Are you saying that additionally I should include the kubernetes-client extension, & that would eliminate the need for me to include the bouncycastle libs (like I see in quarkusio/quarkus#24444)?

@edeandrea
Copy link
Collaborator Author

@michalszynkiewicz / @aureamunoz for some reason my PR got all messed up when I tried to rebase main on top of it. I'm going to start with a fresh PR.

@aureamunoz
Copy link
Member

@michalszynkiewicz / @aureamunoz for some reason my PR got all messed up when I tried to rebase main on top of it. I'm going to start with a fresh PR.

Ah, this is why I now see 118 modified files? Before I though having only 16

@aureamunoz
Copy link
Member

Thanks @aureamunoz

Is there a reason to not using the quarkus stork extension?

Isn't this project using it? The guide makes no mention of any Quarkus specific extension. It just mentions the stork libraries.

The rest-fights service has 2 downstream services (rest-heroes & rest-villains). The calls to the rest-heroes service uses the rest client, which integrates directly with stork (just configuration added to application.properties).

The calls to rest-villains use the microprofile rest client. This was done on purpose to showcase the differences (which you can now see glaringly now that Stork has been added :) ). There's lots & lots more code in the VillainClient.

And in that case, you should use the corresponding kubernetes client one for take advantage of all native staff around Kubernetes client

The pom.xml already includes all the stork load balancer & service discovery extensions. Are you saying that additionally I should include the kubernetes-client extension, & that would eliminate the need for me to include the bouncycastle libs (like I see in quarkusio/quarkus#24444)?

Ok, my bad ! yes, the stork extension is used via the quarkus-smallrye-stork that I hadn't seen. It's ok.
So, globally it's ok. The bouncy castle dependencies shouldn't be necessary if you use the Quarkus Kubernetes client. Once the quarkusio/quarkus#24444 will be release you will have a Warning with a relevant error in the console.

@edeandrea
Copy link
Collaborator Author

@michalszynkiewicz / @aureamunoz see #82 for the fixed PR for this.

@edeandrea edeandrea closed this May 12, 2022
@edeandrea edeandrea deleted the stork branch May 12, 2022 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fights-service Fights service
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add SmallRye Stork service discovery
3 participants