mirror of
https://github.com/floci-io/floci.git
synced 2026-11-27 23:59:27 -05:00
feat(lambda): support the nodejs26.x runtime (#9393)
Resolve nodejs26.x to public.ecr.aws/lambda/nodejs:26, which the Docker launcher, the Kubernetes launcher and Web Function environments all use, and accept nodejs26.x for Web Function revisions next to nodejs24.x. Closes #9392
This commit is contained in:
1 parent
2c2cf3e3e3
commit
5a2b6f9e1c
5 files changed
+22
-3
No files matched your search
@@ -71,7 +71,7 @@ The `Host` must match the domain exactly, as on AWS: another case or another por
|
||||
|
||||
A CloudFront distribution of this Floci can use the endpoint as a custom origin, named by its `domainName` with or without its port. Under an `always-amz-auth` origin access control, CloudFront signs the requests to an `IamAuth` endpoint, and the function's resource policy has to allow `cloudfront.amazonaws.com` when IAM enforcement is on. Its `aws:RequestedRegion` is the region that serves the request, as on AWS. See [CloudFront](cloudfront.md).
|
||||
|
||||
An execution environment is a `public.ecr.aws/lambda/nodejs:24` container. The code is the revision's S3 object unpacked into `/var/task`. Node starts `/var/runtime/index.js` with the flags AWS uses, and that runtime imports `index.js` or the file `AWS_LAMBDA_NODEJS_ENTRYPOINT` names. So `require.main` is not the app's module, as on AWS. A `--max-old-space-size` or `--max-semi-space-size` in `NODE_OPTIONS` takes the place of both default heap flags, as on AWS. The container has 2519064576 bytes of memory, the total the process sees on AWS, so Node sizes the heap flag left out as on AWS. Other flags there do not replace a default flag, so `--max-http-header-size` in `NODE_OPTIONS` has no effect, and a flag Node does not allow in `NODE_OPTIONS` fails the start with `502 Runtime.ExitError`, as on AWS. The app sees `AWS_LAMBDA_HTTP_ENDPOINT=0.0.0.0:3000`, `AWS_LAMBDA_INITIALIZATION_TYPE=native-http`, `AWS_EXECUTION_ENV`, `AWS_LAMBDA_FUNCTION_MEMORY_SIZE=2048`, `AWS_LAMBDA_LOG_LEVEL`, `AWS_LAMBDA_METADATA_API`, `AWS_LAMBDA_METADATA_TOKEN`, `AWS_LAMBDA_RUNTIME_API`, `AWS_ACCOUNT_ID`, `AWS_REGION`, `AWS_DEFAULT_REGION`, credentials and `AWS_ENDPOINT_URL` for Floci, `NODE_PATH`, and its own variables. The server has 9 seconds to listen. An environment that sees no request for `floci.services.lambda.container-idle-timeout-seconds` is stopped with `SIGTERM` and one second, as on scale to zero. Node runs under Docker's init, so a server without a `SIGTERM` handler stops at once, as on AWS. A process that exits between requests is replaced by a fresh environment on the next request.
|
||||
An execution environment is a `public.ecr.aws/lambda/nodejs:24` container for `nodejs24.x` and a `public.ecr.aws/lambda/nodejs:26` container for `nodejs26.x`. The code is the revision's S3 object unpacked into `/var/task`. Node starts `/var/runtime/index.js` with the flags AWS uses, and that runtime imports `index.js` or the file `AWS_LAMBDA_NODEJS_ENTRYPOINT` names. So `require.main` is not the app's module, as on AWS. A `--max-old-space-size` or `--max-semi-space-size` in `NODE_OPTIONS` takes the place of both default heap flags, as on AWS. The container has 2519064576 bytes of memory, the total the process sees on AWS, so Node sizes the heap flag left out as on AWS. Other flags there do not replace a default flag, so `--max-http-header-size` in `NODE_OPTIONS` has no effect, and a flag Node does not allow in `NODE_OPTIONS` fails the start with `502 Runtime.ExitError`, as on AWS. The app sees `AWS_LAMBDA_HTTP_ENDPOINT=0.0.0.0:3000`, `AWS_LAMBDA_INITIALIZATION_TYPE=native-http`, `AWS_EXECUTION_ENV`, `AWS_LAMBDA_FUNCTION_MEMORY_SIZE=2048`, `AWS_LAMBDA_LOG_LEVEL`, `AWS_LAMBDA_METADATA_API`, `AWS_LAMBDA_METADATA_TOKEN`, `AWS_LAMBDA_RUNTIME_API`, `AWS_ACCOUNT_ID`, `AWS_REGION`, `AWS_DEFAULT_REGION`, credentials and `AWS_ENDPOINT_URL` for Floci, `NODE_PATH`, and its own variables. The server has 9 seconds to listen. An environment that sees no request for `floci.services.lambda.container-idle-timeout-seconds` is stopped with `SIGTERM` and one second, as on scale to zero. Node runs under Docker's init, so a server without a `SIGTERM` handler stops at once, as on AWS. A process that exits between requests is replaced by a fresh environment on the next request.
|
||||
|
||||
Requests with two revisions in `revisionWeights` are split by weight. Each endpoint scales on its own, as on AWS. An environment takes up to the revision's `maxConcurrencyPerEnvironment` requests at once, the least busy one first, so requests rotate over the environments. A request that finds every environment full starts another one, or waits for one that is starting and has room. When the endpoint already runs `maxEnvironments`, an idle environment of another revision makes room, and without one the request is refused with `429` and `Platform.EndpointMaxEnvThrottle`. A `rateLimit` admits a burst of up to `rateLimit` requests that refills at `rateLimit` per second, and refuses the rest with `429` and `Platform.EndpointRequestThrottle`. AWS adjusts the concurrency of each environment under `maxConcurrencyPerEnvironment` from the measured load, so a burst there can spread over more environments than in Floci, and the account quotas are not applied.
|
||||
|
||||
|
||||
Reference in new issue
Block a user