Skip to content
This repository was archived by the owner on Sep 26, 2023. It is now read-only.

ci: downsream test for GraalVM native image#1681

Merged
suztomo merged 10 commits intogoogleapis:mainfrom
suztomo:downstream_graalvm
May 16, 2022
Merged

ci: downsream test for GraalVM native image#1681
suztomo merged 10 commits intogoogleapis:mainfrom
suztomo:downstream_graalvm

Conversation

@suztomo
Copy link
Copy Markdown
Member

@suztomo suztomo commented May 13, 2022

Adding test for GraalVM feature behavior using java-orgpolicy repository. This java-orgpolicy repository has integration tests that do not require a GCP project.

@suztomo suztomo requested review from a team May 13, 2022 20:32
@suztomo suztomo self-assigned this May 13, 2022
@suztomo suztomo marked this pull request as draft May 13, 2022 20:32
@suztomo suztomo force-pushed the downstream_graalvm branch from 7bdbdc7 to 23e5585 Compare May 13, 2022 20:38
@suztomo
Copy link
Copy Markdown
Member Author

suztomo commented May 13, 2022

The failure in 22.1.0 reflects that the current configuration is not compatible with GraalVM 22.1.0.

Screenshot

Screen Shot 2022-05-13 at 5 22 18 PM

@mpeddada1
Copy link
Copy Markdown
Contributor

This is awesome! Thank you. Should we see if #1682 addresses the 22.1.0 issue?

@suztomo
Copy link
Copy Markdown
Member Author

suztomo commented May 13, 2022

When I excluded ProtobufMessageFeature in 88ce62d, it stopped appearing in the user-provided feature list:

[1/7] Initializing...                                                                                   (14.5s @ 0.45GB)
 Version info: 'GraalVM 22.0.0.2 Java 11 CE'
 5 user-provided feature(s)
  - com.google.api.gax.grpc.nativeimage.GrpcNettyFeature
  - com.google.api.gax.nativeimage.GoogleJsonClientFeature
  - com.google.api.gax.nativeimage.OpenCensusFeature
  - com.oracle.svm.thirdparty.gson.GsonFeature
  - org.graalvm.junit.platform.JUnitPlatformFeature

It's working.

@suztomo
Copy link
Copy Markdown
Member Author

suztomo commented May 13, 2022

With bad change to one of the Feature class (60b5f06 ), the check detected the problem correctly:

https://github.com/googleapis/gax-java/runs/6430136484?check_suite_focus=true

========================================================================================================================
GraalVM Native Image: Generating 'native-tests'...
========================================================================================================================
[1/7] Initializing...                                                                                   (15.0s @ 0.45GB)
 Version info: 'GraalVM 22.0.0.2 Java 11 CE'
 6 user-provided feature(s)
  - com.google.api.gax.grpc.nativeimage.GrpcNettyFeature
  - com.google.api.gax.grpc.nativeimage.ProtobufMessageFeature
  - com.google.api.gax.nativeimage.GoogleJsonClientFeature
  - com.google.api.gax.nativeimage.OpenCensusFeature
  - com.oracle.svm.thirdparty.gson.GsonFeature
  - org.graalvm.junit.platform.JUnitPlatformFeature

Fatal error: java.lang.RuntimeException: Bad exception during Native image compilation
	at com.google.api.gax.grpc.nativeimage.ProtobufMessageFeature.beforeAnalysis(ProtobufMessageFeature.java:75)
	at com.oracle.svm.hosted.NativeImageGenerator.lambda$runPointsToAnalysis$9(NativeImageGenerator.java:695)
	at com.oracle.svm.hosted.FeatureHandler.forEachFeature(FeatureHandler.java:74)
	at com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.j

@suztomo suztomo marked this pull request as ready for review May 13, 2022 22:52
Comment on lines -89 to +97
mvn verify install -B -V -ntp -fae \
-Dmaven.javadoc.skip=true \
-Dgcloud.download.skip=true \
-Denforcer.skip=true
echo "Modification on the shared dependencies BOM:"
git diff
echo

# This reads the JOB_TYPE environmental variable ("test" or "graalvm")
.kokoro/build.sh
Copy link
Copy Markdown
Member Author

@suztomo suztomo May 13, 2022

Choose a reason for hiding this comment

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

@Neenu1995 I think it's ok to replace the mvn verify install ... with .kokoro/build.sh (with JOB_TYPE: test). Do you see anything missed by this replacement?

With JOB_TYPE= test, build.sh runs:

mvn install -B -V -ntp \
    -DskipTests=true \
    -Dclirr.skip=true \
    -Denforcer.skip=true \
    -Dmaven.javadoc.skip=true \
    -Dgcloud.download.skip=true \
    -T 1C

and

mvn test -B -ntp -Dclirr.skip=true -Denforcer.skip=true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM.
I don't see any missing use cases.

fail-fast: false
matrix:
java: [8]
java: [11]
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Now we need JDK 11 to compile the GAX project.

@suztomo
Copy link
Copy Markdown
Member Author

suztomo commented May 14, 2022

@mpeddada1 Added 22.1.0 back to the build. Let's see the effect of your change.

@suztomo
Copy link
Copy Markdown
Member Author

suztomo commented May 14, 2022

The build with GraalVM 22.1.0 succeeded. (This only uses java-orgpolicy repository)

- run: sudo apt-get update -y
- run: sudo apt-get install libxml2-utils
- run: .kokoro/downstream-client-library-check.sh ${{matrix.repo}}
- run: .kokoro/downstream-client-library-check.sh ${{matrix.repo}} test
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Now downstream-client-library-check.sh takes 2nd argument, JOB_TYPE.

@suztomo
Copy link
Copy Markdown
Member Author

suztomo commented May 14, 2022

132 successful checks, including downstream checks and GraalVM 22.1.0 checks.

@suztomo suztomo added the owlbot:run Add this label to trigger the Owlbot post processor. label May 16, 2022
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label May 16, 2022
@sonarqubecloud
Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants