add docker deploy info
only upload on new article
downgrade to only req python 3
Korallenriff feed
Little lambda fn to scrape https://www.korallenriff.de/archivKompakt/2021.html and generate an RSS feed. Great way to stay up on all things German Reef Aquariums.
$ python feed.py
Deploy is a little more complicated then a normal zappa fn, blame feedgen. It relies on a system level package, lxml, to parse xml. If deployed directly from my mac the lambda fails to find this package on the AWS side and crashes. To fix this I'm emulating the aws lambda runtime via a local docker image. If the code is built and deployed from there everything works. How to set that up:
I perfer to build my own because so it will have the latest zappa version. This can be done by cloning the repo https://github.com/mligus/zapp and building the image ex
$ docker build -t zappa-builder:001 .
$ cd project
$ export AWS_PROFILE=personal
$ docker run -ti -e AWS_PROFILE=${AWS_PROFILE} -v ~/.aws:/root/.aws -v $(pwd):/var/task --rm zappa-builder:001 bash
zappa> pip install --user pipenv
zappa> pipenv install
I had some issues with Pipenv.lock but setting python_version to '3' worked both for the container and my mac
zappa> pipenv shell
zappa> (venv) zappa deploy production