Closed pdiazvargas closed 5 years ago
It looks to me like the proposal is trying to solve 2 issues at once:
I would advise that the two separate concerns be split and tackled individually since there is no concept in Juniper now which addresses hierarchy/inheritance.
functions:
router:
image: python:3.6-alpine
include:
- ./src/router_lambda
requirements: ./src/requirements.txt
image
field is not required, and if not specified, the default value is python:3.6-alpine
runtime
(and then provide an internal mapping between lambda choices and docker containers).There are 2 approaches you could take:
global:
image: python:3.6-alpine
include:
- ./src/common/constants.py
requirements: ./src/requirements.txt
functions:
.globals: &global_template
image: python:3.6-alpine
requirements: ./src/requirements.txt
my_function:
<<: *global_template
include:
- ./src/my_function
your_function:
<<: *global_template
include:
- ./src/your_function
Worth noting is the fact that using inheritance, the parameter values are always OVERWRITTEN. This might not fit well with specifying common includes, which is why GitLab introduced an extends:
property. Below is a sample of what that might look like for us - illustrating the ability that my_function
will include two directories: (1) common
, (2) my_function
functions:
.globals: &global_template
image: python:3.6-alpine
include: ./src/common
requirements: ./src/requirements.txt
my_function:
extends: globals
include:
- ./src/my_function
Taking a mixed approached, for this particular feature, we should implement the global parameter setting with an override at a function level. That way a developer will have the following options:
With this in mind the manifest would look like:
global:
image: python:3.6-alpine
functions:
edge:
image: python:3.8-alpine
requirements: ./src/edge/requirements.txt
include:
- ./src/edge/
sequential-worker:
include:
- ./src/worker/sequential_worker
What
While using juniper for build purposes, I am unable to create an artifact for anything other than python3.6. I need to have the ability to specify the python base image the container will use when packaging my lambda functions.
The default image juniper is currently using is:
lambci/lambda:build-python3.6
How
Update the manifest file to take a few docker specific parameters. Either add a docker specific section in the manifest file like:
Or create a more global set of parameters:
Why
Having a developer change the runtime of a lambda function to python 3.6 due to juniper's inability to package using python 3.7 is not acceptable.