diff --git a/.github/workflows/aws-deploy.yml b/.github/workflows/aws-deploy.yml index 8516f68685..9a006ac4c1 100644 --- a/.github/workflows/aws-deploy.yml +++ b/.github/workflows/aws-deploy.yml @@ -60,7 +60,6 @@ jobs: env: AWS_REGION: ${{ inputs.environment == 'DEV' && secrets.AWS_DEV_REGION || inputs.environment == 'PROD' && secrets.AWS_PROD_REGION }} LAMBDA_PERF_ENV: ${{ inputs.environment == 'PROD' && 'production' || 'dev' }} - SKIP_SNAPSTART: ${{ (inputs.environment == 'DEV') && secrets.SKIP_SNAPSTART_DEV || 'false' }} GITHUB_AUTH_TOKEN: ${{ inputs.environment == 'PROD' && secrets.GH_AUTH_TOKEN || 'no-token-needed' }} AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }} run: cd cdk && yarn install && cdk bootstrap && cdk deploy LambdaPerfStack --require-approval never \ No newline at end of file diff --git a/.gitignore b/.gitignore index 3968ce43cc..7d06dd2d17 100644 --- a/.gitignore +++ b/.gitignore @@ -9,9 +9,6 @@ s3-uploader/runtimes/dotnet*/src/obj s3-uploader/runtimes/java21/.gradle s3-uploader/runtimes/java21/build s3-uploader/runtimes/java21/bin -s3-uploader/runtimes/java21_snapstart/.gradle -s3-uploader/runtimes/java21_snapstart/build -s3-uploader/runtimes/java21_snapstart/bin s3-uploader/runtimes/java11/.gradle s3-uploader/runtimes/java11/bin s3-uploader/runtimes/java8/.gradle diff --git a/Cargo.lock b/Cargo.lock index b7ed737740..aae38a87f3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,15 +2,6 @@ # It is not intended for manual editing. version = 4 -[[package]] -name = "addr2line" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" -dependencies = [ - "gimli", -] - [[package]] name = "adler" version = "1.0.2" @@ -41,6 +32,12 @@ dependencies = [ "libc", ] +[[package]] +name = "anyhow" +version = "1.0.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61" + [[package]] name = "async-stream" version = "0.3.5" @@ -74,6 +71,12 @@ dependencies = [ "syn", ] +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + [[package]] name = "autocfg" version = "1.1.0" @@ -402,7 +405,7 @@ dependencies = [ "aws-smithy-types", "bytes", "fastrand", - "h2", + "h2 0.3.26", "http 0.2.11", "http-body 0.4.5", "hyper 0.14.27", @@ -480,9 +483,9 @@ dependencies = [ [[package]] name = "aws_lambda_events" -version = "0.16.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52ddb91585253ccc85be3f2e0d5635529efdeadaf8a1da3230b433d3bbe43648" +checksum = "f3cd5d79ca6be17e6cdc157fccf22a0190a8c83ea0e04dc8a4429aea65627740" dependencies = [ "base64 0.22.1", "bytes", @@ -499,18 +502,46 @@ dependencies = [ ] [[package]] -name = "backtrace" -version = "0.3.69" +name = "axum" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +checksum = "8a18ed336352031311f4e0b4dd2ff392d4fbb370777c9d18d7fc9d7359f73871" dependencies = [ - "addr2line", - "cc", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", + "axum-core", + "bytes", + "futures-util", + "http 1.2.0", + "http-body 1.0.0", + "http-body-util", + "itoa", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "serde_core", + "sync_wrapper", + "tower", + "tower-layer", + "tower-service", +] + +[[package]] +name = "axum-core" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59446ce19cd142f8833f856eb31f3eb097812d1479ab224f54d72428ca21ea22" +dependencies = [ + "bytes", + "futures-core", + "http 1.2.0", + "http-body 1.0.0", + "http-body-util", + "mime", + "pin-project-lite", + "sync_wrapper", + "tower-layer", + "tower-service", ] [[package]] @@ -558,28 +589,34 @@ dependencies = [ [[package]] name = "bollard" -version = "0.17.1" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d41711ad46fda47cd701f6908e59d1bd6b9a2b7464c0d0aeab95c6d37096ff8a" +checksum = "899ca34eb6924d6ec2a77c6f7f5c7339e60fd68235eaf91edd5a15f12958bb06" dependencies = [ + "async-stream", "base64 0.22.1", + "bitflags 2.6.0", + "bollard-buildkit-proto", "bollard-stubs", "bytes", + "chrono", "futures-core", "futures-util", "hex", "home", "http 1.2.0", "http-body-util", - "hyper 1.4.0", + "hyper 1.6.0", "hyper-named-pipe", "hyper-rustls 0.27.2", "hyper-util", "hyperlocal", "log", + "num", "pin-project-lite", - "rustls 0.23.10", - "rustls-native-certs 0.7.1", + "rand", + "rustls 0.23.33", + "rustls-native-certs 0.8.1", "rustls-pemfile 2.1.2", "rustls-pki-types", "serde", @@ -589,19 +626,39 @@ dependencies = [ "serde_urlencoded", "thiserror", "tokio", + "tokio-stream", "tokio-util", + "tonic", "tower-service", "url", "winapi", ] +[[package]] +name = "bollard-buildkit-proto" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40b3e79f8bd0f25f32660e3402afca46fd91bebaf135af017326d905651f8107" +dependencies = [ + "prost", + "prost-types", + "tonic", + "ureq", +] + [[package]] name = "bollard-stubs" -version = "1.45.0-rc.26.0.1" +version = "1.48.3-rc.28.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d7c5415e3a6bc6d3e99eff6268e488fd4ee25e7b28c10f08fa6760bd9de16e4" +checksum = "64ea257e555d16a2c01e5593f40b73865cdf12efbceda33c6d14a2d8d1490368" dependencies = [ + "base64 0.22.1", + "bollard-buildkit-proto", + "bytes", + "chrono", + "prost", "serde", + "serde_json", "serde_repr", "serde_with", ] @@ -614,9 +671,9 @@ checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "bytes" -version = "1.6.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" dependencies = [ "serde", ] @@ -692,11 +749,21 @@ dependencies = [ "libc", ] +[[package]] +name = "core-foundation" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "core-foundation-sys" -version = "0.8.4" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" @@ -828,13 +895,13 @@ dependencies = [ [[package]] name = "etcetera" -version = "0.8.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "136d1b5283a1ab77bd9257427ffd09d8667ced0570b6f938942bc7568ed5b943" +checksum = "26c7b13d0780cb82722fd59f6f57f925e143427e4a75313a6c77243bf5326ae6" dependencies = [ "cfg-if", "home", - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] @@ -1057,12 +1124,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "gimli" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" - [[package]] name = "h2" version = "0.3.26" @@ -1082,6 +1143,25 @@ dependencies = [ "tracing", ] +[[package]] +name = "h2" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3c0b69cfcb4e1b9f1bf2f53f95f766e4661169728ec61cd3fe5a0166f2d1386" +dependencies = [ + "atomic-waker", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "http 1.2.0", + "indexmap 2.1.0", + "slab", + "tokio", + "tokio-util", + "tracing", +] + [[package]] name = "hashbrown" version = "0.12.3" @@ -1094,12 +1174,6 @@ version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" -[[package]] -name = "hermit-abi" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" - [[package]] name = "hex" version = "0.4.3" @@ -1192,9 +1266,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.8.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" [[package]] name = "httpdate" @@ -1212,7 +1286,7 @@ dependencies = [ "futures-channel", "futures-core", "futures-util", - "h2", + "h2 0.3.26", "http 0.2.11", "http-body 0.4.5", "httparse", @@ -1228,13 +1302,14 @@ dependencies = [ [[package]] name = "hyper" -version = "1.4.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4fe55fb7a772d59a5ff1dfbff4fe0258d19b89fec4b233e75d35d5d2316badc" +checksum = "cc2b571658e38e0c01b1fdca3bbbe93c00d3d71693ff2770043f8c29bc7d6f80" dependencies = [ "bytes", "futures-channel", "futures-util", + "h2 0.4.12", "http 1.2.0", "http-body 1.0.0", "httparse", @@ -1253,7 +1328,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73b7d8abf35697b81a825e386fc151e0d503e8cb5fcb93cc8669c376dfd6f278" dependencies = [ "hex", - "hyper 1.4.0", + "hyper 1.6.0", "hyper-util", "pin-project-lite", "tokio", @@ -1285,31 +1360,45 @@ checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" dependencies = [ "futures-util", "http 1.2.0", - "hyper 1.4.0", + "hyper 1.6.0", "hyper-util", - "rustls 0.23.10", + "rustls 0.23.33", "rustls-pki-types", "tokio", "tokio-rustls 0.26.0", "tower-service", ] +[[package]] +name = "hyper-timeout" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b90d566bffbce6a75bd8b09a05aa8c2cb1fabb6cb348f8840c9e4c90a0d83b0" +dependencies = [ + "hyper 1.6.0", + "hyper-util", + "pin-project-lite", + "tokio", + "tower-service", +] + [[package]] name = "hyper-util" -version = "0.1.6" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ab92f4f49ee4fb4f997c784b7a2e0fa70050211e0b6a287f898c3c9785ca956" +checksum = "3c6995591a8f1380fcb4ba966a252a4b29188d51d2b89e3a252f5305be65aea8" dependencies = [ "bytes", "futures-channel", + "futures-core", "futures-util", "http 1.2.0", "http-body 1.0.0", - "hyper 1.4.0", + "hyper 1.6.0", + "libc", "pin-project-lite", - "socket2 0.5.5", + "socket2 0.6.1", "tokio", - "tower", "tower-service", "tracing", ] @@ -1322,7 +1411,7 @@ checksum = "986c5ce3b994526b3cd75578e62554abd09f0899d6206de48b3e96ab34ccc8c7" dependencies = [ "hex", "http-body-util", - "hyper 1.4.0", + "hyper 1.6.0", "hyper-util", "pin-project-lite", "tokio", @@ -1519,6 +1608,15 @@ dependencies = [ "serde", ] +[[package]] +name = "itertools" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.9" @@ -1536,20 +1634,18 @@ dependencies = [ [[package]] name = "lambda_runtime" -version = "0.13.0" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed49669d6430292aead991e19bf13153135a884f916e68f32997c951af637ebe" +checksum = "edb1a631df22d6d81314268a94fda06ab15b3fa1fcea660e7c5c162caa8fba6b" dependencies = [ "async-stream", "base64 0.22.1", "bytes", "futures", "http 1.2.0", - "http-body 1.0.0", "http-body-util", "http-serde", - "hyper 1.4.0", - "hyper-util", + "hyper 1.6.0", "lambda_runtime_api_client", "pin-project", "serde", @@ -1558,15 +1654,14 @@ dependencies = [ "tokio", "tokio-stream", "tower", - "tower-layer", "tracing", ] [[package]] name = "lambda_runtime_api_client" -version = "0.11.1" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c90a10f094475a34a04da2be11686c4dcfe214d93413162db9ffdff3d3af293a" +checksum = "dd3ccfa59944d61c20b98892c84d9e0e8118d722a75beaebe68e69db36b4afe1" dependencies = [ "bytes", "futures-channel", @@ -1574,11 +1669,9 @@ dependencies = [ "http 1.2.0", "http-body 1.0.0", "http-body-util", - "hyper 1.4.0", + "hyper 1.6.0", "hyper-util", - "tokio", "tower", - "tower-service", "tracing", "tracing-subscriber", ] @@ -1591,9 +1684,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.168" +version = "0.2.177" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aaeb2981e0606ca11d79718f8bb01164f1d6ed75080182d3abf017e6d244b6d" +checksum = "2874a2af47a2325c2001a6e6fad9b16a53b802102b528163885171cf92b15976" [[package]] name = "libredox" @@ -1643,12 +1736,24 @@ dependencies = [ "regex-automata 0.1.10", ] +[[package]] +name = "matchit" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47e1ffaa40ddd1f3ed91f717a33c8c0ee23fff369e3aa8772b9605cc1d22f4c3" + [[package]] name = "memchr" version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + [[package]] name = "miniz_oxide" version = "0.7.1" @@ -1660,13 +1765,13 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.11" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +checksum = "69d83b0086dc8ecf3ce9ae2874b2d1290252e2a30720bea58a5c6639b0092873" dependencies = [ "libc", "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.48.0", + "windows-sys 0.61.2", ] [[package]] @@ -1679,6 +1784,39 @@ dependencies = [ "winapi", ] +[[package]] +name = "num" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" +dependencies = [ + "num-bigint", + "num-complex", + "num-integer", + "num-iter", + "num-rational", + "num-traits", +] + +[[package]] +name = "num-bigint" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-complex" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" +dependencies = [ + "num-traits", +] + [[package]] name = "num-conv" version = "0.1.0" @@ -1687,40 +1825,42 @@ checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" [[package]] name = "num-integer" -version = "0.1.45" +version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" dependencies = [ - "autocfg", "num-traits", ] [[package]] -name = "num-traits" -version = "0.2.17" +name = "num-iter" +version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" dependencies = [ "autocfg", + "num-integer", + "num-traits", ] [[package]] -name = "num_cpus" -version = "1.16.0" +name = "num-rational" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" dependencies = [ - "hermit-abi", - "libc", + "num-bigint", + "num-integer", + "num-traits", ] [[package]] -name = "object" -version = "0.32.1" +name = "num-traits" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ - "memchr", + "autocfg", ] [[package]] @@ -1854,6 +1994,38 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "prost" +version = "0.13.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2796faa41db3ec313a31f7624d9286acf277b52de526150b7e69f3debf891ee5" +dependencies = [ + "bytes", + "prost-derive", +] + +[[package]] +name = "prost-derive" +version = "0.13.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a56d757972c98b346a9b766e3f02746cde6dd1cd1d1d563472929fdd74bec4d" +dependencies = [ + "anyhow", + "itertools", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "prost-types" +version = "0.13.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52c2c1bf36ddb1a1c396b3601a3cec27c2462e45f07c386894ec3ccf5332bd16" +dependencies = [ + "prost", +] + [[package]] name = "query_map" version = "0.7.0" @@ -1990,12 +2162,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "rustc-demangle" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" - [[package]] name = "rustc_version" version = "0.4.0" @@ -2032,14 +2198,15 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.10" +version = "0.23.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05cff451f60db80f490f3c182b77c35260baace73209e9cdbbe526bfe3a4d402" +checksum = "751e04a496ca00bb97a5e043158d23d66b5aabf2e1d5aa2a0aaebb1aafe6f82c" dependencies = [ + "log", "once_cell", "ring", "rustls-pki-types", - "rustls-webpki 0.102.5", + "rustls-webpki 0.103.7", "subtle", "zeroize", ] @@ -2053,20 +2220,19 @@ dependencies = [ "openssl-probe", "rustls-pemfile 1.0.4", "schannel", - "security-framework", + "security-framework 2.9.2", ] [[package]] name = "rustls-native-certs" -version = "0.7.1" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a88d6d420651b496bdd98684116959239430022a115c1240e6c3993be0b15fba" +checksum = "7fcff2dd52b58a8d98a70243663a0d234c4e2b79235637849d15913394a247d3" dependencies = [ "openssl-probe", - "rustls-pemfile 2.1.2", "rustls-pki-types", "schannel", - "security-framework", + "security-framework 3.2.0", ] [[package]] @@ -2090,9 +2256,12 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.7.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" +checksum = "229a4a4c221013e7e1f1a043678c5cc39fe5171437c88fb47151a21e6f5b5c79" +dependencies = [ + "zeroize", +] [[package]] name = "rustls-webpki" @@ -2106,9 +2275,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.102.5" +version = "0.103.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a6fccd794a42c2c105b513a2f62bc3fd8f3ba57a4593677ceb0bd035164d78" +checksum = "e10b3f4191e8a80e6b43eebabfac91e5dcecebb27a71f04e820c47ec41d314bf" dependencies = [ "ring", "rustls-pki-types", @@ -2153,7 +2322,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" dependencies = [ "bitflags 1.3.2", - "core-foundation", + "core-foundation 0.9.3", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271720403f46ca04f7ba6f55d438f8bd878d6b8ca0a1046e8228c4145bcbb316" +dependencies = [ + "bitflags 2.6.0", + "core-foundation 0.10.1", "core-foundation-sys", "libc", "security-framework-sys", @@ -2161,9 +2343,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.9.1" +version = "2.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" +checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" dependencies = [ "core-foundation-sys", "libc", @@ -2177,18 +2359,28 @@ checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" [[package]] name = "serde" -version = "1.0.192" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bca2a08484b285dcb282d0f67b26cadc0df8b19f8c12502c13d966bf9482f001" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.192" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6c7207fbec9faa48073f3e3074cbe553af6ea512d7c21ba46e434e70ea9fbc1" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", @@ -2349,6 +2541,16 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "socket2" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17129e116933cf371d018bb80ae557e889637989d8638274fb25622827b03881" +dependencies = [ + "libc", + "windows-sys 0.60.2", +] + [[package]] name = "stable_deref_trait" version = "1.2.0" @@ -2392,15 +2594,21 @@ checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" [[package]] name = "syn" -version = "2.0.68" +version = "2.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "901fa70d88b9d6c98022e23b4136f9f3e54e4662c3bc1bd1d84a42a9a0f0c1e9" +checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] +[[package]] +name = "sync_wrapper" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" + [[package]] name = "synstructure" version = "0.13.1" @@ -2414,9 +2622,9 @@ dependencies = [ [[package]] name = "testcontainers" -version = "0.23.1" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f40cc2bd72e17f328faf8ca7687fe337e61bccd8acf9674fa78dd3792b045e1" +checksum = "b92bce247dc9260a19808321e11b51ea6a0293d02b48ab1c6578960610cfa2a7" dependencies = [ "async-trait", "bollard", @@ -2438,23 +2646,24 @@ dependencies = [ "tokio-stream", "tokio-tar", "tokio-util", + "ulid", "url", ] [[package]] name = "thiserror" -version = "1.0.61" +version = "2.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.61" +version = "2.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" dependencies = [ "proc-macro2", "quote", @@ -2514,28 +2723,26 @@ dependencies = [ [[package]] name = "tokio" -version = "1.38.2" +version = "1.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68722da18b0fc4a05fdc1120b302b82051265792a1e1b399086e9b204b10ad3d" +checksum = "ff360e02eab121e0bc37a2d3b4d4dc622e6eda3a8e5253d5435ecf5bd4c68408" dependencies = [ - "backtrace", "bytes", "libc", "mio", - "num_cpus", "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.5", + "socket2 0.6.1", "tokio-macros", - "windows-sys 0.48.0", + "windows-sys 0.61.2", ] [[package]] name = "tokio-macros" -version = "2.3.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" +checksum = "af407857209536a95c8e56f8231ef2c2e2aff839b22e07a1ffcbc617e9db9fa5" dependencies = [ "proc-macro2", "quote", @@ -2558,16 +2765,16 @@ version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "rustls 0.23.10", + "rustls 0.23.33", "rustls-pki-types", "tokio", ] [[package]] name = "tokio-stream" -version = "0.1.15" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" +checksum = "eca58d7bba4a75707817a2c44174253f9236b2d5fbd055602e9d5c07c139a047" dependencies = [ "futures-core", "pin-project-lite", @@ -2603,17 +2810,49 @@ dependencies = [ "tracing", ] +[[package]] +name = "tonic" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e581ba15a835f4d9ea06c55ab1bd4dce26fc53752c69a04aac00703bfb49ba9" +dependencies = [ + "async-trait", + "axum", + "base64 0.22.1", + "bytes", + "h2 0.4.12", + "http 1.2.0", + "http-body 1.0.0", + "http-body-util", + "hyper 1.6.0", + "hyper-timeout", + "hyper-util", + "percent-encoding", + "pin-project", + "prost", + "socket2 0.5.5", + "tokio", + "tokio-stream", + "tower", + "tower-layer", + "tower-service", + "tracing", +] + [[package]] name = "tower" -version = "0.4.13" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" dependencies = [ "futures-core", "futures-util", - "pin-project", + "indexmap 2.1.0", "pin-project-lite", + "slab", + "sync_wrapper", "tokio", + "tokio-util", "tower-layer", "tower-service", "tracing", @@ -2621,15 +2860,15 @@ dependencies = [ [[package]] name = "tower-layer" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" [[package]] name = "tower-service" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" @@ -2718,6 +2957,16 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +[[package]] +name = "ulid" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "470dbf6591da1b39d43c14523b2b469c86879a53e8b758c8e090a470fe7b1fbe" +dependencies = [ + "rand", + "web-time", +] + [[package]] name = "unicode-ident" version = "1.0.12" @@ -2730,6 +2979,21 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" +[[package]] +name = "ureq" +version = "2.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02d1a66277ed75f640d608235660df48c8e3c19f3b4edb6a263315626cc3c01d" +dependencies = [ + "base64 0.22.1", + "log", + "once_cell", + "rustls 0.23.33", + "rustls-pki-types", + "url", + "webpki-roots 0.26.11", +] + [[package]] name = "url" version = "2.5.4" @@ -2862,6 +3126,34 @@ version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d046c5d029ba91a1ed14da14dca44b68bf2f124cfbaf741c54151fdb3e0750b" +[[package]] +name = "web-time" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki-roots" +version = "0.26.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "521bc38abb08001b01866da9f51eb7c5d647a19260e00054a8c7fd5f9e57f7a9" +dependencies = [ + "webpki-roots 1.0.3", +] + +[[package]] +name = "webpki-roots" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32b130c0d2d49f8b6889abc456e795e82525204f27c42cf767cf0d7734e089b8" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "winapi" version = "0.3.9" @@ -2893,6 +3185,12 @@ dependencies = [ "windows-targets 0.48.5", ] +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + [[package]] name = "windows-sys" version = "0.48.0" @@ -2920,6 +3218,24 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.5", +] + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] + [[package]] name = "windows-targets" version = "0.48.5" @@ -2944,13 +3260,30 @@ dependencies = [ "windows_aarch64_gnullvm 0.52.6", "windows_aarch64_msvc 0.52.6", "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm", + "windows_i686_gnullvm 0.52.6", "windows_i686_msvc 0.52.6", "windows_x86_64_gnu 0.52.6", "windows_x86_64_gnullvm 0.52.6", "windows_x86_64_msvc 0.52.6", ] +[[package]] +name = "windows-targets" +version = "0.53.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" +dependencies = [ + "windows-link", + "windows_aarch64_gnullvm 0.53.1", + "windows_aarch64_msvc 0.53.1", + "windows_i686_gnu 0.53.1", + "windows_i686_gnullvm 0.53.1", + "windows_i686_msvc 0.53.1", + "windows_x86_64_gnu 0.53.1", + "windows_x86_64_gnullvm 0.53.1", + "windows_x86_64_msvc 0.53.1", +] + [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" @@ -2963,6 +3296,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" + [[package]] name = "windows_aarch64_msvc" version = "0.48.5" @@ -2975,6 +3314,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" + [[package]] name = "windows_i686_gnu" version = "0.48.5" @@ -2987,12 +3332,24 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" +[[package]] +name = "windows_i686_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" + [[package]] name = "windows_i686_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" + [[package]] name = "windows_i686_msvc" version = "0.48.5" @@ -3005,6 +3362,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" +[[package]] +name = "windows_i686_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" + [[package]] name = "windows_x86_64_gnu" version = "0.48.5" @@ -3017,6 +3380,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" + [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" @@ -3029,6 +3398,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" + [[package]] name = "windows_x86_64_msvc" version = "0.48.5" @@ -3041,6 +3416,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" + [[package]] name = "wit-bindgen-rt" version = "0.33.0" diff --git a/README.md b/README.md index db09e5a8ae..6e95251c48 100644 --- a/README.md +++ b/README.md @@ -33,11 +33,8 @@ An ultra simple hello-world function has been written in each AWS supported runt - `dotnet6` - `dotnet8` - `java11` -- `java11 + snapstart` - `java17` -- `java17 + snapstart` - `java21` -- `java21 + snapstart` - `ruby3.2` - `ruby3.3` - `ruby3.4` @@ -66,6 +63,8 @@ in addition to the following custom runtimes: Each of this function is packaged in a zip file, uploaded to a S3 bucket. +Note that the SnapStart feature is no longer benchmarked, as using it with a simple hello-world application may not represent a meaningful use case. + ### Step 2 Every day, each function is freshly grabbed from S3, deployed and invoked 10 times as cold starts. diff --git a/cdk/bin/cdk.ts b/cdk/bin/cdk.ts index 603ac27d4b..83f3f17f15 100644 --- a/cdk/bin/cdk.ts +++ b/cdk/bin/cdk.ts @@ -1,7 +1,7 @@ import * as cdk from 'aws-cdk-lib'; import { LambdaPerfStack } from '../lib/lambda-perf-stack'; -const requiredEnvVars = ['AWS_ACCOUNT_ID', 'AWS_REGION', 'SKIP_SNAPSTART', 'GITHUB_AUTH_TOKEN', 'LAMBDA_PERF_ENV']; +const requiredEnvVars = ['AWS_ACCOUNT_ID', 'AWS_REGION', 'GITHUB_AUTH_TOKEN', 'LAMBDA_PERF_ENV']; const missingEnvVars = requiredEnvVars.filter(envVar => !process.env[envVar]); if (missingEnvVars.length > 0) { throw new Error(`Missing required environment variables: ${missingEnvVars.join(', ')}`); @@ -10,7 +10,6 @@ if (missingEnvVars.length > 0) { const app = new cdk.App(); new LambdaPerfStack(app, 'LambdaPerfStack', { env: { account: process.env.AWS_ACCOUNT_ID, region: process.env.AWS_REGION }, - skipSnapstart: process.env.SKIP_SNAPSTART!!, githubAuthToken: process.env.GITHUB_AUTH_TOKEN!!, lambdaPerfEnv: process.env.LAMBDA_PERF_ENV!!, }); \ No newline at end of file diff --git a/cdk/lib/lambda-perf-stack.ts b/cdk/lib/lambda-perf-stack.ts index 6ace3527a9..edca54287b 100644 --- a/cdk/lib/lambda-perf-stack.ts +++ b/cdk/lib/lambda-perf-stack.ts @@ -11,7 +11,6 @@ import { createRole } from './role'; import * as lambdaEventSources from 'aws-cdk-lib/aws-lambda-event-sources'; interface LambdaPerfStackProps extends cdk.StackProps { - skipSnapstart: string; githubAuthToken: string; lambdaPerfEnv: string; } @@ -51,11 +50,6 @@ export class LambdaPerfStack extends Stack { visibilityTimeout: cdk.Duration.seconds(900), }); - const snapstartDeployerQueue = new sqs.Queue(this, 'LambdaPerfSnapstartDeployerQueue', { - queueName: 'lambda-perf-snapstart-deployer', - visibilityTimeout: cdk.Duration.seconds(900), - }); - const invokerQueue = new sqs.Queue(this, 'LambdaPerfInvokerQueue', { queueName: 'lambda-perf-invoker', visibilityTimeout: cdk.Duration.seconds(900), @@ -82,8 +76,6 @@ export class LambdaPerfStack extends Stack { TABLE_NAME: 'report-log', REPORT_LOG_PROCESSOR_ARN: functionReportLogProcessorRs.functionArn, FUNCTION_QUEUE_NAME: deployerQueue.queueName, - SNAPSTART_QUEUE_NAME: snapstartDeployerQueue.queueName, - SKIP_SNAPSTART: props.skipSnapstart, ACCOUNT_ID: accountId, }, timeout: cdk.Duration.seconds(60), @@ -116,31 +108,6 @@ export class LambdaPerfStack extends Stack { }) ); - const functionSnapstartDeployerRs = new lambda.Function(this, 'FunctionSnapstartDeployerRs', { - runtime: lambda.Runtime.PROVIDED_AL2023, - architecture: lambda.Architecture.ARM_64, - handler: 'bootstrap', - code: lambda.Code.fromAsset('../target/lambda/function-deployer-rs/bootstrap-function-deployer-rs.zip'), - environment: { - ACCOUNT_ID: accountId, - REPORT_LOG_PROCESSOR_ARN: functionReportLogProcessorRs.functionArn, - ROLE_ARN: lambdaRoleArn, - INVOKER_QUEUE_NAME: invokerQueue.queueName, - }, - timeout: cdk.Duration.seconds(900), - role: iam.Role.fromRoleArn(this, 'RoleFunctionSnapstartDeployerRs', lambdaRoleArn), - }); - - snapstartDeployerQueue.grantSendMessages(functionSnapstartDeployerRs); - - functionSnapstartDeployerRs.addEventSource( - new lambdaEventSources.SqsEventSource(snapstartDeployerQueue, { - batchSize: 2, - maxBatchingWindow: cdk.Duration.seconds(120), - maxConcurrency: 2, - }) - ); - const functionInvokerRs = new lambda.Function(this, 'FunctionInvokerRs', { runtime: lambda.Runtime.PROVIDED_AL2023, architecture: lambda.Architecture.ARM_64, @@ -158,7 +125,7 @@ export class LambdaPerfStack extends Stack { functionInvokerRs.addEventSource( new lambdaEventSources.SqsEventSource(invokerQueue, { - batchSize: 3, + batchSize: 6, maxBatchingWindow: cdk.Duration.seconds(30), }) ); diff --git a/cdk/lib/role.ts b/cdk/lib/role.ts index 37bd43743a..ea1c20b864 100644 --- a/cdk/lib/role.ts +++ b/cdk/lib/role.ts @@ -176,7 +176,6 @@ export const createRole = (scope: Construct): string => { actions: ['sqs:SendMessage'], resources: [ `arn:aws:sqs:${region}:${accountId}:lambda-perf-deployer`, - `arn:aws:sqs:${region}:${accountId}:lambda-perf-snapstart-deployer`, `arn:aws:sqs:${region}:${accountId}:lambda-perf-invoker`, ], }, diff --git a/common_lib/manifest.test.snapstart.and.not.snapstart.json b/common_lib/manifest.test.snapstart.and.not.snapstart.json deleted file mode 100644 index 35c213e1c4..0000000000 --- a/common_lib/manifest.test.snapstart.and.not.snapstart.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "memorySizes": [128], - "runtimes": [ - { - "displayName": "java11 snapstart", - "runtime": "java11", - "handler": "io.github.maxday.Handler::handleRequest", - "path": "java_11", - "architectures": ["x86_64"], - "isSnapstart": true - }, - { - "displayName": "java11", - "runtime": "java11", - "handler": "io.github.maxday.Handler::handleRequest", - "path": "java_11", - "architectures": ["x86_64"] - } - ] -} \ No newline at end of file diff --git a/common_lib/manifest.test.snapstart.json b/common_lib/manifest.test.snapstart.json deleted file mode 100644 index 9bf1024955..0000000000 --- a/common_lib/manifest.test.snapstart.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "memorySizes": [128], - "runtimes": [ - { - "displayName": "java11 snapstart", - "runtime": "java11", - "handler": "io.github.maxday.Handler::handleRequest", - "path": "java_11", - "architectures": ["x86_64"], - "isSnapstart": true - } - ] -} \ No newline at end of file diff --git a/common_lib/src/lambda_manager.rs b/common_lib/src/lambda_manager.rs index 9b1819e977..c498fe56c1 100644 --- a/common_lib/src/lambda_manager.rs +++ b/common_lib/src/lambda_manager.rs @@ -3,21 +3,16 @@ use std::{thread, time::Duration}; use async_trait::async_trait; use aws_config::BehaviorVersion; -use aws_sdk_lambda::types::SnapStartApplyOn::PublishedVersions; use aws_sdk_lambda::types::builders::EnvironmentBuilder; use aws_sdk_lambda::{ Client as LambdaClient, - types::{ - Architecture, ImageConfig, PackageType, - builders::{FunctionCodeBuilder, SnapStartBuilder}, - }, + types::{Architecture, ImageConfig, PackageType, builders::FunctionCodeBuilder}, }; use lambda_runtime::Error; use tracing::info; -use crate::retry_manager::RetryManager; use crate::runtime::Runtime; pub struct LambdaManager<'a> { @@ -35,7 +30,6 @@ pub trait FunctionManager { async fn update_function_configuration(&self, function_name: &str) -> Result<(), Error>; async fn invoke_function(&self, function_name: &str) -> Result<(), Error>; async fn publish_version(&self, runtime: &Runtime) -> Result<(), Error>; - async fn create_snapstart_function(&self, runtime: &Runtime) -> Result<(), Error>; async fn create_image_function(&self, runtime: &Runtime) -> Result<(), Error>; async fn create_zip_function(&self, runtime: &Runtime) -> Result<(), Error>; async fn list_versions_by_function(&self, runtime: &Runtime) -> Result, Error>; @@ -110,9 +104,6 @@ impl FunctionManager for LambdaManager<'_> { } async fn create_function(&self, runtime: &Runtime) -> Result<(), Error> { - if runtime.is_snapstart() { - return self.create_snapstart_function(runtime).await; - } if runtime.has_image() { self.create_image_function(runtime).await } else { @@ -152,18 +143,6 @@ impl FunctionManager for LambdaManager<'_> { Ok(()) } - async fn create_snapstart_function(&self, runtime: &Runtime) -> Result<(), Error> { - self.create_zip_function(runtime).await?; - thread::sleep(Duration::from_secs(5)); - let retry = RetryManager::new(3, Duration::from_secs(10), Duration::from_secs(30)); - for i in 0..10 { - retry - .retry_async(|| async { self.snapshot(runtime, i).await }) - .await?; - } - Ok(()) - } - async fn invoke_function(&self, function_name: &str) -> Result<(), Error> { let res = self .client @@ -211,7 +190,7 @@ impl FunctionManager for LambdaManager<'_> { info!("Creating IMAGE function: {}", function_name); info!("Image URI: {}", image_uri); let package_type = PackageType::Image; - let mut res = self + let res = self .client .create_function() .function_name(&function_name) @@ -225,13 +204,6 @@ impl FunctionManager for LambdaManager<'_> { .role(self.role_arn) .memory_size(runtime.memory_size()) .architectures(Architecture::from(runtime.architecture())); - if runtime.is_snapstart() { - res = res.snap_start( - SnapStartBuilder::default() - .apply_on(PublishedVersions) - .build(), - ); - } let res = res.send().await; match res { Ok(_) => Ok(()), @@ -244,7 +216,7 @@ impl FunctionManager for LambdaManager<'_> { info!("Creating ZIP function: {}", function_name); let package_type = PackageType::Zip; let layers = runtime.get_layer_name(self.region); - let mut res = self + let res = self .client .create_function() .function_name(&function_name) @@ -261,13 +233,6 @@ impl FunctionManager for LambdaManager<'_> { .runtime(runtime.runtime()) .handler(runtime.handler()) .set_layers(layers); - if runtime.is_snapstart() { - res = res.snap_start( - SnapStartBuilder::default() - .apply_on(PublishedVersions) - .build(), - ); - } let res = res.send().await; match res { Ok(_) => Ok(()), diff --git a/common_lib/src/manifest.rs b/common_lib/src/manifest.rs index c266b0687d..af146a9bff 100644 --- a/common_lib/src/manifest.rs +++ b/common_lib/src/manifest.rs @@ -23,8 +23,6 @@ pub struct InputRuntime { pub architectures: Vec, pub image: Option, pub layer: Option, - #[serde(default)] - pub is_snapstart: bool, } pub struct ManifestManager { @@ -56,7 +54,6 @@ impl ManifestManager { *memory_size, None, runtime.layer.clone(), - runtime.is_snapstart, ); runtimes.push(zip_runtime); if runtime.image.is_some() { @@ -69,7 +66,6 @@ impl ManifestManager { *memory_size, runtime.image.clone(), None, - false, ); runtimes.push(image_runtime); } @@ -213,24 +209,4 @@ mod tests { )]) ) } - - #[test] - fn test_read_manifest_snapstart() { - let manifest = manifest::ManifestManager::new("manifest.test.snapstart.json"); - let manifest = manifest.read_manifest(); - - assert_eq!(manifest.runtimes.len(), 1); - - assert_eq!(manifest.runtimes[0].display_name(), "java11 snapstart"); - assert_eq!(manifest.runtimes[0].runtime(), LambdaRuntime::Java11); - assert_eq!( - manifest.runtimes[0].handler(), - "io.github.maxday.Handler::handleRequest" - ); - assert_eq!(manifest.runtimes[0].path(), "java_11"); - assert_eq!(manifest.runtimes[0].architecture(), "x86_64"); - assert_eq!(manifest.runtimes[0].memory_size(), 128); - assert!(!manifest.runtimes[0].has_image()); - assert!(manifest.runtimes[0].is_snapstart()); - } } diff --git a/common_lib/src/report_log.rs b/common_lib/src/report_log.rs index 2bbeefcf15..d912712b79 100644 --- a/common_lib/src/report_log.rs +++ b/common_lib/src/report_log.rs @@ -165,22 +165,6 @@ mod tests { assert_eq!(report_log_details.init_duration, "170.13"); } - #[test] - fn test_report_log_details_new_snapstart() { - let report_log = "REPORT RequestId: 1d4e1c44-b211-4a4c-972b-39c8da774f2e Duration: 36.97 ms Billed Duration: 173 ms Memory Size: 128 MB Max Memory Used: 68 MB Restore Duration: 511.56 ms Billed Restore Duration: 136 ms "; - let report_log_details = ReportLogData::new(report_log).unwrap(); - assert_eq!( - report_log_details.request_id, - "1d4e1c44-b211-4a4c-972b-39c8da774f2e" - ); - assert_eq!(report_log_details.duration, "36.97"); - assert_eq!(report_log_details.billed_duration, "173"); - assert_eq!(report_log_details.memory_size, "128"); - assert_eq!(report_log_details.max_memory_used, "68"); - assert_eq!(report_log_details.init_duration, "511.56"); - assert_eq!(report_log_details.billed_restore_duration, "136"); - } - #[test] fn test_report_log_details_not_init_duration() { let report_log = "REPORT RequestId: 32f5cbf1-dd22-422a-a566-8965da5a3465 Duration: 8.40 ms Billed Duration: 9 ms Memory Size: 128 MB Max Memory Used: 66 MB "; diff --git a/common_lib/src/runtime.rs b/common_lib/src/runtime.rs index 85cb0fd77a..031eb4dfb2 100644 --- a/common_lib/src/runtime.rs +++ b/common_lib/src/runtime.rs @@ -13,8 +13,6 @@ pub struct Runtime { memory_size: i32, image: Option, layer: Option, - #[serde(default)] - is_snapstart: bool, } impl Runtime { @@ -28,7 +26,6 @@ impl Runtime { memory_size: i32, image: Option, layer: Option, - is_snapstart: bool, ) -> Self { Runtime { display_name, @@ -39,7 +36,6 @@ impl Runtime { memory_size, image, layer, - is_snapstart, } } } @@ -89,10 +85,6 @@ impl Runtime { format!("{}/code_{}.zip", self.path, self.architecture) } - pub fn is_snapstart(&self) -> bool { - self.is_snapstart - } - pub fn has_image(&self) -> bool { self.image.is_some() } @@ -163,7 +155,6 @@ mod tests { 128, None, None, - false, ); assert_eq!(test_runtime.package_type(), PackageType::Zip); assert!(!test_runtime.has_image()); @@ -180,7 +171,6 @@ mod tests { 128, None, None, - false, ); assert_eq!(test_runtime.build_s3_key(), "nodejs20/code_arm64.zip"); } @@ -196,7 +186,6 @@ mod tests { 128, None, None, - false, ); assert_eq!(test_runtime.architecture(), "arm64"); assert_eq!(test_runtime.memory_size(), 128); @@ -217,7 +206,6 @@ mod tests { 128, Some(Image::new(String::from("test_image"))), None, - false, ); assert_eq!(test_runtime.package_type(), PackageType::Image); assert!(test_runtime.has_image()); @@ -234,7 +222,6 @@ mod tests { 128, None, None, - false, ); assert_eq!( test_runtime.function_name(), @@ -253,7 +240,6 @@ mod tests { 128, Some(Image::new(String::from("test_image"))), None, - false, ); assert_eq!( test_runtime.image_name("0123456789", "us-east-1"), @@ -261,38 +247,6 @@ mod tests { ); } - #[test] - fn test_is_snapstart_true() { - let test_runtime = Runtime::new( - String::from("nodejs20"), - String::from("nodejs20.x"), - String::from("index.handler"), - String::from("nodejs20"), - String::from("arm64"), - 128, - Some(Image::new(String::from("test_image"))), - None, - true, - ); - assert!(test_runtime.is_snapstart()); - } - - #[test] - fn test_is_snapstart_false() { - let test_runtime = Runtime::new( - String::from("nodejs20"), - String::from("nodejs20.x"), - String::from("index.handler"), - String::from("nodejs20"), - String::from("arm64"), - 128, - Some(Image::new(String::from("test_image"))), - None, - false, - ); - assert!(!test_runtime.is_snapstart()); - } - #[test] fn test_json() { let test_runtime = Runtime::new( @@ -304,11 +258,10 @@ mod tests { 128, Some(Image::new(String::from("test_image"))), None, - false, ); assert_eq!( test_runtime.json(), - "{\"architecture\":\"arm64\",\"displayName\":\"nodejs20\",\"handler\":\"index.handler\",\"image\":{\"baseImage\":\"test_image\"},\"isSnapstart\":false,\"layer\":null,\"memorySize\":128,\"path\":\"nodejs20\",\"runtime\":\"nodejs20.x\"}" + "{\"architecture\":\"arm64\",\"displayName\":\"nodejs20\",\"handler\":\"index.handler\",\"image\":{\"baseImage\":\"test_image\"},\"layer\":null,\"memorySize\":128,\"path\":\"nodejs20\",\"runtime\":\"nodejs20.x\"}" ); } @@ -323,7 +276,6 @@ mod tests { 128, Some(Image::new(String::from("test_image"))), None, - false, ); assert_eq!(test_runtime.get_layer_name("us-east-1"), None); } @@ -344,7 +296,6 @@ mod tests { )), arm64: None, }), - false, ); assert_eq!( test_runtime.get_layer_name("us-east-1"), @@ -370,7 +321,6 @@ mod tests { "arn:aws:lambda:_REGION_:226609089145:layer:bun-1_0_0-arm64:1", )), }), - false, ); assert_eq!( test_runtime.get_layer_name("us-east-1"), @@ -396,7 +346,6 @@ mod tests { "arn:aws:lambda:_REGION_:226609089145:layer:bun-1_0_0-arm64:1", )), }), - false, ); assert_eq!(test_runtime.get_layer_name("us-east-1"), None); } diff --git a/common_lib/src/sqs_manager.rs b/common_lib/src/sqs_manager.rs index 2aaa29f77f..f3558f1197 100644 --- a/common_lib/src/sqs_manager.rs +++ b/common_lib/src/sqs_manager.rs @@ -8,9 +8,7 @@ use crate::{manifest::ManifestManager, runtime::Runtime}; pub struct SQSManager { pub client: SQSClient, pub function_queue_url: String, - pub snapstart_queue_url: String, pub manifest_manager: ManifestManager, - pub skip_snapstart: bool, } impl SQSManager { @@ -18,8 +16,6 @@ impl SQSManager { account_id: &str, region: &str, function_queue_name: &str, - snapstart_queue_name: &str, - skip_snapstart: bool, manifest_manager: ManifestManager, client: Option, ) -> Self { @@ -32,14 +28,10 @@ impl SQSManager { }; let function_queue_url = SQSManager::build_queue_url(account_id, region, function_queue_name); - let snapstart_queue_url = - SQSManager::build_queue_url(account_id, region, snapstart_queue_name); SQSManager { client, function_queue_url, - snapstart_queue_url, manifest_manager, - skip_snapstart, } } fn build_queue_url(account_id: &str, region: &str, queue_name: &str) -> String { @@ -60,28 +52,15 @@ pub trait QueueManager { impl QueueManager for SQSManager { fn build_message(&self) -> Vec { let manifest = self.manifest_manager.read_manifest(); - if self.skip_snapstart { - return manifest - .runtimes - .into_iter() - .filter(|r| !r.is_snapstart()) - .collect(); - } manifest.runtimes } async fn send_message(&self) -> Result<(), Error> { let messages = self.build_message().into_iter(); for message in messages { - let queue_url = if message.is_snapstart() { - &self.snapstart_queue_url - } else { - &self.function_queue_url - }; - self.client .send_message() - .queue_url(queue_url) + .queue_url(&self.function_queue_url) .message_body(serde_json::to_string(&message)?) .send() .await?; @@ -100,16 +79,8 @@ mod tests { #[tokio::test] async fn test_build_sqs() { let manifest = ManifestManager::new("manifest.test.json"); - let sqs_manager = SQSManager::new( - "123456789", - "us-east-1", - "test_queue", - "snapstart_test_queue", - false, - manifest, - None, - ) - .await; + let sqs_manager = + SQSManager::new("123456789", "us-east-1", "test_queue", manifest, None).await; let sqs_messages = sqs_manager.build_message(); assert_eq!(sqs_messages.len(), 10); @@ -124,7 +95,6 @@ mod tests { 128, None, None, - false, ) ); assert_eq!( @@ -140,7 +110,6 @@ mod tests { base_image: "public.ecr.aws/lambda/nodejs:18".to_string(), }), None, - false, ) ); assert_eq!( @@ -154,7 +123,6 @@ mod tests { 128, None, None, - false, ) ); assert_eq!( @@ -170,7 +138,6 @@ mod tests { base_image: "public.ecr.aws/lambda/nodejs:18".to_string(), }), None, - false, ) ); assert_eq!( @@ -184,7 +151,6 @@ mod tests { 128, None, None, - false, ) ); @@ -199,7 +165,6 @@ mod tests { 256, None, None, - false, ) ); assert_eq!( @@ -215,7 +180,6 @@ mod tests { base_image: "public.ecr.aws/lambda/nodejs:18".to_string(), }), None, - false, ) ); assert_eq!( @@ -229,7 +193,6 @@ mod tests { 256, None, None, - false, ) ); assert_eq!( @@ -245,7 +208,6 @@ mod tests { base_image: "public.ecr.aws/lambda/nodejs:18".to_string(), }), None, - false, ) ); assert_eq!( @@ -259,39 +221,6 @@ mod tests { 256, None, None, - false, - ) - ); - } - - #[tokio::test] - async fn test_build_sqs_skip_snapstart() { - let manifest = ManifestManager::new("manifest.test.snapstart.and.not.snapstart.json"); - let sqs_manager = SQSManager::new( - "123456789", - "us-east-1", - "test_queue", - "snapstart_test_queue", - true, - manifest, - None, - ) - .await; - let sqs_messages = sqs_manager.build_message(); - assert_eq!(sqs_messages.len(), 1); - - assert_eq!( - sqs_messages[0], - Runtime::new( - "java11".to_string(), - "java11".to_string(), - "io.github.maxday.Handler::handleRequest".to_string(), - "java_11".to_string(), - "x86_64".to_string(), - 128, - None, - None, - false, ) ); } diff --git a/function-invoker-rs/src/main.rs b/function-invoker-rs/src/main.rs index 91d03e2350..280dd7d9fe 100644 --- a/function-invoker-rs/src/main.rs +++ b/function-invoker-rs/src/main.rs @@ -42,42 +42,11 @@ async fn process_event( let retry = RetryManager::new(3, Duration::from_secs(1), Duration::from_secs(30)); let runtime = &record.body; info!("processing runtime: {}", runtime.function_name()); - match runtime.is_snapstart() { - true => invoke_snapstart(runtime, &retry, lambda_manager).await, - false => invoke(runtime, &retry, lambda_manager).await, - }?; + invoke(runtime, &retry, lambda_manager).await?; } Ok(Response::success()) } -async fn invoke_snapstart( - runtime: &Runtime, - retry: &RetryManager, - lambda_manager: &LambdaManager<'_>, -) -> Result<(), Error> { - let arns = lambda_manager.list_versions_by_function(runtime).await?; - for i in 0..10 { - info!("snapstart run #: {}", i); - if let Some(arn) = arns.get(i) { - info!("arn = {}", arn); - retry - .retry_async(|| async { - lambda_manager - .update_function_configuration(&runtime.function_name()) - .await - }) - .await?; - info!("function updated to ensure cold start"); - thread::sleep(Duration::from_secs(5)); - retry - .retry_async(|| async { lambda_manager.invoke_function(arn).await }) - .await?; - info!("function invoked"); - } - } - Ok(()) -} - async fn invoke( runtime: &Runtime, retry: &RetryManager, diff --git a/function-trigger-deployer-rs/src/main.rs b/function-trigger-deployer-rs/src/main.rs index 5b3af5a523..245d26847a 100644 --- a/function-trigger-deployer-rs/src/main.rs +++ b/function-trigger-deployer-rs/src/main.rs @@ -33,14 +33,8 @@ async fn func(_: LambdaEvent) -> Result { std::env::var("REPORT_LOG_PROCESSOR_ARN").expect("REPORT_LOG_PROCESSOR_ARN not set"); let function_queue_name = std::env::var("FUNCTION_QUEUE_NAME").expect("FUNCTION_QUEUE_NAME not set"); - let snapstart_queue_name = - std::env::var("SNAPSTART_QUEUE_NAME").expect("SNAPSTART_QUEUE_NAME not set"); let account_id = std::env::var("ACCOUNT_ID").expect("ACCOUNT_ID not set"); let region = std::env::var("AWS_REGION").expect("AWS_REGION not set"); - let skip_snapstart = - std::env::var("SKIP_SNAPSTART").is_ok_and(|v| v.eq_ignore_ascii_case("true")); - - info!("skip_snapstart is set to {}", skip_snapstart); let db_manager = DynamoDBManager::new(table_name, None).await; @@ -66,8 +60,6 @@ async fn func(_: LambdaEvent) -> Result { &account_id, ®ion, &function_queue_name, - &snapstart_queue_name, - skip_snapstart, manifest_manager, None, ) diff --git a/manifest.json b/manifest.json index 7cc4906c66..cf9708704c 100644 --- a/manifest.json +++ b/manifest.json @@ -271,14 +271,6 @@ "baseImage": "public.ecr.aws/lambda/provided:al2023" } }, - { - "displayName": "java11 snapstart", - "runtime": "java11", - "handler": "io.github.maxday.Handler::handleRequest", - "path": "java11_snapstart", - "isSnapstart": true, - "architectures": ["x86_64"] - }, { "displayName": "java17", "runtime": "java17", @@ -289,14 +281,6 @@ "baseImage": "public.ecr.aws/lambda/java:17" } }, - { - "displayName": "java17 snapstart", - "runtime": "java17", - "handler": "io.github.maxday.Handler::handleRequest", - "path": "java17_snapstart", - "isSnapstart": true, - "architectures": ["x86_64"] - }, { "displayName": "java21", "runtime": "java21", @@ -307,14 +291,6 @@ "baseImage": "public.ecr.aws/lambda/java:21" } }, - { - "displayName": "java21 snapstart", - "runtime": "java21", - "handler": "io.github.maxday.Handler::handleRequest", - "path": "java21_snapstart", - "isSnapstart": true, - "architectures": ["x86_64"] - }, { "displayName": "quarkus (prov.al2)", "runtime": "provided.al2", diff --git a/s3-uploader/runtimes/java11_snapstart/Dockerfile b/s3-uploader/runtimes/java11_snapstart/Dockerfile deleted file mode 100644 index 72e3a05a42..0000000000 --- a/s3-uploader/runtimes/java11_snapstart/Dockerfile +++ /dev/null @@ -1,14 +0,0 @@ -FROM public.ecr.aws/lambda/java:11 AS builder -WORKDIR /tmpBuild -RUN yum install -y unzip -RUN curl -k -L -v -X GET https://services.gradle.org/distributions/gradle-8.3-bin.zip > gradle-8.3-bin.zip -RUN unzip -d /opt/gradle gradle-8.3-bin.zip - -COPY src ./src -COPY build.gradle . - -RUN JAVA_HOME=/var/lang /opt/gradle/gradle-8.3/bin/gradle :buildZip - -FROM scratch -COPY --from=builder /tmpBuild/build/distributions/code.zip / -ENTRYPOINT ["/code.zip"] \ No newline at end of file diff --git a/s3-uploader/runtimes/java11_snapstart/build.gradle b/s3-uploader/runtimes/java11_snapstart/build.gradle deleted file mode 100644 index 2ce7b873fb..0000000000 --- a/s3-uploader/runtimes/java11_snapstart/build.gradle +++ /dev/null @@ -1,16 +0,0 @@ -apply plugin: 'java' - -repositories { - mavenCentral() -} - -sourceCompatibility = 11 -targetCompatibility = 11 - -task buildZip(type: Zip) { - archiveBaseName = 'code' - from compileJava - from processResources -} - -build.dependsOn buildZip \ No newline at end of file diff --git a/s3-uploader/runtimes/java11_snapstart/build.sh b/s3-uploader/runtimes/java11_snapstart/build.sh deleted file mode 100755 index 168d2b08ff..0000000000 --- a/s3-uploader/runtimes/java11_snapstart/build.sh +++ /dev/null @@ -1,8 +0,0 @@ -DIR_NAME="./runtimes/$1" -ARCH=$2 - -rm ${DIR_NAME}/code_${ARCH}.zip 2> /dev/null - -docker build ${DIR_NAME} -t maxday/java11-snapstart -dockerId=$(docker create maxday/java11-snapstart) -docker cp $dockerId:/code.zip ${DIR_NAME}/code_${ARCH}.zip \ No newline at end of file diff --git a/s3-uploader/runtimes/java11_snapstart/src/main/java/io/github/maxday/Handler.java b/s3-uploader/runtimes/java11_snapstart/src/main/java/io/github/maxday/Handler.java deleted file mode 100644 index 35b7857c2b..0000000000 --- a/s3-uploader/runtimes/java11_snapstart/src/main/java/io/github/maxday/Handler.java +++ /dev/null @@ -1,18 +0,0 @@ -package io.github.maxday; - -import java.io.InputStream; -import java.io.IOException; -import java.io.OutputStream; - -public class Handler { - - public void handleRequest(InputStream inputStream, OutputStream outputStream) throws IOException { - try { - outputStream.write("ok".getBytes()); - } catch (IOException e) { - e.printStackTrace(); - } finally { - outputStream.close(); - } - } -} diff --git a/s3-uploader/runtimes/java17_snapstart/Dockerfile b/s3-uploader/runtimes/java17_snapstart/Dockerfile deleted file mode 100644 index 891cc39648..0000000000 --- a/s3-uploader/runtimes/java17_snapstart/Dockerfile +++ /dev/null @@ -1,14 +0,0 @@ -FROM public.ecr.aws/lambda/java:17 AS builder -WORKDIR /tmpBuild -RUN yum install -y unzip -RUN curl -k -L -v -X GET https://services.gradle.org/distributions/gradle-8.3-bin.zip > gradle-8.3-bin.zip -RUN unzip -d /opt/gradle gradle-8.3-bin.zip - -COPY src ./src -COPY build.gradle . - -RUN JAVA_HOME=/var/lang /opt/gradle/gradle-8.3/bin/gradle :buildZip - -FROM scratch -COPY --from=builder /tmpBuild/build/distributions/code.zip / -ENTRYPOINT ["/code.zip"] \ No newline at end of file diff --git a/s3-uploader/runtimes/java17_snapstart/build.gradle b/s3-uploader/runtimes/java17_snapstart/build.gradle deleted file mode 100644 index b4b36867b9..0000000000 --- a/s3-uploader/runtimes/java17_snapstart/build.gradle +++ /dev/null @@ -1,16 +0,0 @@ -apply plugin: 'java' - -repositories { - mavenCentral() -} - -sourceCompatibility = 17 -targetCompatibility = 17 - -task buildZip(type: Zip) { - archiveBaseName = 'code' - from compileJava - from processResources -} - -build.dependsOn buildZip \ No newline at end of file diff --git a/s3-uploader/runtimes/java17_snapstart/build.sh b/s3-uploader/runtimes/java17_snapstart/build.sh deleted file mode 100755 index e6b47279b6..0000000000 --- a/s3-uploader/runtimes/java17_snapstart/build.sh +++ /dev/null @@ -1,8 +0,0 @@ -DIR_NAME="./runtimes/$1" -ARCH=$2 - -rm ${DIR_NAME}/code_${ARCH}.zip 2> /dev/null - -docker build ${DIR_NAME} -t maxday/java17-snapstart -dockerId=$(docker create maxday/java17-snapstart) -docker cp $dockerId:/code.zip ${DIR_NAME}/code_${ARCH}.zip \ No newline at end of file diff --git a/s3-uploader/runtimes/java17_snapstart/src/main/java/io/github/maxday/Handler.java b/s3-uploader/runtimes/java17_snapstart/src/main/java/io/github/maxday/Handler.java deleted file mode 100644 index 35b7857c2b..0000000000 --- a/s3-uploader/runtimes/java17_snapstart/src/main/java/io/github/maxday/Handler.java +++ /dev/null @@ -1,18 +0,0 @@ -package io.github.maxday; - -import java.io.InputStream; -import java.io.IOException; -import java.io.OutputStream; - -public class Handler { - - public void handleRequest(InputStream inputStream, OutputStream outputStream) throws IOException { - try { - outputStream.write("ok".getBytes()); - } catch (IOException e) { - e.printStackTrace(); - } finally { - outputStream.close(); - } - } -} diff --git a/s3-uploader/runtimes/java21_snapstart/Dockerfile b/s3-uploader/runtimes/java21_snapstart/Dockerfile deleted file mode 100644 index 2a55a7b076..0000000000 --- a/s3-uploader/runtimes/java21_snapstart/Dockerfile +++ /dev/null @@ -1,16 +0,0 @@ -FROM public.ecr.aws/lambda/java:21 AS builder -WORKDIR /tmpBuild -RUN dnf -y update -RUN dnf -y install zip -RUN dnf -y install findutils -RUN curl -k -L -v -X GET https://services.gradle.org/distributions/gradle-8.3-bin.zip > gradle-8.3-bin.zip -RUN unzip -d /opt/gradle gradle-8.3-bin.zip - -COPY src ./src -COPY build.gradle . - -RUN JAVA_HOME=/var/lang /opt/gradle/gradle-8.3/bin/gradle :buildZip - -FROM scratch -COPY --from=builder /tmpBuild/build/distributions/code.zip / -ENTRYPOINT ["/code.zip"] \ No newline at end of file diff --git a/s3-uploader/runtimes/java21_snapstart/build.gradle b/s3-uploader/runtimes/java21_snapstart/build.gradle deleted file mode 100644 index d8a43ee0e1..0000000000 --- a/s3-uploader/runtimes/java21_snapstart/build.gradle +++ /dev/null @@ -1,23 +0,0 @@ -apply plugin: 'java' - -repositories { - mavenCentral() -} - -dependencies { - implementation 'org.crac:crac:1.5.0' -} - -sourceCompatibility = 21 -targetCompatibility = 21 - -task buildZip(type: Zip) { - archiveBaseName = 'code' - from compileJava - from processResources - into('lib') { - from configurations.runtimeClasspath - } -} - -build.dependsOn buildZip \ No newline at end of file diff --git a/s3-uploader/runtimes/java21_snapstart/build.sh b/s3-uploader/runtimes/java21_snapstart/build.sh deleted file mode 100755 index 3a0ca77948..0000000000 --- a/s3-uploader/runtimes/java21_snapstart/build.sh +++ /dev/null @@ -1,8 +0,0 @@ -DIR_NAME="./runtimes/$1" -ARCH=$2 - -rm ${DIR_NAME}/code_${ARCH}.zip 2> /dev/null - -docker build ${DIR_NAME} -t maxday/java21-snapstart -dockerId=$(docker create maxday/java21-snapstart) -docker cp $dockerId:/code.zip ${DIR_NAME}/code_${ARCH}.zip \ No newline at end of file diff --git a/s3-uploader/runtimes/java21_snapstart/src/main/java/io/github/maxday/Handler.java b/s3-uploader/runtimes/java21_snapstart/src/main/java/io/github/maxday/Handler.java deleted file mode 100644 index 9b3e7d92d1..0000000000 --- a/s3-uploader/runtimes/java21_snapstart/src/main/java/io/github/maxday/Handler.java +++ /dev/null @@ -1,41 +0,0 @@ -package io.github.maxday; - -import org.crac.Context; -import org.crac.Core; -import org.crac.Resource; - -import java.io.ByteArrayOutputStream; -import java.io.InputStream; -import java.io.IOException; -import java.io.OutputStream; - -public class Handler implements Resource { - - public Handler() { - Core.getGlobalContext().register(this); - } - - public void handleRequest(InputStream inputStream, OutputStream outputStream) throws IOException { - try { - outputStream.write("ok".getBytes()); - } catch (IOException e) { - e.printStackTrace(); - } finally { - outputStream.close(); - } - } - - // Making best use of the snapshotting, by priming the function - // https://aws.amazon.com/blogs/compute/reducing-java-cold-starts-on-aws-lambda-functions-with-snapstart/ - @Override - public void beforeCheckpoint(Context context) throws Exception { - try (ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) { - outputStream.write("ok".getBytes()); - } - } - - @Override - public void afterRestore(Context context) throws Exception { - // intentionally empty - } -}