Serverless Libraries

Description

It happens quite often that your serverless function / application requires some native libraries to run.

You can, of course, use a Dockerfile, but some people might not want to maintain a Dockerfile or learn about how to write it.

Proposal

One solution for this problem is to make it super easy to define libraries that will need to be installed. Perhaps we can do that using annotations. Something like:

Gemfile

gem 'nokogiri' # serverless:library:libxslt-dev,libxml2-dev

serverless:library:something[,something] is just an example, we could find something that is even more simple.

How it works:

  1. The idea is that you put that into a comment in any file (a source file, or somewhere else).
  2. When creating a runtime, gitlabktl collects these annotations.
  3. Before building a runtime, gitlabktl injects these libraries into a generated Dockerfile.
  4. We build a runtime for a function, and we deploy it to a cluster
  5. 🎉

Please note that we already do support generating Dockerfile and building runtimes from generated Dockerfiles. The missing part of the puzzle is looking for annotations in files and injecting them to a generated Dockerfile.

We should also document what distribution we are using for our Runtime. Perhaps we can just say "ubuntu:version" and this way everyone is going to know what names their libraries have.

Thoughts @DylanGriffith @danielgruesso?

Edited May 30, 2019 by Grzegorz Bizon
Assignee Loading
Time tracking Loading