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:
- The idea is that you put that into a comment in any file (a source file, or somewhere else).
- When creating a runtime,
gitlabktlcollects these annotations. - Before building a runtime,
gitlabktlinjects these libraries into a generatedDockerfile. - We build a runtime for a function, and we deploy it to a cluster
🎉
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?