Closed darylteo closed 1 month ago
We recently discussed options on the Swift Server Side slack https://swift-open-source.slack.com/archives/C5GMX4LP9/p1678653994596389
TL;DR : Lambda Layers should work (@Andrea-Scuderi has a working example)
About compiling at first execution. I don't think it is a good idea. Cold startup time will be terrible (several minutes depending on the number of dependencies and the size of your project) and you will have to install the Swift toolchain in the Lambda runtime anyway .... so even more Docker
Yes, you can see the example here, but I removed the layers from the master branch as the deployment process is more difficult. The cons of the Layer is that you need to prepare the layers and the code from the same Docker builder environment.
@darylteo There is no more traffic since 1 year, I think the question has been answered. Can we close this ?
Could this be potentially solved by supporting a Lambda Layer that comes with the latest ICU libraries (and other runtime libs) that a Swift binary could link to, to reduce the zip size of the actual lambda itself?
https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html#configuration-layers-path
It could also be interesting to evaluate the cold start performance of upload pre-compiled vs uploading scripts for compiling, if all the tools for Swift is bundled as a custom Runtime instead... and also remove the requirement of Docker for deployment.