Skip to content

Commit 6fd5096

Browse files
authored
GraalVM support for Azure SDK (Azure#25786)
* Add GraalVM support for Azure SDKs
1 parent f87104f commit 6fd5096

File tree

57 files changed

+4130
-72
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+4130
-72
lines changed

eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,19 @@
8383
<suppress checks="com.azure.tools.checkstyle.checks.EnforceFinalFieldsCheck"
8484
files="Receipt.java"/>
8585

86+
<!-- To allow using sysout in GraalVM classes as the output is printed out during the build -->
87+
<suppress checks="com.azure.tools.checkstyle.checks.GoodLoggingCheck"
88+
files="com.azure.aot.graalvm.support.implementation.GraalVMFeature.java"/>
89+
90+
<!-- To allow using sysout in GraalVM classes as the output is printed out during the build -->
91+
<suppress checks="com.azure.tools.checkstyle.checks.ThrowFromClientLoggerCheck"
92+
files="com.azure.aot.graalvm.support.netty.implementation.features.*\.java"/>
93+
94+
<!-- The class is copied from Quarkus and uses the relevant copyright text.
95+
Also, this class contains a number of fields that are annotated to be updated in native image. So, these exceptions are needed -->
96+
<suppress checks="StaticVariableName|VisibilityModifier|TypeName|Header"
97+
files="com.azure.aot.graalvm.support.netty.implementation.features.*\.java"/>
98+
8699
<!-- Suppress LineLength for i18n message properties -->
87100
<suppress checks="LineLength" files="messages.properties"/>
88101

eng/code-quality-reports/src/main/resources/spotbugs/spotbugs-exclude.xml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2542,4 +2542,27 @@
25422542
</Or>
25432543
<Bug pattern="URF_UNREAD_FIELD"/>
25442544
</Match>
2545+
2546+
2547+
<Match>
2548+
<Or>
2549+
<Class name="com.azure.aot.graalvm.support.netty.implementation.features.TargetIoNettyHandlerSslJdkAlpnApplicationProtocolNegotiatorAlpnWrapper"/>
2550+
<Class name="com.azure.aot.graalvm.support.netty.implementation.features.TargetIoNettyHandlerSslJdkAlpnApplicationProtocolNegotiatorAlpnWrapperJava8"/>
2551+
<Class name="com.azure.aot.graalvm.support.netty.implementation.features.TargetIoNettyHandlerSslJdkSslContext"/>
2552+
<Class name="com.azure.aot.graalvm.support.netty.implementation.features.TargetIoNettyHandlerSslSslContext"/>
2553+
</Or>
2554+
<Bug pattern="BC_IMPOSSIBLE_CAST"/>
2555+
</Match>
2556+
<Match>
2557+
<Or>
2558+
<Class name="com.azure.aot.graalvm.support.netty.implementation.features.TargetIoNettyHandlerCodecHttpHttpContentDecompressor"/>
2559+
</Or>
2560+
<Bug pattern="CI_CONFUSED_INHERITANCE"/>
2561+
</Match>
2562+
<Match>
2563+
<Or>
2564+
<Class name="com.azure.aot.graalvm.support.netty.implementation.features.TargetIoNettyHandlerSslOpenSsl"/>
2565+
</Or>
2566+
<Bug pattern="URF_UNREAD_FIELD"/>
2567+
</Match>
25452568
</FindBugsFilter>

eng/pipelines/templates/variables/globals.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ variables:
1111
# 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.
1212
WagonOptions: '-Dmaven.wagon.httpconnectionManager.ttlSeconds=60'
1313
DefaultOptions: '-Dmaven.repo.local=$(MAVEN_CACHE_FOLDER) --batch-mode --fail-at-end --settings eng/settings.xml $(WagonOptions)'
14-
LoggingOptions: '-Dorg.slf4j.simpleLogger.defaultLogLevel=error -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn'
14+
LoggingOptions: '-Dorg.slf4j.simpleLogger.defaultLogLevel=info -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn'
1515
MemoryOptions: '-Xmx3072m'
1616
DefaultTestOptions: '$(DefaultOptions) -Dgpg.skip -Dmaven.javadoc.skip=true -Dcodesnippet.skip=true -Dspotbugs.skip=true -Dcheckstyle.skip=true -Drevapi.skip=true -DtrimStackTrace=false -pl $(ProjectList)'
1717
DefaultTestMavenOptions: '$(MemoryOptions) $(LoggingOptions)'

eng/versioning/external_dependencies.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ org.glassfish.tyrus.bundles:tyrus-standalone-client;1.16
9292
org.hibernate.validator:hibernate-validator;6.2.0.Final
9393
org.javatuples:javatuples;1.2
9494
org.linguafranca.pwdb:KeePassJava2;2.1.4
95+
org.graalvm.buildtools:junit-platform-native;0.9.8
96+
org.graalvm.buildtools:native-maven-plugin;0.9.8
97+
org.graalvm.sdk:graal-sdk;21.3.0
98+
org.graalvm.nativeimage:svm;21.3.0
9599
org.powermock:powermock-api-mockito2;2.0.9
96100
org.powermock:powermock-module-junit4;2.0.9
97101
org.postgresql:postgresql;42.3.1

eng/versioning/version_client.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ com.azure:azure-analytics-synapse-artifacts;1.0.0-beta.6;1.0.0-beta.7
5252
com.azure:azure-analytics-synapse-spark;1.0.0-beta.5;1.0.0-beta.6
5353
com.azure:azure-analytics-synapse-managedprivateendpoints;1.0.0-beta.5;1.0.0-beta.6
5454
com.azure:azure-analytics-synapse-monitoring;1.0.0-beta.3;1.0.0-beta.4
55+
com.azure:azure-aot-graalvm-support;1.0.0-beta.1;1.0.0-beta.1
56+
com.azure:azure-aot-graalvm-support-netty;1.0.0-beta.1;1.0.0-beta.1
5557
com.azure:azure-communication-chat;1.1.2;1.2.0-beta.1
5658
com.azure:azure-communication-callingserver;1.0.0-beta.3;1.0.0-beta.4
5759
com.azure:azure-communication-common;1.0.6;1.1.0-beta.1
@@ -334,6 +336,9 @@ com.azure.tools:azure-sdk-archetype;1.0.0;1.0.0
334336
# In the pom, the version update tag after the version should name the unreleased package and the dependency version:
335337
# <!-- {x-version-update;unreleased_com.azure:azure-core;dependency} -->
336338

339+
unreleased_com.azure:azure-core;1.24.0-beta.1
340+
unreleased_com.azure:azure-core-http-netty;1.12.0-beta.1
341+
337342
# Released Beta dependencies: Copy the entry from above, prepend "beta_", remove the current
338343
# version and set the version to the released beta. Released beta dependencies are only valid
339344
# for dependency versions. These entries are specifically for when we've released a beta for

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -715,6 +715,7 @@
715715
<module>sdk/advisor</module>
716716
<module>sdk/agrifood</module>
717717
<module>sdk/anomalydetector</module>
718+
<module>sdk/aot</module>
718719
<module>sdk/apimanagement</module>
719720
<module>sdk/appconfiguration</module>
720721
<module>sdk/applicationinsights</module>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Release History
2+
3+
## 1.0.0-beta.1 (Unreleased)
4+
Version 1.0.0-beta.1 is a preview of our efforts in creating a client library for Azure GraalVM Netty Support that is
5+
developer-friendly, idiomatic to the Java ecosystem, and as consistent across different languages and platforms as
6+
possible. The principles that guide our efforts can be found in the
7+
[Azure SDK Design Guidelines for Java](https://azure.github.io/azure-sdk/java_introduction.html).
8+
9+
## Features Added
10+
- Initial release. Please see the README and wiki for information on using the new library.
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Azure GraalVM Netty Support client library for Java
2+
3+
## Getting started
4+
5+
### Prerequisites
6+
- A [Java Development Kit (JDK)][jdk_link], version 8 or later.
7+
- [Azure Subscription][azure_subscription]
8+
9+
### Include the package
10+
11+
[//]: # ({x-version-update-start;com.azure:azure-aot-graalvm-support-netty;current})
12+
```xml
13+
<dependency>
14+
<groupId>com.azure</groupId>
15+
<artifactId>azure-aot-graalvm-support-netty</artifactId>
16+
<version>1.0.0-beta.1</version>
17+
</dependency>
18+
```
19+
## Key concepts
20+
21+
## Examples
22+
23+
## Troubleshooting
24+
25+
## Next steps
26+
27+
## Contributing
28+
29+
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License
30+
Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution.
31+
For details, visit [https://cla.microsoft.com](https://cla.microsoft.com).
32+
33+
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the
34+
PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this
35+
once across all repos using our CLA.
36+
37+
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
38+
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact
39+
[opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
40+
41+
<!-- LINKS -->
42+
[cla]: https://cla.microsoft.com
43+
[coc]: https://opensource.microsoft.com/codeofconduct/
44+
[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/
45+
[coc_contact]: mailto:opencode@microsoft.com
46+
[jdk_link]: https://docs.microsoft.com/java/azure/jdk/?view=azure-java-stable
47+
[azure_subscription]: https://azure.microsoft.com/free
48+
49+
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Faot%2Fazure-aot-graalvm-support-netty%2FREADME.png)
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
<!-- Copyright (c) Microsoft Corporation. All rights reserved.
2+
Licensed under the MIT License. -->
3+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
6+
<modelVersion>4.0.0</modelVersion>
7+
8+
<groupId>com.azure</groupId>
9+
<artifactId>azure-aot-graalvm-support-netty</artifactId>
10+
<version>1.0.0-beta.1</version> <!-- {x-version-update;com.azure:azure-aot-graalvm-support-netty;current} -->
11+
12+
<packaging>jar</packaging>
13+
<name>Microsoft Azure SDK for GraalVM Netty support</name>
14+
<description>This package contains Microsoft Azure GraalVM Netty Support SDK.</description>
15+
<parent>
16+
<groupId>com.azure</groupId>
17+
<artifactId>azure-client-sdk-parent</artifactId>
18+
<version>1.7.0</version> <!-- {x-version-update;com.azure:azure-client-sdk-parent;current} -->
19+
<relativePath>../../parents/azure-client-sdk-parent</relativePath>
20+
</parent>
21+
<url>https://github.com/Azure/azure-sdk-for-java</url>
22+
23+
<licenses>
24+
<license>
25+
<name>The MIT License (MIT)</name>
26+
<url>http://opensource.org/licenses/MIT</url>
27+
<distribution>repo</distribution>
28+
</license>
29+
</licenses>
30+
31+
<distributionManagement>
32+
<site>
33+
<id>azure-java-build-docs</id>
34+
<url>${site.url}/site/${project.artifactId}</url>
35+
</site>
36+
</distributionManagement>
37+
38+
<scm>
39+
<url>scm:git:https://github.com/Azure/azure-sdk-for-java</url>
40+
<connection>scm:git:git@github.com:Azure/azure-sdk-for-java.git</connection>
41+
<tag>HEAD</tag>
42+
</scm>
43+
44+
<properties>
45+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
46+
<legal>
47+
<![CDATA[[INFO] Any downloads listed may be third party software. Microsoft grants you no rights for third party software.]]></legal>
48+
</properties>
49+
50+
<developers>
51+
<developer>
52+
<id>microsoft</id>
53+
<name>Microsoft</name>
54+
</developer>
55+
</developers>
56+
57+
<dependencies>
58+
<dependency>
59+
<groupId>com.azure</groupId>
60+
<artifactId>azure-aot-graalvm-support</artifactId>
61+
<version>1.0.0-beta.1</version> <!-- {x-version-update;com.azure:azure-aot-graalvm-support;dependency} -->
62+
</dependency>
63+
<dependency>
64+
<groupId>io.netty</groupId>
65+
<artifactId>netty-handler</artifactId>
66+
<version>4.1.70.Final</version> <!-- {x-version-update;io.netty:netty-handler;external_dependency} -->
67+
</dependency>
68+
<dependency>
69+
<groupId>io.netty</groupId>
70+
<artifactId>netty-handler-proxy</artifactId>
71+
<version>4.1.70.Final</version> <!-- {x-version-update;io.netty:netty-handler-proxy;external_dependency} -->
72+
</dependency>
73+
<dependency>
74+
<groupId>io.netty</groupId>
75+
<artifactId>netty-buffer</artifactId>
76+
<version>4.1.70.Final</version> <!-- {x-version-update;io.netty:netty-buffer;external_dependency} -->
77+
</dependency>
78+
<dependency>
79+
<groupId>io.netty</groupId>
80+
<artifactId>netty-codec-http</artifactId>
81+
<version>4.1.70.Final</version> <!-- {x-version-update;io.netty:netty-codec-http;external_dependency} -->
82+
</dependency>
83+
84+
<dependency>
85+
<groupId>io.netty</groupId>
86+
<artifactId>netty-codec-http2</artifactId>
87+
<version>4.1.70.Final</version> <!-- {x-version-update;io.netty:netty-codec-http2;external_dependency} -->
88+
</dependency>
89+
<dependency>
90+
<groupId>io.netty</groupId>
91+
<artifactId>netty-transport-native-unix-common</artifactId>
92+
<version>4.1.70.Final</version> <!-- {x-version-update;io.netty:netty-transport-native-unix-common;external_dependency} -->
93+
</dependency>
94+
<dependency>
95+
<groupId>io.netty</groupId>
96+
<artifactId>netty-transport-native-epoll</artifactId>
97+
<version>4.1.70.Final</version> <!-- {x-version-update;io.netty:netty-transport-native-epoll;external_dependency} -->
98+
<classifier>linux-x86_64</classifier>
99+
</dependency>
100+
<dependency>
101+
<groupId>io.netty</groupId>
102+
<artifactId>netty-transport-native-kqueue</artifactId>
103+
<version>4.1.70.Final</version> <!-- {x-version-update;io.netty:netty-transport-native-kqueue;external_dependency} -->
104+
<classifier>osx-x86_64</classifier>
105+
</dependency>
106+
</dependencies>
107+
108+
<build>
109+
<plugins>
110+
<plugin>
111+
<groupId>org.apache.maven.plugins</groupId>
112+
<artifactId>maven-enforcer-plugin</artifactId>
113+
<version>3.0.0-M3</version> <!-- {x-version-update;org.apache.maven.plugins:maven-enforcer-plugin;external_dependency} -->
114+
<configuration>
115+
<rules>
116+
<bannedDependencies>
117+
<includes>
118+
<include>io.netty:netty-buffer:[4.1.70.Final]</include> <!-- {x-include-update;io.netty:netty-buffer;external_dependency} -->
119+
<include>io.netty:netty-codec-http:[4.1.70.Final]</include> <!-- {x-include-update;io.netty:netty-codec-http;external_dependency} -->
120+
<include>io.netty:netty-codec-http2:[4.1.70.Final]</include> <!-- {x-include-update;io.netty:netty-codec-http2;external_dependency} -->
121+
<include>io.netty:netty-handler:[4.1.70.Final]</include> <!-- {x-include-update;io.netty:netty-handler;external_dependency} -->
122+
<include>io.netty:netty-handler-proxy:[4.1.70.Final]</include> <!-- {x-include-update;io.netty:netty-handler-proxy;external_dependency} -->
123+
<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} -->
124+
<include>io.netty:netty-transport-native-epoll:[4.1.70.Final]</include> <!-- {x-include-update;io.netty:netty-transport-native-epoll;external_dependency} -->
125+
<include>io.netty:netty-transport-native-kqueue:[4.1.70.Final]</include> <!-- {x-include-update;io.netty:netty-transport-native-kqueue;external_dependency} -->
126+
</includes>
127+
</bannedDependencies>
128+
</rules>
129+
</configuration>
130+
</plugin>
131+
</plugins>
132+
</build>
133+
</project>

0 commit comments

Comments
 (0)