Skip to content

Commit

Permalink
Merge pull request #281 from zio/fix_readme_links
Browse files Browse the repository at this point in the history
Fix README links
  • Loading branch information
jrmsamson authored Oct 8, 2024
2 parents 32e11a1 + 79d7bc0 commit 39aefd7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ A ZIO-based AWS Custom Runtime compatible with GraalVM Native Image.

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

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

## Usage
Expand Down Expand Up @@ -52,10 +52,10 @@ 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](docs/https://user-images.githubusercontent.com/14280155/164102664-3686e415-20be-4dd9-8979-ea6098a7a4b9.png)
![create-lambda](https://user-images.githubusercontent.com/14280155/164102664-3686e415-20be-4dd9-8979-ea6098a7a4b9.png)
2. Run `sbt GraalVMNativeImage/packageBin`, we'll find the binary present under the `graalvm-native-image` folder:

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

3. Create the following bootstap file (which calls out to the binary) and place it in the same directory alongside the binary:
```bash
Expand All @@ -66,7 +66,7 @@ Each release will contain a zip file ready to be used as a lambda layer) and you
./zio-lambda-example
```

![bootstrap-alongside-native-binary](docs/https://user-images.githubusercontent.com/14280155/164103935-0bf7a6cb-814d-4de1-8fa1-4d0d54fb6e88.png)
![bootstrap-alongside-native-binary](https://user-images.githubusercontent.com/14280155/164103935-0bf7a6cb-814d-4de1-8fa1-4d0d54fb6e88.png)

4. Now we can zip both these files up:
```log
Expand All @@ -77,11 +77,11 @@ Each release will contain a zip file ready to be used as a lambda layer) and you

5. Take `upload.zip` and upload it to AWS Lambda and test your function:

![lambda-ui](docs/https://user-images.githubusercontent.com/14280155/164104747-039ec584-d3e2-4b47-884d-ff88977e2b53.png)
![lambda-ui](https://user-images.githubusercontent.com/14280155/164104747-039ec584-d3e2-4b47-884d-ff88977e2b53.png)

6. Test everything out to make sure everything works:

![test-ui](docs/https://user-images.githubusercontent.com/14280155/164104858-a720ac55-b9bb-47ec-af70-c4bd5eb5bed3.png)
![test-ui](https://user-images.githubusercontent.com/14280155/164104858-a720ac55-b9bb-47ec-af70-c4bd5eb5bed3.png)

## Deployment of native image binary in a Docker container

Expand Down Expand Up @@ -114,13 +114,13 @@ docker push <your-particular-ecr-image-repository>:<your-tag>

Here is an example:

![image-uploaded](docs/https://user-images.githubusercontent.com/14280155/164120591-68a78d19-c56b-4793-96b8-cfe567443063.png)
![image-uploaded](https://user-images.githubusercontent.com/14280155/164120591-68a78d19-c56b-4793-96b8-cfe567443063.png)

Create a Lambda function and choose container image:

![lambda-create-container-image](docs/https://user-images.githubusercontent.com/14280155/164120637-9c827736-26a8-4c65-92d4-2919157bbda6.png)
![lambda-create-container-image](https://user-images.githubusercontent.com/14280155/164120637-9c827736-26a8-4c65-92d4-2919157bbda6.png)

![image](docs/https://user-images.githubusercontent.com/14280155/164120764-2c736a46-29e3-488c-ba6a-e2b69ef51792.png)
![image](https://user-images.githubusercontent.com/14280155/164120764-2c736a46-29e3-488c-ba6a-e2b69ef51792.png)

Please note that because you incur the overhead of your native binary residing within a Docker container, there is more overhead than the other approach of deploying the binary straight to AWS Lambda

Expand Down
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12")
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.6")
addSbtPlugin("com.github.sbt" % "sbt-native-packager" % "1.9.16")
addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.4.4")
addSbtPlugin("dev.zio" % "zio-sbt-website" % "0.3.10")
addSbtPlugin("dev.zio" % "zio-sbt-website" % "0.3.9")

resolvers += Resolver.sonatypeRepo("public")

0 comments on commit 39aefd7

Please sign in to comment.