Skip to content

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.

  1. gitlabctl CLI tool is almost ready in https://gitlab.com/gitlab-org/gitlabktl
  2. Move this project to gitlab-org/gitlabktl
  3. Claim serverless namespace on gitlab.com
  4. Create runtimes subgroup there
  5. Create a separate project for every runtime.
  6. Use Triggermesh runtimes https://gitlab.com/triggermesh/runtimes/ as a start, before we figure it out dedicated runtimes runtimes.
  7. Version these runtimes with Git tags.
  8. Phase the Knative build templates out, use buildpacks-like compile/detect/release scheme.
  9. Start with just compile file in v0.1 that is going to contain Triggermesh runtime content.
  10. Support templating in this file (compile) with something like $(SOME_VALUE)
  11. 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

Documentation

What does success look like, and how can we measure that?

Links / references

Edited by Daniel Gruesso