serverless-plugin-simulate icon indicating copy to clipboard operation
serverless-plugin-simulate copied to clipboard

Package installation.

Open josephjohansson opened this issue 7 years ago • 1 comments

Hi. You guys have done some amazing work with this plugin. Its so useful! One big limitation that I quickly ran into with this package however is that there is no way to specify what custom packages from pip or npm can be installed into the docker lambda before the container and the code are executed. It would be great if there was a step where the code would parse a requirements.txt or package.json and install the requirements in the container before running. This way we could have non default packages in order to enable the true power of lambda. In the cloud version of lambda we can upload the packages using tools like serverless-python-requirements and invoke packages like elasticsearch in order to work with AWS ES. This plugin should enable me to do the same.

josephjohansson avatar Nov 23 '17 20:11 josephjohansson

So this issue was resolved in a very dirty and hacky way and I think there is value in fleshing out a solution that works automatically with this plugin. See how I worked around this on this issue thread.

I think that this plugin should be able to build docker images with the packages we specify in requirements.txt or package.json automatically. I think we should either keep this issue open or open another one to implement something that automatically creates docker images and runs them. I think we need this because when I implement the hacky solution below I have to set the runtime in serverless.yml to something that is not part of the default runtimes. This means that there might be issues when running serverless deploy or you will have to change the yml file before you deploy. I don't think this is a viable solution. I am open to suggestions on how to implement this.

@jamespegg

josephjohansson avatar Feb 01 '18 19:02 josephjohansson