219 Commits

Author SHA1 Message Date
Sébastien Stormacq 11756b4e00 Update readme.md
Change instruction to use branch v1 in Package.swift
2024-10-08 11:24:09 +02:00
Andrea Scuderi 5ecc24fa54 Add Breeze to projects.md (#343)
authored-by: Andrea Scuderi <andrea.scuderi@ymail.com>
1.0.0-alpha.3
2024-08-26 13:00:07 +02:00
Sébastien Stormacq 8676c8933a apply swiftformat (#342)
* apply swiftformat

* update dep on Swift Docc to v1.3.0

* force usage of swift docc plugin 1.3.0
2024-08-26 12:25:41 +02:00
Alessio Buratti 79fa2c2bee [Draft] Detached tasks (#334)
* First prototype

* Fix build

* Removes task cancellation

https://github.com/swift-server/swift-aws-lambda-runtime/pull/334#discussion_r1666713889

* Force user to handle errors

https://github.com/swift-server/swift-aws-lambda-runtime/pull/334#discussion_r1666712903

* Remove EventLoop API

https://github.com/swift-server/swift-aws-lambda-runtime/pull/334#discussion_r1666712244

* Make DetachedTaskContainer internal

https://github.com/swift-server/swift-aws-lambda-runtime/pull/334#discussion_r1666710596
https://github.com/swift-server/swift-aws-lambda-runtime/pull/334#discussion_r1666706576

* Removes @unchecked Sendable

https://github.com/swift-server/swift-aws-lambda-runtime/pull/334#discussion_r1666707646

* Invoke awaitAll() from async context

* Fix ambiguous expression type for swift 5.7

* Fix visibility of detachedBackgroundTask

* Add swift-doc

* Add example usage to readme

* Add tests

---------

Co-authored-by: Sébastien Stormacq <sebastien.stormacq@gmail.com>
2024-08-23 18:50:22 +02:00
Sven A. Schmidt ed72bdda8d Update projects.md (#337)
Co-authored-by: Sébastien Stormacq <sebastien.stormacq@gmail.com>
2024-08-07 10:39:53 +02:00
Tim Condon a5c144fc76 Update projects.md to add Penny (#338) 2024-08-07 10:38:21 +02:00
Adolfo d6e6819b36 Examples list documents (#336)
First version of projects.md file
2024-08-07 08:32:59 +02:00
Sébastien Stormacq f42dda3fca Update soundness.sh to support 2024 and 2025 (#335) 2024-08-05 18:01:17 +02:00
Camden Fullmer 35e0919ed2 Add support for resources when packaging using the SwiftPM plugin (#333)
* Add support for resources when packaging using the SwiftPM plugin.

* Copy the resources directory to the working directory instead of recreating the directroy structure.

* Add resource packaging example.

* Use the bundle's url function to locate the file url.

* Fix year for soundness check.

---------

Co-authored-by: Sébastien Stormacq <sebastien.stormacq@gmail.com>
2024-08-05 17:51:21 +02:00
Sébastien Stormacq 872183bbe9 allow compilation with the static linux sdk (musl) (#331) 2024-06-26 10:09:25 +02:00
Sven A. Schmidt 0d4716d30c Fix compile error on Windows (#328) 2024-06-19 18:29:40 +02:00
Sébastien Stormacq cb09b958ee add LOCAL_LAMBDA_SERVER_INVOCATION_ENDPOINT to the readme (#326) 2024-05-22 15:34:41 +02:00
Sébastien Stormacq 294d06bfd4 Use LAMBDA_USE_LOCAL_DEPS env var in local builds with docker (#325) 2024-05-22 14:55:42 +02:00
jsonfry 17a993e3b1 Local lambda invocation endpoint env var (#321)
add #321
2024-05-22 14:37:53 +02:00
Sébastien Stormacq 221978224c Add tracing of request events + mention LOG_LEVEL in README (#315)
* add tracing of request events + mention LOG_LEVEL in README

* fix typo

Co-authored-by: Mahdi Bahrami <github@mahdibm.com>

* clarify the use of env variable and the swift cli

Co-authored-by: Mahdi Bahrami <github@mahdibm.com>

* clarify language about HTTP server

Co-authored-by: Mahdi Bahrami <github@mahdibm.com>

* formatting

Co-authored-by: Mahdi Bahrami <github@mahdibm.com>

* factor in additional suggestions from @mahdibm

* combine two logger statement into one and print only for Kb of payload

---------

Co-authored-by: Mahdi Bahrami <github@mahdibm.com>
2024-05-15 09:56:35 +02:00
Marwane Koutar e6a59c2cf0 fixed typo in readme (#319)
* fixed typo in readme

* fixed typo in readme (upload -> uploaded)
2024-02-28 09:34:06 -08:00
tomer doron 8d9f44b783 allow custom initialization of the HandlerType of the LambdaRuntime (#310)
Motivation:

Provide the flexibility for custom initialization of the HandlerType as this will often be required by higher level frameworks.

Modifications:
* Modify the LambdaRuntime type to accept a closure to provide the handler rather than requiring that it is provided by a static method on the Handler type
* Update downstream code to use HandlerProvider
* Update upstream code to support passing Handler Type of Handler Provider
* Add and update tests

Originally suggested and coded by @tachyonics in https://github.com/swift-server/swift-aws-lambda-runtime/pull/308
1.0.0-alpha.2
2024-01-18 13:48:10 -08:00
Sébastien Stormacq c4f380e21c Include the docc tutorial into 1.0.0 (#316)
Improved getting started documentation, with DocC
2023-12-18 12:16:44 -08:00
tomer doron 42eaaf4fb1 remove redundant pre-concurrency flag (#314)
motivation: address warnings

changes:
* remove pre-concurrency flag when not longer needed
2023-12-18 11:49:03 -08:00
tachyonics 0fbd8448af Don't log work fetching failure at error. (#313) 2023-12-08 12:49:03 -08:00
Florent Morin 2c3b2451db Add --disable-docker-image-update plugin flag (#311)
motivation: sometimes, you need to use a customized local docker image and `docker pull` don’t have to be called

changes:
* add `--disable-docker-image-update` plugin flag to disable `docker pull` call
2023-12-01 11:27:41 -08:00
tomer doron f3eac3167a add 5.10 ci setup (#309)
motivaiton: test for upcoming 5.10 release

changes: add docker setup for stable 5.9 and nightly 5.10
2023-10-10 14:36:19 -07:00
Sébastien Stormacq c85c875593 [doc] Getting Started documentation and tutorial (#300)
improved getting started documentation, with DocC
2023-09-11 10:43:06 -07:00
Sébastien Stormacq 5d300b2e1b ignore swift files part of docc (#307) 2023-09-11 09:30:19 -07:00
tomer doron e221dd8362 remove swift-backtrace in swift >= 5.9 (#305)
motivation: swift 5.9 ships with builtin backtrace support \o/

changes:
* remove the dependency on swift-backtrace when using swift 5.9 or above
* conditionalize the call to Backtrace.install to relevant versions only
2023-09-07 18:39:11 -07:00
tomer doron e7751d0afb update code of conduct (#303)
motivation: align CoC across the swift project

changes: change CoC to link to the swift.org version
2023-06-06 10:28:39 -07:00
Joannis Orlandos 8e0eae1202 Fix a dead tutorial link (#301) 2023-04-18 09:28:43 -07:00
Yim Lee 50c4ec90a5 Swift 5.8 docker images are available (#298)
* Swift 5.8 docker images are available

* Add docker-compose file for Swift 5.9

* Fix image name
2023-04-04 14:47:56 -07:00
tomer doron 3b72f6a6cf improve examples (#292)
motivation: examples can be confusing since they use relative path to the library for CI purposes

changes:
* update examples to use the library URL, expect when env variable is set for CI purposes
* rename docker compose job to test-examples since it is more accurate
2023-03-12 11:23:41 -07:00
Adolfo fb860605a8 Issue template v2 (#290)
Use issue Report v2: Issue template using the GitHub Forms syntax.
2023-02-23 09:10:58 -08:00
Adolfo 5dc0da0e30 Archive plugin documentation (#287)
Improve archive command documentation 

* Show the options that the new `archive` plugin provides to customize the operation behavior.
* Provide an example with the `archive` command taking two parameters
2023-02-22 09:48:30 -08:00
Adolfo 81762b0e45 Change the SQS.Event to the valid SQSEvent type at the SimpleLambdaHandler example (#286) 2023-02-09 00:27:54 -08:00
tomer doron 735c49f28d add docker compose setup for swift 5.8 (#284)
motivation: prepare for swift 5.8

changes: add docker compose setup for nightly 5.8
2023-01-25 18:47:27 -08:00
Camden Fullmer 58664bd23b Add note about naming the file main.swift. (#283) 2023-01-17 16:41:36 -08:00
tomer doron de730b240d udpate readme to reflect 1.x API (#281)
motivation: prepare documentation in preparation for 1.x release

changes: update readme with  1.x APIs

Co-authored-by: Yim Lee <yim_lee@apple.com>
1.0.0-alpha.1
2023-01-12 09:50:25 -08:00
tomer doron a5fb165f65 fix concurrency api usage (#282)
motivation: cleanup incorrect concurent code in test

changes: use .get instead of .wait
2023-01-10 16:24:11 -08:00
Yim Lee dc64ce195b Add .spi.yml for Swift Package Index DocC support (#274) 2022-12-04 09:28:25 -08:00
tomer doron c915322eca API Refactoring (#273)
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>
2022-11-09 10:08:36 -08:00
Yim Lee 98a23b64bb DocC setup (#270) 2022-08-21 20:29:08 -07:00
sja26 568897c8b7 Update readme (#269)
* Fix compiler warning

'MyLambda' was identified as an executable target given the presence of a 'main.swift' file. Starting with tools version 5.4.0 executable targets should be declared as 'executableTarget()'

* Fix package dependency for swift-aws-lambda-events

The swift-aws-lambda-events repo has not yet pushed tag 0.1.0 so the build fails, see output from swift build:

Computing version for https://github.com/swift-server/swift-aws-lambda-events.git
error: Dependencies could not be resolved because no versions of 'swift-aws-lambda-events' match the requirement 0.1.0..<1.0.0 and root depends on 'swift-aws-lambda-events' 0.1.0..<1.0.0.

This commit adds the workaround mentioned in the issue for the missing tag https://github.com/swift-server/swift-aws-lambda-events/issues/3

* Fix multiple products and targets build error
2022-08-11 10:16:03 -07:00
YR Chen cb340de265 Fix performance test script (#264) 2022-06-06 09:39:40 -07:00
tomer doron 81f8d27365 packaging plugin (#254)
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>
2022-06-01 09:41:05 -07:00
Bill 20978cc462 Add special Deployment instructions for the Mac M1 (#263) 2022-05-09 10:19:30 -07:00
Fabian Fett ac52960abd Initialize LambdaRuntime with concrete HandlerType + Docu fixes (#260) 2022-04-20 22:14:03 +02:00
Fabian Fett cebcf04d23 Drop Swift 5.2 and 5.3 (#262)
As outlined in a [Swift forums post in November ’21](https://forums.swift.org/t/swiftnio-swift-version-support/53232), SwiftNIO will only support the latest non-patch Swift release and the 2 immediately prior non-patch versions.
2022-04-20 22:02:24 +02:00
Fabian Fett f6c7c5a852 Add script to check for API breaks (#258)
Co-authored-by: tomer doron <tomer@apple.com>
2022-04-15 10:36:12 -07:00
tomer doron e5b44962bd Prefix data structures with Lambda instead of namespacing them (#256)
motivation: consisten naming convention

changes:
* Lambda.InitializationContext -> LambdaInitializationContext
* Lambda.Runner -> LambdaRunner
* Lambda.Configuration -> LambdaConfiguration
* Lambda.RuntimeError -> LambdaRuntimeError
* adjust call sites, tests, and examples
2022-04-15 13:33:54 +02:00
tomer doron d35e827121 Remove extension for JSONEncoder and JSONDecoder (#257)
motivation: we should not publicly extend types we do not own

change: remove extensions which are largely API sugar that is not directly related to Lambda
2022-04-15 13:05:49 +02:00
tomer doron 3c3529b4dc adoption of sendable (#252)
motivation: adopt to sendable requirments in swift 5.6

changes:
* define sendable shims for protocols and structs that may be used in async context
* adjust tests
* add a test to make sure no warning are emitted
2022-04-14 09:39:00 -07:00
tomer doron 4d0bba4617 termination handler (#251)
motivation: make it simpler to register shutdown hooks

changes:
* introduce Terminator helper that allow registering and de-registaring shutdown handlers
* expose the new terminator hanler on the InitializationContext and deprecate ShutdownContext
* deprecate the Handler::shutdown protocol requirment
* update the runtime code to use the new terminator instead of calling shutdown on the handler
* add and adjust tests
2022-04-13 12:16:26 -07:00