-
-
Notifications
You must be signed in to change notification settings - Fork 317
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
In Native image SpringCloudClientConfiguration.properties file is missing #673
Comments
For now, this works in Spring Boot 3, with 3.0.0-RC1; @Configuration
@ImportRuntimeHints(AwsRuntimeHints::class)
class AwsRuntimeHintsConfig
class AwsRuntimeHints : RuntimeHintsRegistrar {
override fun registerHints(hints: RuntimeHints, classLoader: ClassLoader?) {
hints.resources().registerPattern("io/awspring/cloud/core/SpringCloudClientConfiguration.properties")
}
} |
@maciejwalkowiak for s3 we also need "S3ObjectContentTypeResolver.properties" is there any timeline or suggestion concerning the 3.1 release ? @goafabric : remindme |
@MatejNedic is working on native support. @MatejNedic do you have an ETA? |
@maciejwalkowiak I think it will be faster if we split issue for each integration. I have not started a work on S3 yet. Will do more work this week but can't say when it will be done. |
@MatejNedic thanks for your work here, even with native hints incorporated from your PR, In both scenarios there seems to be a problem with the endpoint resolution. ---- cut -- putobject) listbuckets) Caused by: java.lang.RuntimeException: no rules inside of tree rule matched—invalid rules (software.amazon.awssdk.services.s3.endpoints.internal.RuleEvaluator$1@592adda7) |
Hey @goafabric , I still have not finished S3 integration fully, tbh not sure when I will have time to fully go through it. This happens when you are using S3Template? All of the things that are not coming from Spring Cloud AWS, but rather from AWS Java SDK v2 should be opened to them on their GitHub. |
Hi @MatejNedic For me it's unclear if it is related to to AWS or Spring Cloud. Also from my experience, parties outside of Spring usually do not care much about GraalVM. So it would be nice if we find a solution .. as the bootstrap already passes .. i guess we are already near the finish line add: |
Hey @goafabric , interesting... Could you provide a simple sample of not working S3 native, I will try to see what hints can we add in Spring Cloud AWS to resolve it. Also, have you tried https://www.graalvm.org/latest/reference-manual/native-image/metadata/AutomaticMetadataCollection/#:~:text=GraalVM%20provides%20a%20Tracing%20Agent,on%20a%20regular%20Java%20VM. ? The problem is if it is AWS SDK it should be fixed on their side not ours since it can cause issues with compatibility in future releases. Spring Kafka has the same issue you can check their GitHub issues and will find that they don't add hints for kafka specifics. Edit: |
Upload |
Hey @MatejNedic Honestly i've spent a whole day figuring out what is going on, and vor the first time leveraging the tracing agent you mentioned. But to now avail .. except for knowing no a lot of S3 Sourcecode :) Debugging inside S3 reveals some funky resolution of the custom endpoint, with visitor pattern, expression evaluation and a lot of classes involved. But the thing is, everything is mostly just pure functional programming .. there is reflection involved later one, when executing the HTTP Call, but not up to that point. And sure you are right about future versions, but as long as 3rd party libs will not work with the reachability repository, i think this will always be a problem .. Maybe you will see something i havent, but i have currently no more clues. |
Hey @goafabric , Sorry for late reply are you by any chance using crt client? |
@MatejNedic thx 4 reaching out :) the only "workaround" is to use https instead of http .. so there seems to be some kind of funky url detection going on |
Do we have any update on the S3 Native Topic ? |
Please add a file to META-INF/native-image/io.awspring.cloud.core/resource-config.json in the package that contains the properties file. (https://github.com/awspring/spring-cloud-aws/blob/main/spring-cloud-aws-core/src/main/resources/io/awspring/cloud/core/SpringCloudClientConfiguration.properties) with the content: {
"resources": [
{
"pattern": "io/awspring/cloud/core/SpringCloudClientConfiguration.properties"
}
]
} So that we can add the following for the native-build:
See: https://www.graalvm.org/latest/reference-manual/native-image/dynamic-features/Resources/ Offtopic: S3 requires: "pattern": "io/awspring/cloud/s3/S3ObjectContentTypeResolver.properties" With those updates I was able to use the |
Hey @klopfdreh , |
Hey @MatejNedic, thanks a lot for the hint. Here are some related issues in AWS SDK V2: aws/aws-sdk-java-v2#5127 For native image those issues appear if you use the latest version of the SDK and need also to be fixed in order to use Spring Cloud AWS with S3 TransferManager or just for download resources from S3 with |
Type: Bug
Component: DynamodDB
Describe the bug
When I was trying to use
io.awspring.cloud:spring-cloud-aws-starter-dynamodb
starter with a Native Image for an AWS Lambda, application failed to startup due to a missing resource file in the classpath.Stacktrace:
As a solution would be to provide a resource-hint for GraalVM i.e.
The text was updated successfully, but these errors were encountered: