Does Temporal support building native image with GraalVM, I got the below error when tried to build with GraalVM
Exception in thread “main” com.oracle.svm.core.jdk.UnsupportedFeatureError: Proxy class defined by interfaces [interface io.temporal.serviceclient.WorkflowServiceStubs] not found. Generating proxy classes at runtime is not supported. Proxy classes need to be defined at image build time by specifying the list of interfaces that they implement. To define proxy classes use -H:DynamicProxyConfigurationFiles= and -H:DynamicProxyConfigurationResources= options.
at org.graalvm.nativeimage.builder/com.oracle.svm.core.util.VMError.unsupportedFeature(VMError.java:92)
Hrmm, we don’t have explicit support though we do use GraalVM to AOT compile our test server in that repo.
You should be able to manually specify your activity and workflow interfaces for use by the proxy object, see Configure Dynamic Proxies Manually. But we have not tested. Also, see these options we have had to set for GraalVM to work with our test server (mostly to get Netty to work).
I have opened this issue in our samples repo to see if we can add a GraalVM sample.
Thank you @Chad_Retz , Will try with configuring proxy
Thanks
I tried like below, but still not working, same error, not sure if its not taking the json file, but the path is correct
graalvmNative {
binaries {
named("main") {
buildArgs.add("-H:DynamicProxyConfigurationFiles=${(file("proxies.json"))}")
buildArgs.add("-H:+ReportExceptionStackTraces")
}
}
}
JSON
[
{
"interfaces": [
"io.gk.app01.intf.StringReverseWorkflow",
"io.temporal.serviceclient.WorkflowServiceStubs"
]
}
]
I moved the files to “resources” folder and chagne the gradle like below, Compilation is good, but still get the run time error
graalvmNative {
binaries {
named("main") {
buildArgs.add("-H:DynamicProxyConfigurationFiles=../../resources/main/proxies.json")
buildArgs.add("-H:DynamicProxyConfigurationResources=proxies.json")
buildArgs.add("-H:ReflectionConfigurationResources=reflect-config.json")
buildArgs.add("-H:ResourceConfigurationResources=resource-config.json")
buildArgs.add("-H:+ReportExceptionStackTraces")
}
}
I am afraid we don’t have official support for GraalVM at the moment. I have opened the issue to get a GraalVM sample added. When we implement it, we will work on debugging the issues you’re finding and see what configuration works properly.
1 Like