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

Test against GraalVM native image technology #1338

Merged
merged 8 commits into from
Mar 25, 2024

Conversation

stIncMale
Copy link
Member

@stIncMale stIncMale commented Mar 14, 2024

Added an example of a native application that uses the driver and is built using GraalVM.
The application runs the existing tour applications for the sync, legacy and reactive driver APIs.

The added application is built and run by Evergreen via the graalvm-native-image-app task with the the variant GraalVM native image app: 7.0 Replica Set NoAuth NoSSL JDK21 Linux.

Reviewers:

  • @vbabanin was picked by dbx-java, but I suspect he already has his plate full with CSOT, so I picked @katcharov instead.
  • Then I manually picked @jyemin because again, @rozza is probably too busy with CSOT.

Future work:

JAVA-3580

@stIncMale stIncMale self-assigned this Mar 14, 2024
@stIncMale stIncMale force-pushed the JAVA-3580 branch 2 times, most recently from aca8682 to 077fcd7 Compare March 14, 2024 08:23
@stIncMale stIncMale changed the title Test against GraalVM native-image Test against GraalVM native-image Mar 14, 2024
@stIncMale stIncMale force-pushed the JAVA-3580 branch 5 times, most recently from dac2478 to cf9acbe Compare March 20, 2024 02:08
./gradlew --version

echo "Building and running the GraalVM native image app"
./gradlew -PjavaVersion=${JAVA_VERSION} -Dorg.mongodb.test.uri=${MONGODB_URI} :graalvm-native-image-app:nativeRun
Copy link
Member Author

@stIncMale stIncMale Mar 20, 2024

Choose a reason for hiding this comment

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

Note how we only build and run the application, but do not collect reachability metadata - we use that from graalvm-native-image-app/src/main/resources/META-INF/native-image, which I collected on my computer (see graalvm-native-image-app/readme.md), and also manually added entries for shared libraries for OSes/ISAs different from mine. This means there is a chance we will be able to shovel this metadata in the right JARs and then build and run using only what we have in the JARs. I created JAVA-5381.

@@ -2286,3 +2299,10 @@ buildvariants:
tasks:
- name: testazurekms_task_group
batchtime: 20160 # Use a batchtime of 14 days as suggested by the CSFLE test README

- matrix_name: "graalvm-native-image-app"
matrix_spec: { version: [ "5.0", "7.0" ], topology: [ "replicaset" ], auth: [ "noauth" ], ssl: [ "nossl" ],
Copy link
Member Author

@stIncMale stIncMale Mar 20, 2024

Choose a reason for hiding this comment

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

We should probably test with "ssl" and "auth" in the future. I created JAVA-5382.

Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed, and let's also add a ticket for zstd and snappy compression testing

Copy link
Member Author

Choose a reason for hiding this comment

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

Created JAVA-5383.

@stIncMale stIncMale marked this pull request as ready for review March 20, 2024 03:38
@stIncMale stIncMale requested review from a team, vbabanin, jyemin and katcharov and removed request for a team and vbabanin March 20, 2024 03:38
@stIncMale stIncMale changed the title Test against GraalVM native-image Test against GraalVM native-image Mar 20, 2024
@stIncMale stIncMale changed the title Test against GraalVM native-image Test against GraalVM native image technology Mar 20, 2024
Added an example of a native application that uses the driver and is built using GraalVM.
The application runs the existing tour applications for the sync, legacy and reactive driver APIs.

JAVA-3580
Copy link
Contributor

@jyemin jyemin left a comment

Choose a reason for hiding this comment

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

Looks really good!

.evergreen/.evg.yml Outdated Show resolved Hide resolved
@@ -2286,3 +2299,10 @@ buildvariants:
tasks:
- name: testazurekms_task_group
batchtime: 20160 # Use a batchtime of 14 days as suggested by the CSFLE test README

- matrix_name: "graalvm-native-image-app"
matrix_spec: { version: [ "5.0", "7.0" ], topology: [ "replicaset" ], auth: [ "noauth" ], ssl: [ "nossl" ],
Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed, and let's also add a ticket for zstd and snappy compression testing

graalvm-native-image-app/build.gradle Show resolved Hide resolved
}

dependencies {
// we intentionally depend here on the driver artifacts instead of depending on compiled classes
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, this is cool. I'm glad that we're able to do this.

graalvm-native-image-app/build.gradle Show resolved Hide resolved
graalvm-native-image-app/build.gradle Show resolved Hide resolved
graalvm-native-image-app/build.gradle Show resolved Hide resolved
@stIncMale stIncMale requested a review from jyemin March 20, 2024 21:11
Copy link
Contributor

@jyemin jyemin left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

@katcharov katcharov left a comment

Choose a reason for hiding this comment

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

LGTM!

graalvm-native-image-app/readme.md Outdated Show resolved Hide resolved
@stIncMale stIncMale merged commit 82f4a9f into mongodb:master Mar 25, 2024
59 checks passed
@stIncMale stIncMale deleted the JAVA-3580 branch March 25, 2024 17:48
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

Successfully merging this pull request may close these issues.

3 participants