Skip to content

Deploying

The Lambda's are setup with a tool called Serverless. There are a few steps required to deploy the package.

Setup Lambda layer

The Python base dependencies are referenced in a serverless/api/layers/base_dependencies/requirements.txt, however these are not automatically installed and packaged by serverless - it has to be done manually:

This can be done by executing the following commands:

cd /srv/pydps/serverless/api/layers/base_dependencies
pip install -t python -r requirements.txt 

Note

You should see each dependency installed under a folder called python. This is then zipped and sent to Lambda by serverless.

e.g.

/serverless/api/layers/base_dependencies/python/arrow
/serverless/api/layers/base_dependencies/python/colander
/serverless/api/layers/base_dependencies/python/dsnparse

Debugging package

If you want to check what the package for each function will look like before you deploy, calling sls package will update the .serverless folder with the zips that are uploaded to s3.

Deploying to staging

To deploy to staging, execute sls deploy

Note

Since first adding these docs sls has improved their CLI package. Though the commands here will behave as expected, sls will pop up a helpful terminal with messages/actions to follow.

Deploying to production

To deploy to staging, execute sls deploy --stage="prod"