PageRenderTime 28ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/sdk/aot/azure-aot-graalvm-support/README.md

http://github.com/WindowsAzure/azure-sdk-for-java
Markdown | 132 lines | 96 code | 36 blank | 0 comment | 0 complexity | bd0ff484be93cb2729c5f3cfd9711056 MD5 | raw file
Possible License(s): MIT
  1. # Azure GraalVM Support client library for Java
  2. The Azure GraalVM Support client library provides support for applications using [Azure client libraries](https://azure.github.io/azure-sdk/releases/latest/java.html) to be built as [GraalVM native
  3. images](https://www.graalvm.org/22.0/reference-manual/native-image/). The library contains all the necessary
  4. [configuration files](https://www.graalvm.org/22.0/reference-manual/native-image/BuildConfiguration/) and [GraalVM
  5. features](https://www.graalvm.org/sdk/javadoc/index.html?org/graalvm/nativeimage/hosted/Feature.html) required to build
  6. a native image of an application that uses Azure client libraries.
  7. **NOTE:**: This library is a preview and is intended to enable applications using Azure client libraries to quickly
  8. build and validate native images. However, this is not a stable, GA version and is not officially supported to use in production
  9. environments.
  10. ## Getting started
  11. ### Prerequisites
  12. - A [Java Development Kit (JDK)][jdk_link], version 8 or later.
  13. - [Azure Subscription][azure_subscription]
  14. - [GraalVM](https://www.graalvm.org/downloads/) version 22 or later.
  15. - [GraalVM Native Image](https://www.graalvm.org/22.0/reference-manual/native-image/)
  16. For more details, please refer to [Getting started with GraalVM](https://www.graalvm.org/22.0/docs/getting-started/)
  17. documentation.
  18. ### Include the package
  19. [//]: # ({x-version-update-start;com.azure:azure-aot-graalvm-support;current})
  20. ```xml
  21. <dependency>
  22. <groupId>com.azure</groupId>
  23. <artifactId>azure-aot-graalvm-support</artifactId>
  24. <version>1.0.0-beta.3</version>
  25. </dependency>
  26. ```
  27. Also, include the `azure-aot-graalvm-support-netty` package to bring in the configuration files required for Netty HTTP
  28. client. For more details on this library, please refer to [this README](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/aot/azure-aot-graalvm-support-netty/README.md).
  29. [//]: # ({x-version-update-start;com.azure:azure-aot-graalvm-support-netty;current})
  30. ```xml
  31. <dependency>
  32. <groupId>com.azure</groupId>
  33. <artifactId>azure-aot-graalvm-support-netty</artifactId>
  34. <version>1.0.0-beta.3</version>
  35. </dependency>
  36. ```
  37. ## Key concepts
  38. ### Native Image creation
  39. Native Image is a technology to compile your Java application ahead of time into a native image which can run as a
  40. standalone application. The native image created through this ahead-of-time compilation will include all the
  41. necessary classes from the application, it's dependencies and any other natively linked JDK code. For more details
  42. on creating the native image please refer to [building a native image](https://www.graalvm.org/22.0/reference-manual/native-image/#build-a-native-image) documentation.
  43. ### GraalVM configuration files
  44. GraalVM is a high-performance runtime that creates native images by compiling the Java code ahead of time. Due to
  45. this ahead-of-time compilation into a native image, the native image creation requires statically analyzing all
  46. classes of the application and their dependencies to determine which classes and methods are reachable during the
  47. application execution. However, there are scenarios where Java allows looking up classes, methods and fields at
  48. runtime through reflection. While GraalVM does a best-effort discovery of all classes ahead of time, it will not be
  49. able to detect all classes that are reflectively accessed. So, developers can provide configuration files that
  50. contain details of all necessary classes that are reflectively accessed. This supplementary information is then used
  51. to create the native image and make these classes available at runtime.
  52. This library provides all the necessary configuration files for using Azure client libraries.
  53. ## Examples
  54. #### App Configuration
  55. - [Sample demonstrating the creation and use of App Configuration client](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/appconfiguration/AppConfigurationSample.java)
  56. Please refer to [Application Configuration](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/appconfiguration/azure-data-appconfiguration) client library documentation for more details.
  57. #### Key Vault
  58. - [Sample demonstrating the creation and use of Key Vault Certificates client](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/keyvault/certificates/KeyVaultCertificatesSample.java)
  59. - [Sample demonstrating the creation and use of Key Vault Keys client](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/keyvault/keys/KeyVaultKeysSample.java)
  60. - [Sample demonstrating the creation and use of Key Vault Secrets client](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/keyvault/secrets/KeyVaultSecretsSample.java)
  61. Please refer to [Key Vault](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/keyvault) client library documentation for more details.
  62. #### Storage Blob
  63. - [Sample demonstrating the creation and use of Storage Blob client](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/storage/blob/StorageBlobSample.java)
  64. Please refer to [Storage Blob](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/storage/azure-storage-blob) client library documentation for more details.
  65. #### Event Hubs
  66. - [Sample demonstrating the creation and use of Event Hubs producer client](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/eventhubs/EventHubsSample.java)
  67. Please refer to [Event Hubs](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/eventhubs/azure-messaging-eventhubs) client library documentation for more details.
  68. #### Form Recognizer
  69. - [Sample demonstrating the creation and use of Form Recognizer client](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/formrecognizer/FormRecognizerSample.java)
  70. Please refer to [Form Recognizer](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/formrecognizer/azure-ai-formrecognizer) client library documentation for more details.
  71. #### Text Analytics
  72. - [Sample demonstrating the creation and use of Text Analytics client](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/aot/azure-aot-graalvm-samples/src/main/java/com/azure/aot/graalvm/samples/textanalytics/TextAnalyticsSample.java)
  73. Please refer to [Text Analytics](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/textanalytics/azure-ai-textanalytics) client library documentation for more details.
  74. ## Troubleshooting
  75. ## Next steps
  76. The [azure-aot-graalvm-samples](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/aot/azure-aot-graalvm-samples)
  77. library consists of all above samples bundled into a single Maven project that can be compiled with `mvn clean
  78. install -Pnative` to build the native image and execute all the samples.
  79. ## Contributing
  80. This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License
  81. Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution.
  82. For details, visit [https://cla.microsoft.com](https://cla.microsoft.com).
  83. When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the
  84. PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this
  85. once across all repos using our CLA.
  86. This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
  87. For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact
  88. [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
  89. <!-- LINKS -->
  90. [cla]: https://cla.microsoft.com
  91. [coc]: https://opensource.microsoft.com/codeofconduct/
  92. [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/
  93. [coc_contact]: mailto:opencode@microsoft.com
  94. [jdk_link]: https://docs.microsoft.com/java/azure/jdk/?view=azure-java-stable
  95. [azure_subscription]: https://azure.microsoft.com/free
  96. ![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Faot%2Fazure-aot-graalvm-support%2FREADME.png)