Skip to content

Commit

Permalink
Added installation docs about Blackfire (#4)
Browse files Browse the repository at this point in the history
* Added installation docs about Blackfire

* Rebase fix
  • Loading branch information
Nyholm authored Jan 2, 2020
1 parent 25113f4 commit e2b37ff
Showing 1 changed file with 43 additions and 2 deletions.
45 changes: 43 additions & 2 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ a limit of 5 layers per Lambda.

We are happy to get contributions for other extensions. Sky is the limit! (And also your knowledge with Docker...)

## Install and configure

```cli
composer require bref/extra-php-extensions
```

```yaml
# serverless.yml
service: app
Expand Down Expand Up @@ -33,7 +39,7 @@ functions:
extension=/opt/bref-extra/amqp.so
```

## Available layers
### Available layers

| Name | Serverless config (php 7.4) | php.ini config |
| ---- | ----------------------------| -------------- |
Expand All @@ -46,7 +52,42 @@ extension=/opt/bref-extra/amqp.so

Note that the "Memcached" layer provides both extension for [Memcache](https://pecl.php.net/package/memcache) and [Memcached](https://pecl.php.net/package/memcached).

## Deploy new versions
### Blackfire installation

The Blackfire layer only have probe installed. You still need to install the agent.
The agent is installed on a separate server (not a lambda function). The very smallest
EC2 instance is sufficient to runt the Blackfire agent.

Create a `blackfire.ini` file for your lambda function where you load the extension
and modify the `agent_socket`.

```ini
extension=/opt/bref-extra/blackfire.so

blackfire.agent_socket = tcp://ip-172-40-40-40.eu-central-1.compute.internal:8307
blackfire.agent_timeout = 0.25
```

Then modify your [agent config](https://blackfire.io/docs/reference-guide/configuration#agent-configuration)
to make sure you are listening to `tcp://0.0.0.0:8307`.

## For contributors and maintainers

### Creating a new layer

The idea is to start from bref/build-php-XX, install all libraries and extensions
you want, then move all related files to `/opt`. Those files will be available in
the same same location on the Lambda.

Note that one can't just move files/libraries around. Most of them are expected to
be in their "standard" location.

1. Create a new folder in `layers` and name it to your extension name.
2. Add your Dockerfile
3. Update .travis.yml to include your extension
4. Update the table in the readme

### Deploy new versions

```
make publish
Expand Down

0 comments on commit e2b37ff

Please sign in to comment.