-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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 GraalVM Reachability Metadata and corresponding nativeTest for Seata integration #30138
Conversation
ca9a874
to
c6f3f4c
Compare
1022fcd
to
1ea2fc0
Compare
Seata 1.x supports native image from version 1.7.0, refer to the merged PR apache/incubator-seata#5476 (comment). Currently, 2.x does not support native image, and this function of 1.x will be translated in the future. For native image integration, I recommend using 1.8.0, the latest version of 1.x.
The client-side uses the Seata SDK, which can depend on Seata in two ways:
Furthermore, the priority of Seata client configuration is ENV (System.getenv()) > -D (System.getProperty()) > file or configuration center. You can consider injecting environment variables in testContainer. |
cb0aa9c
to
c8ad2fe
Compare
705cd2d
to
7d9af1d
Compare
Is this the problem you're having? raphw/byte-buddy#1588 |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Even if the free local port is dynamically found through Java API code,
file.conf
still needs to be dynamically created after passing it to the Java API of testcontainers-java, which seems to break some of the conventions of GraalVM Native Image to a certain extent. - I'm worried about encountering insufficient Unix permissions like io.etcd.jetcd.launcher.EtcdContainer -- Error deleting directory when using jetcd-tests on unit-testing. etcd-io/jetcd#1310 . testcontainers-java always expects to use operating system-specific FileSystem like
sun.nio.fs.UnixFileSystem
/file:/resources/{entry}
, but in fact we can only usecom.oracle.svm.core.jdk.resources.NativeImageResourceFileSystem
/resource:file:/resources/{entry}
in NativeTest . - I don't think this is where
application.yml
should be introduced, although we can use a separate Spring Boot bootstrap class in a separate class. - This is mainly because this requires the introduction of
org.springframework.boot:spring-boot-maven-plugin
to use the Maven Goal ofprocess-test-aot
, which I think complicates things to a certain extent, because it seems best to have a module likeshardingsphere-test-native-spring-boot-starter
to additionally define a Maven Profile for writing nativeTest. - As a temporary measure, this unit test uses the hard-defined port
39567
and is restricted to running under Native Image only because it involves the creation of the Docker Imagetestcontainers/ryuk
. Let me explore later what APIs are available on the Seata side that can be extended.
For #29052.
Changes proposed in this pull request:
io.seata:seata-all:1.8.0
and make corresponding adjustments in nativeTests. Before Add GraalVM Reachability Metadata and corresponding nativeTest for Seata integration #30138 (comment) , using Seata Client under GraalVM Native Image requires using the version released under its 1.x branch. Usingio.seata:seata-all:2.0.0
under nativeTest needs to wait for the ByteBuddy Java API to be removed on the seata side.org.testcontainers:mysql
will report an error asmysqld failed while attempting to check config
in GraalVM Native Image testcontainers/testcontainers-java#7954 has not been closed yet, to simplify understanding, let us temporarily switch the database used by Seata-integrated nativeTest from MySQL to Postgresql.file.conf
has no dynamically defined Java API, which prevents the integration of testcontainers. We may have to hardcode the port on the host when creating the testcontainers-java container.io.seata:seata-all:2.0.0
, involving an undocumented bug in the Tracing Agent of GraalVM CE 23.1.2 For JDK 21.0.2, reported below whenconfiguration->agent->options->enableExperimentalPredefinedClasses
of GraalVM Native Build Tools is set totrue
. This is not caused by insufficient memory, but more like a design issue of GraalVM CE. Refer to [GR-52650] Whenexperimental-class-define-support=true
'sbuildArg
is passed to GraalVM Tracing Agent, incorrect Conditional Metadata is generated oracle/graal#8396 .Before committing this PR, I'm sure that I have checked the following options:
./mvnw clean install -B -T1C -Dmaven.javadoc.skip -Dmaven.jacoco.skip -e
.