Use lambda as a kind of executor (along docker / shell executor)

Description

I'm well aware of https://medium.com/sharenowtech/serverless-gitlab-runner-builds-on-lambda-ded4b24b3c4f and #3128 (closed) but though the idea of an "lambda executor" is proposed, it is not explored, and instead the "lambda runner" direction is taken.

Having a lambda executor would not need a overhaul of the architecture (polled events vs pushed events) and will be step further in the direction of the "gitlab spinning spot instances with docker+machine" (i.e https://substrakthealth.com/autoscale-gitlab-ci-runners-and-save-90-on-ec2-costs/ )

Proposal

configuration:

  1. gitlab runner would have a new executor type lambda
  2. creating the lambda with all what you need (terraform, your linter , git binary etc. ) is not done by gitlab but should be created before hand by the user
  3. the lambda executor would take an option "lambda function name"

run time:

  1. when the runner fetch a new job, it spawn a lambda event, with all the information (job number etc.) into the event information following a documented convention (so that people can implement a lambda in whichever language they want)
  2. the lambda executes itself according to the received events

this way as soon as gitlab-runner is able to spawn a lambda, the community could come up with raw implementation of a lambda that respect the interface contract, and later some helper library could be created, this without needing to put too much burden on gitlab/gitlab runner side

Links to related issues and merge requests / references

#3128 (closed)