HathorNetwork / hathor-explorer-service

MIT License
1 stars 3 forks source link

chore: upgrade python-hathorlib #308

Closed luislhl closed 9 months ago

luislhl commented 9 months ago

Acceptance Criteria

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):

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