We should use the latest version of python-hathorlib
The Lambdas should keep working without errors with it
Details
Previously, when trying to upgrade python-hathorlib, most of the Lambdas would fail with the following error:
[ERROR] Runtime.ImportModuleError: Unable to import module 'handlers/block_api': /lib64/libc.so.6: version `GLIBC_2.28' not found (required by /opt/python/cryptography/hazmat/bindings/_rust.abi3.so)
Traceback (most recent call last):
There is probably more than one way to solve this. I preferred to do it by just making the serverless-python-requirements plugin, which is who installs dependencies in our deploy process, to run the installation of dependencies inside a Lambda-compatible Docker image that is provided by Amazon. (See https://gallery.ecr.aws/lambda/python)
This solved the problem, since the wheels will now be built in an environment just like the one used by actual Lambdas.
Security Checklist
[ ] Make sure you do not include new dependencies in the project unless strictly necessary and do not include dev-dependencies as production ones. More dependencies increase the possibility of one of them being hijacked and affecting us.
Acceptance Criteria
Details
Previously, when trying to upgrade
python-hathorlib
, most of the Lambdas would fail with the following error:This was seemingly caused by the installation process of
cryptography
package, which was building its wheels in the CI-environment, but they were incompatible with the Lambda environment. (Also check https://repost.aws/knowledge-center/lambda-python-package-compatible and https://github.com/jpadilla/pyjwt/issues/800)There is probably more than one way to solve this. I preferred to do it by just making the
serverless-python-requirements
plugin, which is who installs dependencies in our deploy process, to run the installation of dependencies inside a Lambda-compatible Docker image that is provided by Amazon. (See https://gallery.ecr.aws/lambda/python)This solved the problem, since the wheels will now be built in an environment just like the one used by actual Lambdas.
Security Checklist