-
-
Notifications
You must be signed in to change notification settings - Fork 374
Bref v3 #1953
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Update v3 layers
Add ap-southeast-3 and me-central-1 regions in Bref v3
* Switch to a single layer * Force display_errors * Fix tests * Fix CS * Upgrade documentation * Upgrade documentation * Upgrade documentation for containers
Co-authored-by: mnapoli <720328+mnapoli@users.noreply.github.com>
Co-authored-by: mnapoli <720328+mnapoli@users.noreply.github.com>
Co-authored-by: mnapoli <720328+mnapoli@users.noreply.github.com>
Update v3 layers []()
Support PHP 8.5
Update v3 layers []()
Update v3 layers []()
Update v3 layers []()
Remove the deprecated "hooks" system
|
Do you have any ETA in mind for this? |
Fix PHP 8.5 deprecations
Update v3 layers []()
# Conflicts: # layers.json
|
Targeting end of November or early December hopefully. You can start using v3 right now, I have published the first alpha versions. |
|
Hello @mnapoli , thank you for your work, I am using Bref since a while and working like a charm. But, I am about to drop bref runtime (php files) and only keep base layers for the reason that I can't send the response BEFORE calling kernel.terminate and do some heavy work (my use case is mostly sending opentelemetry data for now). I am using the function runtime (way faster than fpm because of connection reuse) and symfony. So I built a custom runtime for symfony + bref, doing some low level things I would prefer see in Bref :) here is my http runner code, leveraging symfony runtime: public function run(): int
{
$loops = 0;
$memoryLeakDetector = new MemoryLeakDetector();
while ($invocation = $this->apiClient->nextInvocation()) {
try {
if (is_string($invocation->event)) {
throw new Exception('Invalid event: ' . $invocation->event);
}
$request = RequestConverter::convert($invocation->event);
$response = $this->kernel->handle($request);
$lambdaResponse = ResponseConverter::convert($response);
} catch (Throwable $e) {
$invocation->signalFailure($e);
return 0;
}
$invocation->sendResponse($lambdaResponse);
if ($this->kernel instanceof TerminableInterface) {
$this->kernel->terminate($request, $response);
}
// Only check loop max if it's set and > 0
if ($this->loopMax > 0 && ++$loops > $this->loopMax) {
return 0;
}
// Boot kernel to prepare for next invocation (resets resettable services)
if ($this->kernel instanceof \Symfony\Component\HttpKernel\KernelInterface) {
$this->kernel->boot();
}
// Clear memory between invocations
gc_collect_cycles();
// Check for memory leak
if ($memoryLeakDetector->checkAndRecord()) {
return 0;
}
}
} |
|
@jlabedo I think this already exists: https://bref.sh/docs/symfony/keep-alive right? (PS: can you create a separate issue if this isn't it, to avoid cluttering the v3 PR) |
Update v3 layers []()
Update v3 layers
Update v3 layers []()
This PR will contain all changes for Bref v3.
This will be a long-running PR, I like to keep this open for months so that we have a place to preview and discuss changes. I do not intend to merge this pull request soon.
This PR goes hand-in-hand with brefphp/aws-lambda-layers#257.
Breaking changes:
pgsqlextension is now enabled by defaultbrefCLI is removed, this was already stripped down with the v2 upgrade and could only set up new projects. That built-in CLI is no longer needed. It is replaced byserverlessCLI commands and thebrefexternal CLI (https://github.com/brefphp/cli).All changes:
pgsqlextension is now enabled by default873528684822)blackfireextension from "dev" container imagesbrefCLI (Bref v3) #2030Ideas considered:
TODO:
provided.al2023instead ofprovided.al2provided.al2023in the upgrade guide