/google-cloud-graalvm-support

Primary LanguageJavaApache License 2.0Apache-2.0

Google Cloud GraalVM Support

experimental

This repository provides support for applications using the Google Java Client Libraries to be built as GraalVM Native Images.

Setup

Add the google-cloud-graalvm-support artifact to your project to take advantage of native image support.

For example, in Maven:

<dependency>
    <groupId>com.google.cloud</groupId>
    <artifactId>google-cloud-graalvm-support</artifactId>
    <version>0.3.0</version>
</dependency>

This dependency contains the GraalVM configurations to provide out-of-the-box support for native-image compilation of applications using Google Java Client Libraries.

Client Library Versions

To compile with GraalVM (native-image), ensure the client library version in your project is supported by google-cloud-graalvm-support.

GraalVM Support version *libraries-bom version grpc-netty-shaded version
0.3.0 11.0.0 or later 1.32.1 or later

Typically, you can just depend on the latest versions of the client libraries to get something working if you are not sure about what versions of (transitive) dependencies are being used by your project.

NOTE: Most users typically manage their client library versions using the Cloud Libraries Bill of Materials (libraries-bom). This is an easy way to ensure that the versions of all the client libraries in your project are compatible with each other and up-to-date. The libraries-bom also manages the version of grpc-netty-shaded as well and ensures that it is at the latest compatible version.

Supported Libraries

Most of the Java Google Client Libraries are supported for GraalVM compilation using this dependency. If you find an unsupported library, please make a feature request via our Github Issue Tracker.

GraalVM-compatible sample code using various Google Cloud libraries can be found below:

Google Cloud Service Library Sample Link
Cloud BigQuery bigquery-sample
Cloud BigTable bigtable-sample
Cloud Datastore datastore-sample
Cloud Firestore firestore-sample
Cloud Logging logging-sample
Cloud Pub/Sub pubsub-sample
Cloud Spanner spanner-sample
Cloud Storage storage-sample

Additional API compatibility is in active development.

Please also consult the project samples applications directory for the full range of code samples.

Additional Frameworks

Our project google-cloud-graalvm-support targets compatibility for native image frameworks as well, such as for Quarkus, Micronaut, and Spring. We are in the early stages of research for these frameworks and maintain some code samples.

We are also interested in collaborating with other open source projects to improve framework-level compatibility.

Related projects:

Please let us know if you are interested in collaborating by contacting us via our Issue Tracker.

Questions

Please report any issues and questions to our Github Issue Tracker.