Milestone: serverless/function runtime
See original GitHub issueThis is just an early draft.
Once Probot v10 is released (#1274), we will focus on Making Probot work well in function/serverless environments, including
- AWS Lambda (see existing adapter: https://github.com/probot/serverless-lambda)
- Azure functions (see existing adapter: https://github.com/ethomson/probot-serverless-azurefunctions)
- Google Cloud Functions (see existing adapter: https://github.com/probot/serverless-gcf)
- GitHub Actions (See existing adapter: https://github.com/probot/actions-adapter)
- Clouflare Workers
- Architect
- Vercel
And popular frameworks, such as
Please let us know if there are other environments that you would like to use Probot in, and we will take it into account if we can.
We are in an early planning phase and welcome your input. If you would like to use Probot in any of these environments, what would your “dream API” look like? Do you know of comparable projects that do a great project of being compatible with popular serverless/function environments while still providing a good old server for traditional node server environments?
Questions
- Compared to today’s Serverless deployment documentation. What would documentation look like for the different serverless/function environments, if we could just dream up Probot usage code?
The Plan
- Move the multi-application layer of Probot into a separate project, e.g.
@probot/multi-app
- Remove all custom handling of Webhooks, only use
@octokit/webhooks
instead - Make probot easier to decompose, by turning built-in functionality into Octokit plugins
- logging with Bunyan
- loading configuration from
.github/[app name].yml
files
- Move logic that requires a server into separate projects
- GitHub App registration based on
app.yml
- Verify app settings has all events enabled that the app is subscribing to
Observations
- GitHub Functions does not need webhook verification using a secret.
@probot/serverless-gcf
&probot-serverless-azurefunctions
are very similar in terms of implementation. Only difference is thatgcf
doesn’t do any webhook secret verification, whileprobot-serverless-azurefunctions
does it’s own instead of using Probots@probot/serverless-gcf
- doesn’t verify webhook secret.
- It depends on internal APIs to find the apps private key and to resolve an app function. I think we should move these responsibilities to the user
- has a hard-coded response to
GET
requests to mimick Probot’s server response toGET /probot
probot-serverless-azurefunctions
- is currently doing its own signature verification.
- It depends on internal APIs to find the apps private key and to resolve an app function. I think we should move these responsibilities to the user
- has a hard-coded response to
GET
requests to mimick Probot’s server response toGET /probot
@probot/actions-adapter
- super simple wrapper around Probot: https://github.com/probot/actions-adapter/blob/0bd927d9a482a7b58bd1ba95839a2030ff5ae351/index.js
to be continued …
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:25 (22 by maintainers)
Top Results From Across the Web
Function - AWS Serverless Application Model
Creates an AWS Lambda function, an AWS Identity and Access Management (IAM) execution role, and event source mappings that trigger the function.
Read more >Probot on Twitter: " Are you deploying Probot to a serverless ...
Milestone : serverless/function runtime · Issue #1286 · probot/probot. This is just an early draft. Once Probot v10 is released (#1274), ...
Read more >Azure Functions runtime 3.0 is now generally available
Azure Functions 3.0 is now generally available, so it's now possible to build and deploy functions with the 3.0 runtime version in production....
Read more >Developing a fully Serverless Web app - Medium
When the Lambda functions are not in use, the cloud provider typically “spins down” the function. When they are invoked again, the function's...
Read more >Python 3.9 runtime now available in AWS Lambda - Noise
You can alter the behavior of Python functions by using decorators. Previously, these could only consist of the @ symbol, a name, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@gr2m and co I just wanted to report back after upgrading to probot v11 and thank you for the work you done on v11. Probot is running super smooth!
Previously release-drafter was using probot v9 and we were daily seeing a lot of request timeouts (30s) on Heroku and Heroku had us on daily reboots sometimes more than once per day.
This is overview of the last 24 hours:
The pull request at https://github.com/probot/probot/pull/1425 moves all server logic from the
Probot
class into a newServer
class, and exports two new methods relevant for serverless/function environments. I’d love feedback from anyone who is currently deploying Probot apps to a serverless/function environment or would like to do so in future.The changes in https://github.com/probot/probot/pull/1425 are continuously published to probot’s
beta
channel. Install/update withnpm install probot@beta
The exports are
They can be used together to create a
(request, response, next) => { ... }
middleware, compatible with both Node.jscreateServer
and express. It can be used like thisThe
getOptions
method reads out environment variables and returns an object with a{ Probot }
key, whereProbot
is a constructor with defaults set from the environment variables.This should work with out of the box with Architect, Vercel, and next.js. For other environments such as AWS Lambda, Azure Functions, or Google Cloud Functions, we would update the existing middleware implementations, probably keeping them as external packages instead of baking them into
probot
.If you have any thoughts, if you see any problems I’ve overseen or can think of ways to make the APIs easier or more efficient, now is the time to share 👍🏼
@SamStenton, @ethomson, @imwiss, @gwestersf, @JasonEtco, @tcbyrd, @swinton