In preparation for the 2.0.0 GA release,
- Update `.swift-version`, `Package.swift` and all examples'
`package.swift` to Swift 6.2
- Update all references to `2.0.0-beta.3` to `2.0.0`. This includes the
doc and readme, but also the dependencies in the examples
`Package.swift`. This will temporary break the build of the examples,
until we tag v2.0.0. Note the CI will not be affected as its consumes
the local version of the library
- [CI] Use Swift-6.2-noble for all testing tasks
- Reinstate the script to generate the contributors list and update the
list
re-implement MAX_INVOCATIONS and fix shell script
Fix https://github.com/swift-server/swift-aws-lambda-runtime/issues/377
### Motivation:
In v1, there was a script measuring the performance of the invocation
loop.
Re-instate this script to allow users and developers to measure the
performance impact of their changes.
### Modifications:
I re-implemented MAX_INVOCATIONS, to avoid the client looping against
the Mock Server. But this time, MAX_INVOCATIONS is handled on the
server, not on the client.
I slightly modified the script to work with v2 and the new MockServer.
### Result:
The script works.
This PR has a dependency on
https://github.com/swift-server/swift-aws-lambda-runtime/issues/465
```
note: The majority of content should be under level-3 headers under the "Overview" section
--> Deployment.md:22:1-22:17
20 | * [Third-party tools](#third-party-tools)
21 |
22 + ## Prerequisites
| ╰─suggestion: Change the title to "Overview"
23 |
24 | 1. Your AWS Account
```
and many others.
Action: I lowered all titles one level down.
Remove dependency on XCTest
### Motivation:
As 6.1 does not include XCTest anymore, finish the migration to Swift
testing
### Modifications:
Replace XCTest by Swift Testing in two files
### Result:
`swift test` works on 6.1.2
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
When including resources in the package and packaging on Ubuntu,
`FileManager` throws a FilePermission error. The docker daemon runs as
root and files to be copied are owned by `root` while the archiver runs
as the current user (`ubuntu` on EC2 Ubuntu). The `FileManager` manages
to copy the files but throws an error after the copy. We suspect the
`FileManager` to perform some kind of operation after the copy and it
fails because of the `root` permission of the files.
See
https://github.com/swift-server/swift-aws-lambda-runtime/issues/449#issuecomment-2595978246
for a description of the problem.
This PR contains code to reproduce the problem, a very simple
workaround, and an integration test.
The workaround consists of
- trapping all errors
- verify if the error is the permission error (Code = 513)
- verify if the files have been copied or not
- if the two above conditions are met, ignore the error, otherwise
re-throw it
I would rather prefer a solution that solves the root cause rather than
just ignoring the error.
We're still investigating the root cause (see [this
thread](https://forums.swift.org/t/filemanager-copyitem-on-linux-fails-after-copying-the-files/77282)
on the Swift Forum and this issue on Swift Foundation
https://github.com/swiftlang/swift-foundation/issues/1125
_[One line description of your change]_
### Motivation:
_[Explain here the context, and why you're making that change. What is
the problem you're trying to solve.]_
### Modifications:
_[Describe the modifications you've done.]_
### Result:
_[After your change, what will change.]_
motivation: define stable API in preperation 1.0 release
changes:
* require swift 5.7, remove redundant backwards compatibility code
* make LambdaHandler, EventLoopLambdaHandler, and ByteBufferLambdaHandler disjointed protocols to reduce API surface area
* create coding wrappers for LambdaHandler and EventLoopLambdaHandler to provide bridge to ByteBufferLambdaHandler
* reuse output ByteBuffer to reduce allocations
* add new SimpleLambdaHandler with no-op initializer for simple lambda use cases
* update callsites and tests
* update examples
Co-authored-by: Yim Lee <yim_lee@apple.com>
Co-authored-by: Fabian Fett <fabianfett@apple.com>
motivation: add an easy wasy for lambda users to package their lambda and upload it to AWS
changes:
* add SwiftPM plugin to package the lambda as zipfile, with the verb "archive"
* use docker to build and package the lambda(s) on macOS and non-amazonlinux
* build directly on when on amazonlinux, zip correctly
Co-authored-by: Yim Lee <yim_lee@apple.com>
Co-authored-by: Fabian Fett <fabianfett@apple.com>
Since we already required Swift 5.5 for Concurrency (Xcode 13), it's natural to update the demo app to reflect latest SwiftUI changes, which makes the code neater and more expressive.
* take advantage of @main where possible
* move the top level Sample code to the examples subdirectory
* extract a few examples form the "LambdaFunctions" directory (which is really a deployment demo) and move them to the top level Examples directory
* rename "LambdaFunctions" examples as "Deployments" to make their intent clearer
* add a sample that demonstrates how to test a lambda now that SwiftPM can test executables directly
* update the test-sample docker setup to build & test th new samples
* fix a few typos and In/Out typealias left overs
* remove LinuxMain since its no longer required
Modifications:
- Replace `HTTPHandler` with `NIOHTTPClientResponseAggregator`, to fix a CoW issue. This increases performance.
- Ensure that we only use one `EventLoop` in tests.
- Use `syncOperations` to setup the `HTTPClient`.
motivation: align with swift project coc update
changes: update coc to the version used by the swift project (contributor-covenant.org 1.4)
Update 0226-package-manager-target-based-dep-resolution.md
Co-authored-by: Konrad `ktoso` Malawski <ktoso@apple.com>
motivation: keep script up to date
changes:
* use 5.3 nightly
* better support for perf symlink as the location is a moving target
* info about cold/warm start
motivation: demonstrate how to deploy with SAM
changes:
* Add a SAM template for deploying the lambdas to AWS.
* Updated README with instructions on how to do this.
motivation: easier to reason about examples
changes:
* move each example to its own target
* update deployment script to prompt for desired target when multiple targets exist
* add code comments on what the example is about
* add feature-reach example (CurrencyExchange) to help testing use of Foundation features that require curl and libxml
motivation: unique, accurate name
changes:
* rename project to SwiftAWSLambdaRuntime
* rename main module to AWSLambdaRuntime
* rename / simplify sample module names
* adjust readme and scripts
motivation: amazon linux support will land in 5.2
changes:
* remove inline as its default in 5.2
* remove linux test and lean on --enable-test-discovery
* adjust package syntax
* format code to match 5.2
motivation: enable CI
changes: add docker files support for ubuntu 16.04 and 18.04 and swift 5.0 and 5.1
note that eventyally this will need to move to AL2 docker images, but we dont have official ones yet
motivation: better performance
changes:
* simply url configuration to ip and port so we can reoslve the socket add ress faster
* skip happy eyeballs
* limit eventloop group to 1 thread
* remove use of UUID and URL
* fix backtrace url
motivation: benchmark for comparison of warm/cold runs
changes:
* refactor configuration
* add mock server that can be used by perf tests
* add simple perf test script
* change redundant classes to structs, make remaining classes final
* make offloading opt-in
* safer locking
* fix format
motivation: make code simpler to reason about, better use of swift-nio
changes:
* remove main loop on global queue + wait, replace with recursion
* make better use of EvenLoopFuture, instead of result types to signal errors
* inject lifecycleId so we can share offloading queue
* improve logging
* adjust and improve tests
* update sanity and generate linux tests script to work better with dates and swiftformat