Hi, I'm excited to share what I've been working on for the last two months or so.
Swift on Amazon Linux
I got Swift to compile on Amazon Linux 2. You can download the binaries from my website. If you want to see how the sausage is made, all scripts and Dockerfiles are public on GitHub. I would like to automate this process in so far that after a Swift release the whole release process is automated.
Swift on Amazon Linux Dockerimages
Another part of the amazonlinux-swift effort is to provide Dockerimages for your convenience at DockerHub to make compiling your Swift code for Amazon Linux 2 snappy.
Swift Lambda Layer
Even though I only made Swift compile on Amazon Linux 2, the libraries needed for running Swift are ABI compatible (pure luck, not official) with Amazon Linux 1. (Amazon Linux 1 is the operating system in which Lambdas without AWS provided runtime are executed.) Amazon Linux 1 is nearing end of life with support dropping on June 30, 2020. With this being said, AWS has to switch the underlying execution operating system to Amazon Linux 2 within the next 6 months. (They already have done that for node.js and Java)
Thanks to Swift running even on Amazon Linux 1, I have been able to create a Swift Amazon Linux Layer that links against Amazon Linux system libraries. The layer comes without any bootstrap and can be used in whatever way. You should bebe aware that you need an entrypoint (any executable named
bootstrap) for execution. The Layers have already been uploaded in most AWS-Regions and are public for use in your Lambdas.
The scripts to create and distribute the Layers are part of the amazonlinux-swift project as well.
Since it is really just the Swift execution environment, it can be used with @Andrea-Scuderi's or @tonisuter's runtime. Since libFoundationNetworking links against the system's libcurl even https calls with NSURLSession are possible.
Swift-NIO opinionated AWS Lambda Runtime
I've created my own take on an AWS Lambda runtime called
swift-lambda-runtime that builds on top of
AsyncHTTPClient. The interface is Swift-NIO centric enabling the use of
EventLoopFutures and an integration with
swift-log. It includes a short tutorial on how to get your first Lambda running on AWS.
I'd be grateful for your feedback and hope that some of you enjoy this. I'm open to new contributors to this effort, just reach out.