Native images, to the cloud!
To try it out, start by installing to local repo:
./gradlew publishToMavenLocal publishPluginMavenPublicationToMavenLocal
Then check out an example that deploys a native service.
This is my own toolkit for serverless development. I have split it out from a hobby project to make it more stand-alone.
It is designed to speed up development of small-ish Java-based applications to AWS Lambda, running as native images.
These can be used by lambdas you want to deploy, but they are not required:
uplift-kernel
contains various utilitiesuplift-flogs
contains mininmal, faked implementations of the dreaded slfj4 and apache commons logger interfaces. These will forward to the Java logging library. No other logging libraries needed, and no dynamic classloading needed to get started. The application can use the familiar slf4j API.uplift-json
contains a minimal JSON parser. Why not, right? It can read and writeMap
andList
structures. It is no Jackson substitute, but it has none of that startup time either.uplift-s3
contains home-made, artisan code to talk to S3. No need for AWS libraries, for most use cases.uplift-lambda
handles setup of the infrastructure between AWS Lambda and your application, providing a simple functional hook which receives a lambda payload, and returns a response. No AWS libraries in use here, either.
Using these libraries is optional, but they can help keep time and space constraints. In particular, the time taken to start up a Java-based runtime.
uplift-flambda
contains a faked lambda service, which can be used for testing.uplift-asynchttp
contains a cough async http server, because the world needed one more of those.
None of these are required, but I use them. Personal learning opportunities may have trumped conventional choices in some of the more interesting places.
Gradle plugins:
lambda-native
builds a native binary in zip form, which is what AWS wants to deploy. It sets up images needed to build anaarch64
oramd64
type binary for Linux.uplift
deploys your app to Lambda, given AWS credentials, a region and- the directory containing your credentials (by default the one in
~/.aws
/$HOME
) - optionally a profile in this file (by defalt
default
) - a running docker daemon
- the directory containing your credentials (by default the one in
The plugins will handle docker moves required to download and build native images with graal, and to deploy to AWS with
aws-cdk
.
Some example apps:
hello-web
is a simple, web-based hello world.- Responds to a GET HTTP request from the browser, with a friendly hello.
- Uses
uplift-flambda
to test the lambda function.
Possible upcoming stuff:
uplift-cdk
should provide some more help with setting up the stack.