Skip to content

Commit

Permalink
Created infrastructure for java21
Browse files Browse the repository at this point in the history
* Run CDK in java 21 with image `ghcr.io/muhamadto/spring-native-amazonlinux2-builder:21-amazonlinux2`
* Replaced `com.coffeebeans.springnativeawslambda.infra.lambda.CustomRuntime2Function` with `com.coffeebeans.springnativeawslambda.infra.lambda.CustomRuntime2023FunctionJava21` and updated tests.
* `docker-compose.yml` now adopting `apigateway` functions from `ghcr.io/muhamadto/spring-native-amazonlinux2-builder:21-amazonlinux2-awscliv2`. However, the lambda is not loading and need some more work.
* Reinstated `native:compile` in `prepare-package` phase. This is to ensure the `spring-native-aws-lambda-function-native-zip.zip` include would include the `spring-native-aws-lambda-function` native executable.

Signed-off-by: matto <muhamadto@gmail.com>
  • Loading branch information
muhamadto committed Jan 4, 2024
1 parent bcc27ff commit 652eea0
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ jobs:
duration_seconds: 3600
role-session-name: github-actions-example-lambda
aws-region: ap-southeast-2
mask-aws-account-id: 'true'
- name: Checkout repository
uses: actions/checkout@v3
- name: Cache Maven packages
Expand All @@ -56,7 +57,7 @@ jobs:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
ENV: ${{ env.ENV }}
COST_CENTRE: ${{ env.COST_CENTRE }}
run: ./mvnw -ntp clean package -U -Pnative -DskipTests
run: ./mvnw -ntp -Pnative clean package -DskipTests
- name: cdk diff
uses: muhamadto/aws-cdk-github-actions@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ $ ./mvnw -ntp clean verify -U
2022-12-07 02:56:51.763 INFO 42417 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''
2022-12-07 02:56:51.763 INFO 42417 --- [ main] c.c.s.Application : Started Application in 0.084 seconds (JVM running for 0.087)
```
3. Make a call
2. Make a call
```shell
$ curl --location --request POST 'http://localhost:8080' \
--header 'Content-Type: application/json' \
Expand Down
2 changes: 1 addition & 1 deletion spring-native-aws-lambda-function/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
<buildArg>--verbose</buildArg>
<buildArg>--no-fallback</buildArg>
<buildArg>--enable-preview</buildArg>
<!-- <buildArg>&#45;&#45;gc=G1</buildArg>-->
<buildArg>--gc=G1</buildArg>
<buildArg>-march=native</buildArg>
<buildArg>--strict-image-heap</buildArg>
<buildArg>--enable-url-protocols=http</buildArg>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ public class CustomRuntime2023Function extends Construct implements CoffeeBeansC
* @param id This parameter is required.
* @param props This parameter is required.
*/
public CustomRuntime2023Function(@NotNull final Construct scope, @NotNull final String id,
public CustomRuntime2023Function(@NotNull final Construct scope,
@NotNull final String id,
@NotNull final FunctionProps props) {
super(scope, id);

Expand Down

0 comments on commit 652eea0

Please sign in to comment.