Skip to content
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

Resolve Issues #255 and #256, Update GraalVM to 21.0.2, and Update Documentation #257

Merged
merged 5 commits into from
Mar 20, 2024
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
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14.17.1
16
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ A ZIO-based AWS Custom Runtime compatible with GraalVM Native Image.
## Installation

```scala
libraryDependencies += "dev.zio" %% "zio-lambda" % "1.0.3"
libraryDependencies += "dev.zio" %% "zio-json" % "0.6.2"
libraryDependencies += "dev.zio" %% "zio-lambda" % "1.0.4"

// Optional dependencies
libraryDependencies += "dev.zio" %% "zio-lambda-event" % "1.0.3"
libraryDependencies += "dev.zio" %% "zio-lambda-response" % "1.0.3"
libraryDependencies += "dev.zio" %% "zio-lambda-event" % "1.0.4"
libraryDependencies += "dev.zio" %% "zio-lambda-response" % "1.0.4"
```

## Usage
Expand Down Expand Up @@ -52,7 +53,7 @@ Each release will contain a zip file ready to be used as a lambda layer) and you
1. Create an AWS Lambda function and choose the runtime where you provide your own bootstrap on Amazon Linux 2

![create-lambda](https://user-images.githubusercontent.com/14280155/164102664-3686e415-20be-4dd9-8979-ea6098a7a4b9.png)
2. Run `sbt graalvm-native-image:packageBin`, we'll find the binary present under the `graalvm-native-image` folder:
2. Run `sbt GraalVMNativeImage/packageBin`, we'll find the binary present under the `graalvm-native-image` folder:

![binary-located](https://user-images.githubusercontent.com/14280155/164103337-6645dfeb-7fc4-4f7f-9b13-8005b0cddead.png)

Expand Down Expand Up @@ -88,7 +89,7 @@ Following the steps from `Direct deployment of native image binary` to produce y
up the native binary into a Docker image and deploy it like that to AWS Lambda.

```Dockerfile
FROM gcr.io/distroless/base
FROM gcr.io/distroless/base-debian12
COPY lambda-example/target/graalvm-native-image/zio-lambda-example /app/zio-lambda-example
CMD ["/app/zio-lambda-example"]
```
Expand Down
9 changes: 3 additions & 6 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -94,18 +94,15 @@ lazy val zioLambdaExample = module("zio-lambda-example", "lambda-example")
stdSettings("zio-lambda-example"),
assembly / assemblyJarName := "zio-lambda-example.jar",
GraalVMNativeImage / mainClass := Some("zio.lambda.example.SimpleHandler"),
GraalVMNativeImage / containerBuildImage := GraalVMNativeImagePlugin
.generateContainerBuildImage(
"hseeberger/scala-sbt:graalvm-ce-21.3.0-java17_1.6.2_3.1.1"
)
.value,
GraalVMNativeImage / containerBuildImage := Some("ghcr.io/graalvm/native-image-community:21.0.2"),
graalVMNativeImageOptions := Seq(
"--verbose",
"--no-fallback",
"--install-exit-handlers",
"--enable-http",
"--allow-incomplete-classpath",
"--link-at-build-time",
"--report-unsupported-elements-at-runtime",
"-H:+UnlockExperimentalVMOptions",
"-H:+StaticExecutableWithDynamicLibC",
"-H:+RemoveSaturatedTypeFlows"
)
Expand Down
5 changes: 3 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ A ZIO-based AWS Custom Runtime compatible with GraalVM Native Image.
## Installation

```scala
libraryDependencies += "dev.zio" %% "zio-json" % "0.6.2"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If #232 is merged, this change will no longer be necessary.

libraryDependencies += "dev.zio" %% "zio-lambda" % "@VERSION@"

// Optional dependencies
Expand Down Expand Up @@ -52,7 +53,7 @@ Each release will contain a zip file ready to be used as a lambda layer) and you
1. Create an AWS Lambda function and choose the runtime where you provide your own bootstrap on Amazon Linux 2

![create-lambda](https://user-images.githubusercontent.com/14280155/164102664-3686e415-20be-4dd9-8979-ea6098a7a4b9.png)
2. Run `sbt graalvm-native-image:packageBin`, we'll find the binary present under the `graalvm-native-image` folder:
2. Run `sbt GraalVMNativeImage/packageBin`, we'll find the binary present under the `graalvm-native-image` folder:

![binary-located](https://user-images.githubusercontent.com/14280155/164103337-6645dfeb-7fc4-4f7f-9b13-8005b0cddead.png)

Expand Down Expand Up @@ -88,7 +89,7 @@ Following the steps from `Direct deployment of native image binary` to produce y
up the native binary into a Docker image and deploy it like that to AWS Lambda.

```Dockerfile
FROM gcr.io/distroless/base
FROM gcr.io/distroless/base-debian12
COPY lambda-example/target/graalvm-native-image/zio-lambda-example /app/zio-lambda-example
CMD ["/app/zio-lambda-example"]
```
Expand Down
Loading