Create CLI tool to execute GitLab Serverless runtimes
Problem to solve
GitLab Serverless currently the triggermesh CLI in order to interact with knative. This CLI relies on knative build to create knative services. As we work to bring knative builds into GitLab CI, we will need to use a CLI that does not rely on build templates or knative build in order to stand up knative services.
Upon completion of https://gitlab.com/gitlab-org/gitlab-ce/issues/58305 we'll require a mechanism to execute dedicated GitLab runtimes that may not make use of knative build templates or triggermesh runtimes.
Further details
Proposal
Create a GitLab CLI that will be run in the context of GitLab CI pipelines which will build docker images (based on the runtime instructions) and push to the registry.
-
gitlabctl
CLI tool is almost ready in https://gitlab.com/gitlab-org/gitlabktl - Move this project to
gitlab-org/gitlabktl
- Claim
serverless
namespace on gitlab.com - Create
runtimes
subgroup there - Create a separate project for every runtime.
- Use Triggermesh runtimes https://gitlab.com/triggermesh/runtimes/ as a start, before we figure it out dedicated runtimes runtimes.
- Version these runtimes with Git tags.
- Phase the Knative build templates out, use buildpacks-like
compile/detect/release
scheme. - Start with just
compile
file in v0.1 that is going to contain Triggermesh runtime content. - Support templating in this file (
compile
) with something like$(SOME_VALUE)
- Implement
gitlabctl serverless build runtime gitlab.com/serverless/ruintimes/ruby:v0.1
Example CLI behaviour (subject to change as we implement it):
$ gitlabctl build --runtime nodejs my_function.js # Builds a docker image and pushes to the registry