Skip to content

Commit

Permalink
GraalVM support for Azure SDK (Azure#25786)
Browse files Browse the repository at this point in the history
* Add GraalVM support for Azure SDKs
  • Loading branch information
srnagar authored Dec 13, 2021
1 parent f87104f commit 6fd5096
Show file tree
Hide file tree
Showing 57 changed files with 4,130 additions and 72 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,19 @@
<suppress checks="com.azure.tools.checkstyle.checks.EnforceFinalFieldsCheck"
files="Receipt.java"/>

<!-- To allow using sysout in GraalVM classes as the output is printed out during the build -->
<suppress checks="com.azure.tools.checkstyle.checks.GoodLoggingCheck"
files="com.azure.aot.graalvm.support.implementation.GraalVMFeature.java"/>

<!-- To allow using sysout in GraalVM classes as the output is printed out during the build -->
<suppress checks="com.azure.tools.checkstyle.checks.ThrowFromClientLoggerCheck"
files="com.azure.aot.graalvm.support.netty.implementation.features.*\.java"/>

<!-- The class is copied from Quarkus and uses the relevant copyright text.
Also, this class contains a number of fields that are annotated to be updated in native image. So, these exceptions are needed -->
<suppress checks="StaticVariableName|VisibilityModifier|TypeName|Header"
files="com.azure.aot.graalvm.support.netty.implementation.features.*\.java"/>

<!-- Suppress LineLength for i18n message properties -->
<suppress checks="LineLength" files="messages.properties"/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2542,4 +2542,27 @@
</Or>
<Bug pattern="URF_UNREAD_FIELD"/>
</Match>


<Match>
<Or>
<Class name="com.azure.aot.graalvm.support.netty.implementation.features.TargetIoNettyHandlerSslJdkAlpnApplicationProtocolNegotiatorAlpnWrapper"/>
<Class name="com.azure.aot.graalvm.support.netty.implementation.features.TargetIoNettyHandlerSslJdkAlpnApplicationProtocolNegotiatorAlpnWrapperJava8"/>
<Class name="com.azure.aot.graalvm.support.netty.implementation.features.TargetIoNettyHandlerSslJdkSslContext"/>
<Class name="com.azure.aot.graalvm.support.netty.implementation.features.TargetIoNettyHandlerSslSslContext"/>
</Or>
<Bug pattern="BC_IMPOSSIBLE_CAST"/>
</Match>
<Match>
<Or>
<Class name="com.azure.aot.graalvm.support.netty.implementation.features.TargetIoNettyHandlerCodecHttpHttpContentDecompressor"/>
</Or>
<Bug pattern="CI_CONFUSED_INHERITANCE"/>
</Match>
<Match>
<Or>
<Class name="com.azure.aot.graalvm.support.netty.implementation.features.TargetIoNettyHandlerSslOpenSsl"/>
</Or>
<Bug pattern="URF_UNREAD_FIELD"/>
</Match>
</FindBugsFilter>
2 changes: 1 addition & 1 deletion eng/pipelines/templates/variables/globals.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ variables:
# If reports about Maven dependency downloads become more common investigate re-introducing "-Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false", or other iterations of the configurations.
WagonOptions: '-Dmaven.wagon.httpconnectionManager.ttlSeconds=60'
DefaultOptions: '-Dmaven.repo.local=$(MAVEN_CACHE_FOLDER) --batch-mode --fail-at-end --settings eng/settings.xml $(WagonOptions)'
LoggingOptions: '-Dorg.slf4j.simpleLogger.defaultLogLevel=error -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn'
LoggingOptions: '-Dorg.slf4j.simpleLogger.defaultLogLevel=info -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn'
MemoryOptions: '-Xmx3072m'
DefaultTestOptions: '$(DefaultOptions) -Dgpg.skip -Dmaven.javadoc.skip=true -Dcodesnippet.skip=true -Dspotbugs.skip=true -Dcheckstyle.skip=true -Drevapi.skip=true -DtrimStackTrace=false -pl $(ProjectList)'
DefaultTestMavenOptions: '$(MemoryOptions) $(LoggingOptions)'
Expand Down
4 changes: 4 additions & 0 deletions eng/versioning/external_dependencies.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ org.glassfish.tyrus.bundles:tyrus-standalone-client;1.16
org.hibernate.validator:hibernate-validator;6.2.0.Final
org.javatuples:javatuples;1.2
org.linguafranca.pwdb:KeePassJava2;2.1.4
org.graalvm.buildtools:junit-platform-native;0.9.8
org.graalvm.buildtools:native-maven-plugin;0.9.8
org.graalvm.sdk:graal-sdk;21.3.0
org.graalvm.nativeimage:svm;21.3.0
org.powermock:powermock-api-mockito2;2.0.9
org.powermock:powermock-module-junit4;2.0.9
org.postgresql:postgresql;42.3.1
Expand Down
5 changes: 5 additions & 0 deletions eng/versioning/version_client.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ com.azure:azure-analytics-synapse-artifacts;1.0.0-beta.6;1.0.0-beta.7
com.azure:azure-analytics-synapse-spark;1.0.0-beta.5;1.0.0-beta.6
com.azure:azure-analytics-synapse-managedprivateendpoints;1.0.0-beta.5;1.0.0-beta.6
com.azure:azure-analytics-synapse-monitoring;1.0.0-beta.3;1.0.0-beta.4
com.azure:azure-aot-graalvm-support;1.0.0-beta.1;1.0.0-beta.1
com.azure:azure-aot-graalvm-support-netty;1.0.0-beta.1;1.0.0-beta.1
com.azure:azure-communication-chat;1.1.2;1.2.0-beta.1
com.azure:azure-communication-callingserver;1.0.0-beta.3;1.0.0-beta.4
com.azure:azure-communication-common;1.0.6;1.1.0-beta.1
Expand Down Expand Up @@ -334,6 +336,9 @@ com.azure.tools:azure-sdk-archetype;1.0.0;1.0.0
# In the pom, the version update tag after the version should name the unreleased package and the dependency version:
# <!-- {x-version-update;unreleased_com.azure:azure-core;dependency} -->

unreleased_com.azure:azure-core;1.24.0-beta.1
unreleased_com.azure:azure-core-http-netty;1.12.0-beta.1

# Released Beta dependencies: Copy the entry from above, prepend "beta_", remove the current
# version and set the version to the released beta. Released beta dependencies are only valid
# for dependency versions. These entries are specifically for when we've released a beta for
Expand Down
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,7 @@
<module>sdk/advisor</module>
<module>sdk/agrifood</module>
<module>sdk/anomalydetector</module>
<module>sdk/aot</module>
<module>sdk/apimanagement</module>
<module>sdk/appconfiguration</module>
<module>sdk/applicationinsights</module>
Expand Down
10 changes: 10 additions & 0 deletions sdk/aot/azure-aot-graalvm-support-netty/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Release History

## 1.0.0-beta.1 (Unreleased)
Version 1.0.0-beta.1 is a preview of our efforts in creating a client library for Azure GraalVM Netty Support that is
developer-friendly, idiomatic to the Java ecosystem, and as consistent across different languages and platforms as
possible. The principles that guide our efforts can be found in the
[Azure SDK Design Guidelines for Java](https://azure.github.io/azure-sdk/java_introduction.html).

## Features Added
- Initial release. Please see the README and wiki for information on using the new library.
49 changes: 49 additions & 0 deletions sdk/aot/azure-aot-graalvm-support-netty/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Azure GraalVM Netty Support client library for Java

## Getting started

### Prerequisites
- A [Java Development Kit (JDK)][jdk_link], version 8 or later.
- [Azure Subscription][azure_subscription]

### Include the package

[//]: # ({x-version-update-start;com.azure:azure-aot-graalvm-support-netty;current})
```xml
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-aot-graalvm-support-netty</artifactId>
<version>1.0.0-beta.1</version>
</dependency>
```
## Key concepts

## Examples

## Troubleshooting

## Next steps

## Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License
Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution.
For details, visit [https://cla.microsoft.com](https://cla.microsoft.com).

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the
PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this
once across all repos using our CLA.

This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact
[[email protected]](mailto:[email protected]) with any additional questions or comments.

<!-- LINKS -->
[cla]: https://cla.microsoft.com
[coc]: https://opensource.microsoft.com/codeofconduct/
[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/
[coc_contact]: mailto:[email protected]
[jdk_link]: https://docs.microsoft.com/java/azure/jdk/?view=azure-java-stable
[azure_subscription]: https://azure.microsoft.com/free

![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Faot%2Fazure-aot-graalvm-support-netty%2FREADME.png)
133 changes: 133 additions & 0 deletions sdk/aot/azure-aot-graalvm-support-netty/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
<!-- Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License. -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>

<groupId>com.azure</groupId>
<artifactId>azure-aot-graalvm-support-netty</artifactId>
<version>1.0.0-beta.1</version> <!-- {x-version-update;com.azure:azure-aot-graalvm-support-netty;current} -->

<packaging>jar</packaging>
<name>Microsoft Azure SDK for GraalVM Netty support</name>
<description>This package contains Microsoft Azure GraalVM Netty Support SDK.</description>
<parent>
<groupId>com.azure</groupId>
<artifactId>azure-client-sdk-parent</artifactId>
<version>1.7.0</version> <!-- {x-version-update;com.azure:azure-client-sdk-parent;current} -->
<relativePath>../../parents/azure-client-sdk-parent</relativePath>
</parent>
<url>https://github.com/Azure/azure-sdk-for-java</url>

<licenses>
<license>
<name>The MIT License (MIT)</name>
<url>http://opensource.org/licenses/MIT</url>
<distribution>repo</distribution>
</license>
</licenses>

<distributionManagement>
<site>
<id>azure-java-build-docs</id>
<url>${site.url}/site/${project.artifactId}</url>
</site>
</distributionManagement>

<scm>
<url>scm:git:https://github.com/Azure/azure-sdk-for-java</url>
<connection>scm:git:[email protected]:Azure/azure-sdk-for-java.git</connection>
<tag>HEAD</tag>
</scm>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<legal>
<![CDATA[[INFO] Any downloads listed may be third party software. Microsoft grants you no rights for third party software.]]></legal>
</properties>

<developers>
<developer>
<id>microsoft</id>
<name>Microsoft</name>
</developer>
</developers>

<dependencies>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-aot-graalvm-support</artifactId>
<version>1.0.0-beta.1</version> <!-- {x-version-update;com.azure:azure-aot-graalvm-support;dependency} -->
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-handler</artifactId>
<version>4.1.70.Final</version> <!-- {x-version-update;io.netty:netty-handler;external_dependency} -->
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-handler-proxy</artifactId>
<version>4.1.70.Final</version> <!-- {x-version-update;io.netty:netty-handler-proxy;external_dependency} -->
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-buffer</artifactId>
<version>4.1.70.Final</version> <!-- {x-version-update;io.netty:netty-buffer;external_dependency} -->
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-codec-http</artifactId>
<version>4.1.70.Final</version> <!-- {x-version-update;io.netty:netty-codec-http;external_dependency} -->
</dependency>

<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-codec-http2</artifactId>
<version>4.1.70.Final</version> <!-- {x-version-update;io.netty:netty-codec-http2;external_dependency} -->
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport-native-unix-common</artifactId>
<version>4.1.70.Final</version> <!-- {x-version-update;io.netty:netty-transport-native-unix-common;external_dependency} -->
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport-native-epoll</artifactId>
<version>4.1.70.Final</version> <!-- {x-version-update;io.netty:netty-transport-native-epoll;external_dependency} -->
<classifier>linux-x86_64</classifier>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport-native-kqueue</artifactId>
<version>4.1.70.Final</version> <!-- {x-version-update;io.netty:netty-transport-native-kqueue;external_dependency} -->
<classifier>osx-x86_64</classifier>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0-M3</version> <!-- {x-version-update;org.apache.maven.plugins:maven-enforcer-plugin;external_dependency} -->
<configuration>
<rules>
<bannedDependencies>
<includes>
<include>io.netty:netty-buffer:[4.1.70.Final]</include> <!-- {x-include-update;io.netty:netty-buffer;external_dependency} -->
<include>io.netty:netty-codec-http:[4.1.70.Final]</include> <!-- {x-include-update;io.netty:netty-codec-http;external_dependency} -->
<include>io.netty:netty-codec-http2:[4.1.70.Final]</include> <!-- {x-include-update;io.netty:netty-codec-http2;external_dependency} -->
<include>io.netty:netty-handler:[4.1.70.Final]</include> <!-- {x-include-update;io.netty:netty-handler;external_dependency} -->
<include>io.netty:netty-handler-proxy:[4.1.70.Final]</include> <!-- {x-include-update;io.netty:netty-handler-proxy;external_dependency} -->
<include>io.netty:netty-transport-native-unix-common:[4.1.70.Final]</include> <!-- {x-include-update;io.netty:netty-transport-native-unix-common;external_dependency} -->
<include>io.netty:netty-transport-native-epoll:[4.1.70.Final]</include> <!-- {x-include-update;io.netty:netty-transport-native-epoll;external_dependency} -->
<include>io.netty:netty-transport-native-kqueue:[4.1.70.Final]</include> <!-- {x-include-update;io.netty:netty-transport-native-kqueue;external_dependency} -->
</includes>
</bannedDependencies>
</rules>
</configuration>
</plugin>
</plugins>
</build>
</project>
Loading

0 comments on commit 6fd5096

Please sign in to comment.