Skip to content

0.5.2

Compare
Choose a tag to compare
@mnapoli mnapoli released this 09 Aug 10:26
· 2554 commits to master since this release

Quick summary:

  • 🚢 Bref Docker images!
  • 📈 Bref Dashboard!
  • bug #394 fixed with #395 by @linuxjuggler: the event is not always an array

Docker images

Thanks to a huge contribution by @Guillaume-Rossignol, Bref now publishes Docker images on the Docker Hub: hub.docker.com/u/bref.

One use case for these images is local development. It is explained in details in the revamp "Local development for HTTP applications" guide, but here is an example using Docker Compose to run a HTTP app locally:

version: "3.5"

services:
    web:
        image: bref/fpm-dev-gateway
        ports:
            - '8000:80'
        volumes:
            - .:/var/task
        depends_on:
            - php
        environment:
            HANDLER: index.php
    php:
        image: bref/php-73-fpm-dev
        volumes:
            - .:/var/task:ro

After running docker-compose up, the application is accessible at http://localhost:8000/

We think this is a good alternative to sam local or serverless invoke local because Docker is an environment which many developers are starting to use, and because of much better performances.

It is also easy with Docker Compose to setup a database, or run CLI commands with the same environment as the rest of the application.

Since we have changed a bit how layers are built, new layers are available. But if you are using Bref 0.5 you don't have anything extra to do, you will get them automatically when you update Bref :)

Read more here.

Bref Dashboard

After months of iterations, we are very happy to finally publish the Bref dashboard publicly.

Capture d’écran 2019-08-09 à 11 39 05

The dashboard is an addition to Bref that provides a visual interface to manage your application. It is meant to complete and enhance the rest of Bref features.

Right now it provides:

  • a view of all functions and APIs deployed in one application
  • direct links to each components in the AWS dashboard
  • graphs of the response time (duration) and number of invocations in the last 30 days
  • average response time
  • number of errors in the last 30 days
  • a log viewer (I'm super happy with this!)

We have plenty of ideas to improve the dashboard over time.

The great thing with the dashboard is that it is not bundled in Bref (which keeps Bref lightweight). Instead it is a Docker image. To open the dashboard, simply run:

vendor/bin/bref dashboard

This command will automatically recognize the AWS stack name and region from serverless.yml, pull the latest version of the dashboard and start it. The only requirement: Docker.

And the best thing is that the dashboard runs on your machine, with your own credentials.

You don't need to setup anything or give access to your AWS account to anyone. Anything your machine can access, the dashboard can show!

Log viewer

The log viewer helps you read and search your logs without having to go through the AWS console. We have tried to dim out the noise as much as possible to make the logs easy to read:

Capture d’écran 2019-08-09 à 11 59 36

What does it mean for Bref?

The dashboard is close-source. The reason for that is that we are exploring the possibility of adding advanced and paid features to the dashboard in the future. The goal behind this is to find funding for the project. Note that the dashboard is a completely optional feature of Bref and it is not bundled in the open-source project.

Mixing open source with closed products and/or paid products is a delicate thing to do. I want to stress that we are being extremely careful with that. I have been thinking about this for more than a year, and I don't think I am done :)

My vision of a sane relationship between the open-source project and related products is:

  • the open-source project must live and work on its own
  • the open-source project must be usable and have its core features not impacted by other products
  • other products (closed and/or paid) must live separately from the open-source project and not replace basic features that are already provided by the open-source project

In other words, Bref's mission is to help everybody create serverless PHP applications. Side projects or products can provide extra help around that (especially for power users or advanced scenarios), but do not strip away from Bref's mission. Basic features that are essential to create serverless applications must be open source.

As we move further with this I intend to make this a little bit clearer and more defined, but in the meantime I hope it helps.

If you have any questions or feedback, please share them in this Bref dashboard feedback issue. What you think is important. We try to make some decisions with the best intentions, but sometimes we get things wrong :)