Skip to content

Update GraalVM plugin version in the archetype-app-quickstart and sdk… #3013

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
<exec-maven-plugin.version>1.6.0</exec-maven-plugin.version>
<aws.java.sdk.version>${javaSdkVersion}</aws.java.sdk.version>
<slf4j.version>1.7.28</slf4j.version>
<graalvm.version>21.0.0</graalvm.version>
#if( $nativeImage == 'true')
<graalvm.native.maven.plugin.version>0.9.6</graalvm.native.maven.plugin.version>
#end
<junit5.version>5.8.1</junit5.version>
</properties>

Expand Down Expand Up @@ -83,15 +85,6 @@
</dependency>
#end

#if( $nativeImage == 'true')
<dependency>
<groupId>org.graalvm.sdk</groupId>
<artifactId>graal-sdk</artifactId>
<version>${graalvm.version}</version>
<scope>provided</scope>
</dependency>
#end

<!-- Test Dependencies -->
<dependency>
<groupId>org.junit.jupiter</groupId>
Expand All @@ -118,13 +111,14 @@
<build>
<plugins>
<plugin>
<groupId>org.graalvm.nativeimage</groupId>
<artifactId>native-image-maven-plugin</artifactId>
<version>${graalvm.version}</version>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
<version>${graalvm.native.maven.plugin.version}</version>
<executions>
<execution>
<id>build-native</id>
<goals>
<goal>native-image</goal>
<goal>build</goal>
</goals>
<phase>package</phase>
</execution>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<exec-maven-plugin.version>1.6.0</exec-maven-plugin.version>
<aws.java.sdk.version>2.11.0</aws.java.sdk.version>
<slf4j.version>1.7.28</slf4j.version>
<graalvm.version>21.0.0</graalvm.version>
<graalvm.native.maven.plugin.version>0.9.6</graalvm.native.maven.plugin.version>
<junit5.version>5.8.1</junit5.version>
</properties>

Expand Down Expand Up @@ -78,13 +78,6 @@
<version>${slf4j.version}</version>
</dependency>

<dependency>
<groupId>org.graalvm.sdk</groupId>
<artifactId>graal-sdk</artifactId>
<version>${graalvm.version}</version>
<scope>provided</scope>
</dependency>

<!-- Test Dependencies -->
<dependency>
<groupId>org.junit.jupiter</groupId>
Expand All @@ -110,13 +103,14 @@
<build>
<plugins>
<plugin>
<groupId>org.graalvm.nativeimage</groupId>
<artifactId>native-image-maven-plugin</artifactId>
<version>${graalvm.version}</version>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
<version>${graalvm.native.maven.plugin.version}</version>
<executions>
<execution>
<id>build-native</id>
<goals>
<goal>native-image</goal>
<goal>build</goal>
</goals>
<phase>package</phase>
</execution>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
<exec-maven-plugin.version>1.6.0</exec-maven-plugin.version>
<aws.java.sdk.version>2.11.0</aws.java.sdk.version>
<slf4j.version>1.7.28</slf4j.version>
<graalvm.version>21.0.0</graalvm.version>
<junit5.version>5.8.1</junit5.version>
</properties>

Expand Down Expand Up @@ -78,7 +77,6 @@
<version>${slf4j.version}</version>
</dependency>


<!-- Test Dependencies -->
<dependency>
<groupId>org.junit.jupiter</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<exec-maven-plugin.version>1.6.0</exec-maven-plugin.version>
<aws.java.sdk.version>2.11.0</aws.java.sdk.version>
<slf4j.version>1.7.28</slf4j.version>
<graalvm.version>21.0.0</graalvm.version>
<graalvm.native.maven.plugin.version>0.9.6</graalvm.native.maven.plugin.version>
<junit5.version>5.8.1</junit5.version>
</properties>

Expand Down Expand Up @@ -65,13 +65,6 @@
</dependency>


<dependency>
<groupId>org.graalvm.sdk</groupId>
<artifactId>graal-sdk</artifactId>
<version>${graalvm.version}</version>
<scope>provided</scope>
</dependency>

<!-- Test Dependencies -->
<dependency>
<groupId>org.junit.jupiter</groupId>
Expand All @@ -97,13 +90,14 @@
<build>
<plugins>
<plugin>
<groupId>org.graalvm.nativeimage</groupId>
<artifactId>native-image-maven-plugin</artifactId>
<version>${graalvm.version}</version>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
<version>${graalvm.native.maven.plugin.version}</version>
<executions>
<execution>
<id>build-native</id>
<goals>
<goal>native-image</goal>
<goal>build</goal>
</goals>
<phase>package</phase>
</execution>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<exec-maven-plugin.version>1.6.0</exec-maven-plugin.version>
<aws.java.sdk.version>2.11.0</aws.java.sdk.version>
<slf4j.version>1.7.28</slf4j.version>
<graalvm.version>21.0.0</graalvm.version>
<graalvm.native.maven.plugin.version>0.9.6</graalvm.native.maven.plugin.version>
<junit5.version>5.8.1</junit5.version>
</properties>

Expand Down Expand Up @@ -65,13 +65,6 @@
</dependency>


<dependency>
<groupId>org.graalvm.sdk</groupId>
<artifactId>graal-sdk</artifactId>
<version>${graalvm.version}</version>
<scope>provided</scope>
</dependency>

<!-- Test Dependencies -->
<dependency>
<groupId>org.junit.jupiter</groupId>
Expand All @@ -97,13 +90,14 @@
<build>
<plugins>
<plugin>
<groupId>org.graalvm.nativeimage</groupId>
<artifactId>native-image-maven-plugin</artifactId>
<version>${graalvm.version}</version>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
<version>${graalvm.native.maven.plugin.version}</version>
<executions>
<execution>
<id>build-native</id>
<goals>
<goal>native-image</goal>
<goal>build</goal>
</goals>
<phase>package</phase>
</execution>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,10 @@
# permissions and limitations under the License.
#
Args=--allow-incomplete-classpath \
--initialize-at-run-time=io.netty.util.internal.logging.Log4JLogger,org.apache.log4j.Logger,\
io.netty.handler.ssl.ReferenceCountedOpenSslClientContext,\
io.netty.handler.ssl.ReferenceCountedOpenSslServerContext,\
io.netty.handler.ssl.ReferenceCountedOpenSslContext,\
io.netty.handler.ssl.JdkNpnApplicationProtocolNegotiator,\
io.netty.handler.ssl.ConscryptAlpnSslEngine,\
io.netty.handler.ssl.JettyAlpnSslEngine$ClientEngine,\
io.netty.handler.ssl.JettyAlpnSslEngine$ServerEngine,\
io.netty.handler.ssl.JettyNpnSslEngine,\
io.netty.handler.ssl.ReferenceCountedOpenSslEngine
--initialize-at-run-time=io.netty.internal.tcnative.SSL,\
io.netty.internal.tcnative.CertificateVerifier,\
io.netty.internal.tcnative.AsyncSSLPrivateKeyMethod,\
io.netty.internal.tcnative.SSLPrivateKeyMethod,\
io.netty.handler.ssl.OpenSslPrivateKeyMethod,\
io.netty.handler.ssl.ReferenceCountedOpenSslEngine,\
io.netty.handler.ssl.OpenSslAsyncPrivateKeyMethod
8 changes: 8 additions & 0 deletions test/sdk-native-image-test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,15 @@
This module contains a sample application using AWS SDK for Java 2.x, and it
is used to test GraalVM Native Image compilation.

## Prerequisites

To run the tests, you need to have GraalVM and Native Image set up properly in your workspace.
See [Setting up GraalVM with native-image support](https://graalvm.github.io/native-build-tools/latest/graalvm-setup.html)

## How to run

You can run the integration tests by using the following commands.

```
mvn clean install -pl :sdk-native-image-test -P quick --am

Expand Down
31 changes: 8 additions & 23 deletions test/sdk-native-image-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<maven.compiler.plugin.version>3.6.1</maven.compiler.plugin.version>
<exec-maven-plugin.version>1.6.0</exec-maven-plugin.version>
<slf4j.version>1.7.30</slf4j.version>
<graalvm.version>21.1.0</graalvm.version>
<graalvm.native.maven.plugin.version>0.9.6</graalvm.native.maven.plugin.version>
</properties>

<dependencies>
Expand Down Expand Up @@ -87,24 +87,6 @@
<artifactId>jcl-over-slf4j</artifactId>
<version>${slf4j.version}</version>
</dependency>

<dependency>
<groupId>org.graalvm.sdk</groupId>
<artifactId>graal-sdk</artifactId>
<version>${graalvm.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>service-test-utils</artifactId>
<version>${awsjavasdk.version}</version>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>test-utils</artifactId>
<version>${awsjavasdk.version}</version>
<scope>compile</scope>
</dependency>
</dependencies>

<build>
Expand Down Expand Up @@ -146,13 +128,14 @@
<build>
<plugins>
<plugin>
<groupId>org.graalvm.nativeimage</groupId>
<artifactId>native-image-maven-plugin</artifactId>
<version>${graalvm.version}</version>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
<version>${graalvm.native.maven.plugin.version}</version>
<executions>
<execution>
<id>build-native</id>
<goals>
<goal>native-image</goal>
<goal>build</goal>
</goals>
<phase>package</phase>
</execution>
Expand All @@ -161,10 +144,12 @@
<imageName>sdk-native-image-test</imageName>
<mainClass>software.amazon.awssdk.nativeimagetest.App</mainClass>
<buildArgs combine.children="append">
<!-- BouncyCastleAlpn issue tracked in https://github.com/netty/netty/issues/11369 -->
<buildArgs>
--verbose
--no-fallback
--initialize-at-build-time=org.slf4j
--initialize-at-run-time=io.netty.handler.ssl.BouncyCastleAlpnSslUtils
</buildArgs>
</buildArgs>
</configuration>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@

package software.amazon.awssdk.nativeimagetest;

import software.amazon.awssdk.auth.credentials.AwsCredentialsProviderChain;
import software.amazon.awssdk.auth.credentials.DefaultCredentialsProvider;
import software.amazon.awssdk.auth.credentials.ProfileCredentialsProvider;
import software.amazon.awssdk.enhanced.dynamodb.DynamoDbEnhancedClient;
import software.amazon.awssdk.http.apache.ApacheHttpClient;
import software.amazon.awssdk.http.urlconnection.UrlConnectionHttpClient;
Expand All @@ -23,12 +26,20 @@
import software.amazon.awssdk.services.dynamodb.DynamoDbClient;
import software.amazon.awssdk.services.s3.S3AsyncClient;
import software.amazon.awssdk.services.s3.S3Client;
import software.amazon.awssdk.testutils.service.AwsTestBase;

/**
* The module containing all dependencies required by the {@link App}.
*/
public class DependencyFactory extends AwsTestBase {
public class DependencyFactory {

/** Default Properties Credentials file path. */
private static final String TEST_CREDENTIALS_PROFILE_NAME = "aws-test-account";

public static final AwsCredentialsProviderChain CREDENTIALS_PROVIDER_CHAIN =
AwsCredentialsProviderChain.of(ProfileCredentialsProvider.builder()
.profileName(TEST_CREDENTIALS_PROFILE_NAME)
.build(),
DefaultCredentialsProvider.create());

private DependencyFactory() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,19 @@

package software.amazon.awssdk.nativeimagetest;

import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import java.util.UUID;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import software.amazon.awssdk.core.async.AsyncResponseTransformer;
import software.amazon.awssdk.core.sync.RequestBody;
import software.amazon.awssdk.services.s3.S3AsyncClient;
import software.amazon.awssdk.services.s3.S3Client;
import software.amazon.awssdk.services.s3.model.CreateBucketResponse;
import software.amazon.awssdk.testutils.RandomInputStream;
import software.amazon.awssdk.testutils.service.S3BucketUtils;
import software.amazon.awssdk.utils.IoUtils;

public class S3TestRunner implements TestRunner {
private static final String BUCKET_NAME = S3BucketUtils.temporaryBucketName("native-image");
private static final Logger logger = LoggerFactory.getLogger(DynamoDbEnhancedClientTestRunner.class);
private static final String BUCKET_NAME = "v2-native-image-tests-" + UUID.randomUUID();
private static final Logger logger = LoggerFactory.getLogger(S3TestRunner.class);
private static final String KEY = "key";
private final S3Client s3ApacheHttpClient;
private final S3Client s3UrlConnectionHttpClient;
Expand All @@ -45,15 +43,12 @@ public S3TestRunner() {
public void runTests() {
logger.info("starting to run S3 tests");
CreateBucketResponse bucketResponse = null;
InputStream inputStream = null;
try {
bucketResponse = s3UrlConnectionHttpClient.createBucket(b -> b.bucket(BUCKET_NAME));

s3UrlConnectionHttpClient.waiter().waitUntilBucketExists(b -> b.bucket(BUCKET_NAME));

inputStream = new RandomInputStream(10_000);

RequestBody requestBody = RequestBody.fromInputStream(inputStream, 10_000);
RequestBody requestBody = RequestBody.fromBytes("helloworld".getBytes(StandardCharsets.UTF_8));

s3ApacheHttpClient.putObject(b -> b.bucket(BUCKET_NAME).key(KEY),
requestBody);
Expand All @@ -67,7 +62,6 @@ public void runTests() {

s3NettyClient.deleteBucket(b -> b.bucket(BUCKET_NAME)).join();
}
IoUtils.closeQuietly(inputStream, null);
}
}
}