Skip to content

Commit 7cae0e9

Browse files
authored
Graal vm crt upgrade (aws-samples#212)
* Added GraalVM lab for Spring section, Upgraded CRT Version, Moved folders
1 parent a6ff24c commit 7cae0e9

81 files changed

Lines changed: 1114 additions & 222 deletions

File tree

Some content is hidden

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

.github/dependabot.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@
66
version: 2
77
updates:
88
- package-ecosystem: maven
9-
directory: "/labs/unicorn-store/software/unicorn-store-basic"
9+
directory: "/labs/unicorn-store/software/alternatives/unicorn-store-basic"
1010
schedule:
1111
interval: "weekly"
1212
- package-ecosystem: maven
1313
directory: "/labs/unicorn-store/software/unicorn-store-spring"
1414
schedule:
1515
interval: "weekly"
1616
- package-ecosystem: maven
17-
directory: "/labs/unicorn-store/software/unicorn-store-spring-final"
17+
directory: "/labs/unicorn-store/software/alternatives/unicorn-store-spring-native-graalvm"
1818
schedule:
1919
interval: "weekly"
2020
- package-ecosystem: maven
21-
directory: "/labs/unicorn-store/software/unicorn-store-micronaut"
21+
directory: "/labs/unicorn-store/software/alternatives/unicorn-store-micronaut"
2222
schedule:
2323
interval: "weekly"
2424
- package-ecosystem: maven

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,16 @@ jobs:
2929
run: ./mvnw package -f infrastructure/cdk/pom.xml
3030
working-directory: ./labs/unicorn-store
3131
- name: mvn unicorn-store-basic
32-
run: ./mvnw package -f software/unicorn-store-basic/pom.xml
32+
run: ./mvnw package -f software/alternatives/unicorn-store-basic/pom.xml
3333
working-directory: ./labs/unicorn-store
3434
- name: mvn unicorn-store-spring
3535
run: ./mvnw package -f software/unicorn-store-spring/pom.xml
3636
working-directory: ./labs/unicorn-store
37-
- name: mvn unicorn-store-spring-final
38-
run: ./mvnw package -f software/unicorn-store-spring-final/pom.xml
37+
- name: mvn unicorn-store-spring-native-graalvm
38+
run: ./mvnw package -f software/alternatives/unicorn-store-spring-native-graalvm/pom.xml
3939
working-directory: ./labs/unicorn-store
4040
- name: mvn unicorn-store-micronaut
41-
run: ./mvnw package -f software/unicorn-store-micronaut/pom.xml
41+
run: ./mvnw package -f software/alternatives/unicorn-store-micronaut/pom.xml
4242
working-directory: ./labs/unicorn-store
4343
- name: install cdk
4444
run: npm install -g aws-cdk

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ target/
77
./aws-sam
88
samconfig.toml
99
node_modules
10+
unicorn-store-spring-native
1011

1112
### STS ###
1213
.apt_generated

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ You will learn how to build cloud-native Java applications, best practices and p
77

88
# Architecture & Lab Overview
99

10-
## [Migrate Spring Boot applications to AWS Lambda](labs/unicorn-store)
10+
## [From Serverful to Serverless Java with AWS Lambda](labs/unicorn-store)
1111

1212
In this module you will learn how to bring your traditional Java Spring application to AWS Lambda with minimal effort and iteratively apply optimizations to get the best out of your Serverless Java experience. You will get an overview of best practices, performance trade-offs and the design considerations for each step to be able to make well-informed decisions when bringing enterprise Java applications to AWS Lambda.
1313

labs/unicorn-location-api/final/unicorn-location-api-final/UnicornLocationFunction/pom.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<dependency>
1616
<groupId>software.amazon.awssdk</groupId>
1717
<artifactId>dynamodb</artifactId>
18-
<version>2.17.214</version>
18+
<version>2.17.282</version>
1919
<exclusions>
2020
<exclusion>
2121
<groupId>software.amazon.awssdk</groupId>
@@ -32,7 +32,7 @@
3232
<dependency>
3333
<groupId>software.amazon.awssdk</groupId>
3434
<artifactId>aws-crt-client</artifactId>
35-
<version>2.17.214-PREVIEW</version>
35+
<version>2.17.282-PREVIEW</version>
3636
</dependency>
3737
<dependency>
3838
<groupId>com.amazonaws</groupId>
@@ -47,19 +47,19 @@
4747
<dependency>
4848
<groupId>org.slf4j</groupId>
4949
<artifactId>slf4j-api</artifactId>
50-
<version>1.7.36</version>
50+
<version>2.0.2</version>
5151
</dependency>
5252

5353
<dependency>
5454
<groupId>com.fasterxml.jackson.jr</groupId>
5555
<artifactId>jackson-jr-objects</artifactId>
56-
<version>2.13.3</version>
56+
<version>2.13.4</version>
5757
</dependency>
5858

5959
<dependency>
6060
<groupId>org.slf4j</groupId>
6161
<artifactId>slf4j-simple</artifactId>
62-
<version>1.7.36</version>
62+
<version>2.0.2</version>
6363
</dependency>
6464

6565
<dependency>
@@ -83,7 +83,7 @@
8383
<plugin>
8484
<groupId>org.apache.maven.plugins</groupId>
8585
<artifactId>maven-shade-plugin</artifactId>
86-
<version>3.3.0</version>
86+
<version>3.4.0</version>
8787
<executions>
8888
<execution>
8989
<phase>package</phase>
@@ -104,7 +104,7 @@
104104
<plugin>
105105
<groupId>org.graalvm.buildtools</groupId>
106106
<artifactId>native-maven-plugin</artifactId>
107-
<version>0.9.12</version>
107+
<version>0.9.14</version>
108108
<extensions>true</extensions>
109109
<executions>
110110
<execution>

labs/unicorn-location-api/final/unicorn-location-api-final/UnicornLocationFunction/src/main/resources/META-INF/native-image/software.amazon.awssdk/aws-crt-client/jni-config.json

Lines changed: 61 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,41 @@
66
{
77
"name":"java.lang.Long",
88
"methods":[
9-
{"name":"longValue","parameterTypes":[] },
10-
{"name":"<init>","parameterTypes":["long"] }]
9+
{"name":"<init>","parameterTypes":["long"] },
10+
{"name":"longValue","parameterTypes":[] }
11+
]
12+
},
13+
{
14+
"name":"java.lang.String",
15+
"methods":[
16+
{"name":"lastIndexOf","parameterTypes":["int"] },
17+
{"name":"substring","parameterTypes":["int"] }
18+
]
19+
},
20+
{
21+
"name":"java.lang.System",
22+
"methods":[
23+
{"name":"getProperty","parameterTypes":["java.lang.String"] },
24+
{"name":"setProperty","parameterTypes":["java.lang.String","java.lang.String"] }
25+
]
1126
},
1227
{
1328
"name":"java.nio.Buffer",
14-
"allDeclaredConstructors" : true,
15-
"allPublicConstructors" : true,
16-
"allDeclaredMethods" : true,
17-
"allPublicMethods" : true,
18-
"allDeclaredClasses" : true,
19-
"allPublicClasses" : true
29+
"allDeclaredMethods":true,
30+
"allPublicMethods":true,
31+
"allDeclaredConstructors":true,
32+
"allPublicConstructors":true,
33+
"allDeclaredClasses":true,
34+
"allPublicClasses":true
2035
},
2136
{
2237
"name":"java.nio.ByteBuffer",
23-
"allDeclaredConstructors" : true,
24-
"allPublicConstructors" : true,
25-
"allDeclaredMethods" : true,
26-
"allPublicMethods" : true,
27-
"allDeclaredClasses" : true,
28-
"allPublicClasses" : true
38+
"allDeclaredMethods":true,
39+
"allPublicMethods":true,
40+
"allDeclaredConstructors":true,
41+
"allPublicConstructors":true,
42+
"allDeclaredClasses":true,
43+
"allPublicClasses":true
2944
},
3045
{
3146
"name":"java.util.concurrent.CompletableFuture",
@@ -38,6 +53,10 @@
3853
"name":"java.util.function.Predicate",
3954
"methods":[{"name":"test","parameterTypes":["java.lang.Object"] }]
4055
},
56+
{
57+
"name":"software.amazon.awssdk.crt.App",
58+
"methods":[{"name":"main","parameterTypes":["java.lang.String[]"] }]
59+
},
4160
{
4261
"name":"software.amazon.awssdk.crt.AsyncCallback",
4362
"methods":[
@@ -171,6 +190,14 @@
171190
{"name":"onNewConnection","parameterTypes":["software.amazon.awssdk.crt.eventstream.ServerConnection","int"] }
172191
]
173192
},
193+
{
194+
"name":"software.amazon.awssdk.crt.http.Http2Stream",
195+
"methods":[{"name":"<init>","parameterTypes":["long"] }]
196+
},
197+
{
198+
"name":"software.amazon.awssdk.crt.http.Http2StreamManager",
199+
"methods":[{"name":"onShutdownComplete","parameterTypes":[] }]
200+
},
174201
{
175202
"name":"software.amazon.awssdk.crt.http.HttpClientConnection",
176203
"methods":[{"name":"onConnectionAcquired","parameterTypes":["java.util.concurrent.CompletableFuture","long","int"] }]
@@ -191,10 +218,6 @@
191218
"name":"software.amazon.awssdk.crt.http.HttpRequestBase",
192219
"fields":[{"name":"bodyStream"}]
193220
},
194-
{
195-
"name":"software.amazon.awssdk.crt.http.Http2Stream",
196-
"methods":[{"name":"<init>","parameterTypes":["long"] }]
197-
},
198221
{
199222
"name":"software.amazon.awssdk.crt.http.HttpRequestBodyStream",
200223
"methods":[
@@ -266,6 +289,14 @@
266289
],
267290
"methods":[{"name":"<init>","parameterTypes":[] }]
268291
},
292+
{
293+
"name":"software.amazon.awssdk.crt.io.TlsContextCustomKeyOperationOptions",
294+
"fields":[
295+
{"name":"certificateFileContents"},
296+
{"name":"certificateFilePath"},
297+
{"name":"operationHandler"}
298+
]
299+
},
269300
{
270301
"name":"software.amazon.awssdk.crt.io.TlsContextPkcs11Options",
271302
"fields":[
@@ -278,6 +309,17 @@
278309
{"name":"userPin"}
279310
]
280311
},
312+
{
313+
"name":"software.amazon.awssdk.crt.io.TlsKeyOperation",
314+
"methods":[
315+
{"name":"<init>","parameterTypes":["long","byte[]","int","int","int"] },
316+
{"name":"invokePerformOperation","parameterTypes":["software.amazon.awssdk.crt.io.TlsKeyOperationHandler","software.amazon.awssdk.crt.io.TlsKeyOperation"] }
317+
]
318+
},
319+
{
320+
"name":"software.amazon.awssdk.crt.io.TlsKeyOperationHandler",
321+
"methods":[{"name":"performOperation","parameterTypes":["software.amazon.awssdk.crt.io.TlsKeyOperation"] }]
322+
},
281323
{
282324
"name":"software.amazon.awssdk.crt.mqtt.MqttClientConnection",
283325
"methods":[
@@ -315,6 +357,7 @@
315357
"name":"software.amazon.awssdk.crt.s3.S3MetaRequestResponseHandlerNativeAdapter",
316358
"methods":[
317359
{"name":"onFinished","parameterTypes":["int","int","byte[]"] },
360+
{"name":"onFinished","parameterTypes":["int","int","byte[]","int","boolean"] },
318361
{"name":"onProgress","parameterTypes":["software.amazon.awssdk.crt.s3.S3MetaRequestProgress"] },
319362
{"name":"onResponseBody","parameterTypes":["byte[]","long","long"] },
320363
{"name":"onResponseHeaders","parameterTypes":["int","java.nio.ByteBuffer"] }

labs/unicorn-location-api/graal/resources/META-INF/native-image/software.amazon.awssdk/aws-crt-client/jni-config.json

Lines changed: 61 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,41 @@
66
{
77
"name":"java.lang.Long",
88
"methods":[
9-
{"name":"longValue","parameterTypes":[] },
10-
{"name":"<init>","parameterTypes":["long"] }]
9+
{"name":"<init>","parameterTypes":["long"] },
10+
{"name":"longValue","parameterTypes":[] }
11+
]
12+
},
13+
{
14+
"name":"java.lang.String",
15+
"methods":[
16+
{"name":"lastIndexOf","parameterTypes":["int"] },
17+
{"name":"substring","parameterTypes":["int"] }
18+
]
19+
},
20+
{
21+
"name":"java.lang.System",
22+
"methods":[
23+
{"name":"getProperty","parameterTypes":["java.lang.String"] },
24+
{"name":"setProperty","parameterTypes":["java.lang.String","java.lang.String"] }
25+
]
1126
},
1227
{
1328
"name":"java.nio.Buffer",
14-
"allDeclaredConstructors" : true,
15-
"allPublicConstructors" : true,
16-
"allDeclaredMethods" : true,
17-
"allPublicMethods" : true,
18-
"allDeclaredClasses" : true,
19-
"allPublicClasses" : true
29+
"allDeclaredMethods":true,
30+
"allPublicMethods":true,
31+
"allDeclaredConstructors":true,
32+
"allPublicConstructors":true,
33+
"allDeclaredClasses":true,
34+
"allPublicClasses":true
2035
},
2136
{
2237
"name":"java.nio.ByteBuffer",
23-
"allDeclaredConstructors" : true,
24-
"allPublicConstructors" : true,
25-
"allDeclaredMethods" : true,
26-
"allPublicMethods" : true,
27-
"allDeclaredClasses" : true,
28-
"allPublicClasses" : true
38+
"allDeclaredMethods":true,
39+
"allPublicMethods":true,
40+
"allDeclaredConstructors":true,
41+
"allPublicConstructors":true,
42+
"allDeclaredClasses":true,
43+
"allPublicClasses":true
2944
},
3045
{
3146
"name":"java.util.concurrent.CompletableFuture",
@@ -38,6 +53,10 @@
3853
"name":"java.util.function.Predicate",
3954
"methods":[{"name":"test","parameterTypes":["java.lang.Object"] }]
4055
},
56+
{
57+
"name":"software.amazon.awssdk.crt.App",
58+
"methods":[{"name":"main","parameterTypes":["java.lang.String[]"] }]
59+
},
4160
{
4261
"name":"software.amazon.awssdk.crt.AsyncCallback",
4362
"methods":[
@@ -171,6 +190,14 @@
171190
{"name":"onNewConnection","parameterTypes":["software.amazon.awssdk.crt.eventstream.ServerConnection","int"] }
172191
]
173192
},
193+
{
194+
"name":"software.amazon.awssdk.crt.http.Http2Stream",
195+
"methods":[{"name":"<init>","parameterTypes":["long"] }]
196+
},
197+
{
198+
"name":"software.amazon.awssdk.crt.http.Http2StreamManager",
199+
"methods":[{"name":"onShutdownComplete","parameterTypes":[] }]
200+
},
174201
{
175202
"name":"software.amazon.awssdk.crt.http.HttpClientConnection",
176203
"methods":[{"name":"onConnectionAcquired","parameterTypes":["java.util.concurrent.CompletableFuture","long","int"] }]
@@ -191,10 +218,6 @@
191218
"name":"software.amazon.awssdk.crt.http.HttpRequestBase",
192219
"fields":[{"name":"bodyStream"}]
193220
},
194-
{
195-
"name":"software.amazon.awssdk.crt.http.Http2Stream",
196-
"methods":[{"name":"<init>","parameterTypes":["long"] }]
197-
},
198221
{
199222
"name":"software.amazon.awssdk.crt.http.HttpRequestBodyStream",
200223
"methods":[
@@ -266,6 +289,14 @@
266289
],
267290
"methods":[{"name":"<init>","parameterTypes":[] }]
268291
},
292+
{
293+
"name":"software.amazon.awssdk.crt.io.TlsContextCustomKeyOperationOptions",
294+
"fields":[
295+
{"name":"certificateFileContents"},
296+
{"name":"certificateFilePath"},
297+
{"name":"operationHandler"}
298+
]
299+
},
269300
{
270301
"name":"software.amazon.awssdk.crt.io.TlsContextPkcs11Options",
271302
"fields":[
@@ -278,6 +309,17 @@
278309
{"name":"userPin"}
279310
]
280311
},
312+
{
313+
"name":"software.amazon.awssdk.crt.io.TlsKeyOperation",
314+
"methods":[
315+
{"name":"<init>","parameterTypes":["long","byte[]","int","int","int"] },
316+
{"name":"invokePerformOperation","parameterTypes":["software.amazon.awssdk.crt.io.TlsKeyOperationHandler","software.amazon.awssdk.crt.io.TlsKeyOperation"] }
317+
]
318+
},
319+
{
320+
"name":"software.amazon.awssdk.crt.io.TlsKeyOperationHandler",
321+
"methods":[{"name":"performOperation","parameterTypes":["software.amazon.awssdk.crt.io.TlsKeyOperation"] }]
322+
},
281323
{
282324
"name":"software.amazon.awssdk.crt.mqtt.MqttClientConnection",
283325
"methods":[
@@ -315,6 +357,7 @@
315357
"name":"software.amazon.awssdk.crt.s3.S3MetaRequestResponseHandlerNativeAdapter",
316358
"methods":[
317359
{"name":"onFinished","parameterTypes":["int","int","byte[]"] },
360+
{"name":"onFinished","parameterTypes":["int","int","byte[]","int","boolean"] },
318361
{"name":"onProgress","parameterTypes":["software.amazon.awssdk.crt.s3.S3MetaRequestProgress"] },
319362
{"name":"onResponseBody","parameterTypes":["byte[]","long","long"] },
320363
{"name":"onResponseHeaders","parameterTypes":["int","java.nio.ByteBuffer"] }

labs/unicorn-store/README.MD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Migrate your Spring Boot application to AWS Lambda
1+
# From Serverful to Serverless Java with AWS Lambda
22

33
# Pre-Requisites
44

0 commit comments

Comments
 (0)