Explore using OpenFaaS as GitLab Serverless runtimes
Description
This is an issue about the next iteration of GitLab Serverless Runtimes. Previous iteration
At this moment we are reusing existing Node runtime from Project Riff and have our own Ruby runtime that we support.
We would like to add more runtimes, and as per https://gitlab.com/gitlab-org/gitlab-ce/issues/58305#note_157384486 OpenFaaS runtimes (from openfaas-incubator
project) are interesting.
Our constraints / requirements:
Most important one:
- Runtimes should be decoupled. One should be able to use OpenFaaS Runtimes, GitLab Runtimes or write their own easily.
Then:
- We build runtimes in the CI environment, using Kaniko. We can't depend on Docker Engine
- We want to decouple runtimes in a way that they are as much platform-agnostic as they can be
- We build runtimes using gitlabktl and we want to continue doing so
- We push resulting images to GitLab Container Registry and want to continue doing so
- We do not want to rely on STDIN/STDOUT communication between a function and a HTTP server
- We want to make it possible to easily install native libraries dependencies
➡ #62520 (moved) - Runtimes provide a "FaaS" interface allowing the user to only write a single function (or method) and the runtime takes care of converting it to the compatible Docker image
- Support for custom runtimes for when users cannot find a compatible one for them
- ... more TBD
Nice to have:
- Large set of maintained runtimes for various languages
- The interface for creating your own runtime should be very easy for someone to implement when they want a custom runtime
- Runtime logic should probably be written in Bash as this is more universal than a runtime that is written in a different language
- Runtimes should be well unit tested