Skip to content
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

v0.3 - Official PHP support on Lambda, better performances and AWS SAM #113

Merged
merged 367 commits into from Jan 29, 2019
Merged

Conversation

@mnapoli
Copy link
Member

@mnapoli mnapoli commented Dec 16, 2018

This pull request will contain all the changes planned for v0.3 to keep master (v0.2.*) stable in the meantime.

The future website for Bref 0.3: bref.sh

Summary of changes

AWS has released an API to provide support for any language in Lambda. Bref will move from its Javascript-based hack to this new official API.

Bref will provide a PHP runtime optimized for CLI scripts (workers, CLI tasks, simple PHP lambdas, etc.) as well as another PHP runtime optimized for HTTP applications (based on PHP-FPM).

It is very likely that Bref will switch from the "serverless framework" to using AWS SAM instead for deployment and configuration (see #99). On top of advanced integration to other AWS services, this brings very useful tools for local development based on Docker.

With v0.3 it will be even easier to integrate HTTP applications and support any framework. Performances will also dramatically increase thanks to research and benchmarks as well as new experimental modes to run PHP faster in some scenarios (more information to come).

Finally, Bref v0.3 will come with a completely rewritten and extensive documentation.

v0.3

Check out the v0.3 Kanban board.

Detailed changes

  • #106 PHP runtime for AWS Lambda (built through the official support for 3rd party languages)
  • #112 Client for the Lambda runtime API
  • #115 PHP-FPM runtime optimized for HTTP applications
  • #122 A console runtime for Console applications
  • #124 The λ() function was replaced by a lambda() function
  • #127 Website and documentation
  • #126 Migrate to AWS SAM for deployments
  • #129 an industrialized build pipeline for the runtimes
@nealio82
Copy link
Contributor

@nealio82 nealio82 commented Dec 16, 2018

This is amazing! What's the long-term plan for building the runtime? Will bref provide stock runtimes for people who are just trying things out?

Also, will building the runtime be invoked as part of the first bref deploy or does the user always need to do it themselves? What about for using SAM local? It might be nice to have a single bref develop command in the Makefile which creates the runtime and sets up the config for SAM Local.

@mnapoli
Copy link
Member Author

@mnapoli mnapoli commented Dec 18, 2018

@nealio82 I finally answered in #114: #114 (comment)

About building runtimes: ideally you shouldn't have to worry about this, it just works (see the WIP instructions in the diff: https://github.com/mnapoli/bref/pull/113/files#diff-279a8ca151371a6a63058dc411985dd1R9). And locally it just works too, SAM is incredibly awesome for this. The only thing I'm worried with SAM when running locally is performances because you get a cold start every time. But you can also still run Symfony/Laravel the only way locally, it still works that way. We'll see as we use it more.

Makefile Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
runtime/default/bootstrap Outdated Show resolved Hide resolved
runtime/default/build.sh Outdated Show resolved Hide resolved
runtime/default/build.sh Outdated Show resolved Hide resolved
runtime/default/php.ini Outdated Show resolved Hide resolved
src/functions.php Outdated Show resolved Hide resolved
@mnapoli mnapoli added this to the 0.3 milestone Dec 26, 2018
demo/cli.php Outdated Show resolved Hide resolved
mnapoli added 27 commits Jan 26, 2019
The goal here is that whether we deploy PHP code on small on large lambdas we don't have to mess with this option. Lambda's memory limit will cut the process anyway if it gets too large in memory.
Add tests for the runtime layers
Improve the documentation about PHP
This follows the existing standards in popular Linux distributions.
Fix #191 and how the php.ini is dealt with
After doing some testing this flag actually removes warning logs. When enabled any uncaught exception in a PHP FPM worker will not be logged.

After removing it the logs are correct again.

Let's disable this for now.
Disable logging above "warning" in PHP-FPM
Log exceptions and errors in PHP functions + add a truckload of tests
@mnapoli
Copy link
Member Author

@mnapoli mnapoli commented Jan 29, 2019

Merging so that we can work on master to prepare the new release 🎉

Thanks everyone involved! The new release is happening in a few days if all goes well.

@mnapoli mnapoli merged commit 7db2ee6 into master Jan 29, 2019
3 checks passed
3 checks passed
@prettyci
PrettyCI Code formatting
Details
@travis-ci
Travis CI - Branch Build Passed
Details
@travis-ci
Travis CI - Pull Request Build Passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet