Skip to content

Dockerfiles and build script for AWS lambda #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zymergen-jringgenberg
Copy link

These new scripts use the current two-container strategy to build RDKit and assemble an AWS Lambda Layer as a deployable zip file. As the Lambda environment is CentOS-like, the method for building Boost from source is reused here as well.

These builds work with master as well as the 2020_03 and 2019_09 minor releases of RDKit, using Boost 1.58.0.

This layer without NumPy installed was tested along with the AWS-provided SciPy layer, however dependency conflicts were observed once deployed to Lambda. There might be ways around these with a bit more work, but for now NumPy is included.

@tdudgeon
Copy link
Contributor

@zymergen-jringgenberg I'm happy to accept this PR (thanks for submitting!), but before I do so I thought it best to check whether the 'build boost from source' hack is still needed. My latest centos builds are based on Centos8 which has a suitable version of boost. If you are able to base on Centos8 them we can avoid this nasty hack.

@tdudgeon
Copy link
Contributor

@zymergen-jringgenberg One other thing. You probably want to set the RDBASE environment variable to /usr/share/RDKit. Otherwise some RDKit functions won't work correctly.
e.g. https://github.com/InformaticsMatters/docker-rdkit/blob/master/Dockerfile-java-centos#L33

See rdkit/rdkit#3053 for more details.

@zymergen-jringgenberg
Copy link
Author

@zymergen-jringgenberg I'm happy to accept this PR (thanks for submitting!), but before I do so I thought it best to check whether the 'build boost from source' hack is still needed. My latest centos builds are based on Centos8 which has a suitable version of boost. If you are able to base on Centos8 them we can avoid this nasty hack.

@tdudgeon thanks for checking! as far as I can tell, the most recent version of boost available from the Amazon repo is 1.53 (using lambci/lambda:build-python3.6):

bash-4.2# yum list | grep boost
boost.x86_64                         1.53.2-14.23.amzn1            amzn-main    
boost-atomic.i686                    1.53.2-14.23.amzn1            amzn-main    
boost-atomic.x86_64                  1.53.2-14.23.amzn1            amzn-main    
boost-build.noarch                   1.53.2-14.23.amzn1            amzn-main    
boost-chrono.i686                    1.53.2-14.23.amzn1            amzn-main    
boost-chrono.x86_64                  1.53.2-14.23.amzn1            amzn-main    
boost-context.i686                   1.53.2-14.23.amzn1            amzn-main    
boost-context.x86_64                 1.53.2-14.23.amzn1            amzn-main    
boost-date-time.i686                 1.53.2-14.23.amzn1            amzn-main

etc, etc.

The lambci image I used as a starting point isn't exact, since AWS doesn't provide official Docker images for Lambda. But it seems to be close enough for building the layer, provided that the boost 'hack' is still used.

@zymergen-jringgenberg
Copy link
Author

@zymergen-jringgenberg One other thing. You probably want to set the RDBASE environment variable to /usr/share/RDKit. Otherwise some RDKit functions won't work correctly.
e.g. https://github.com/InformaticsMatters/docker-rdkit/blob/master/Dockerfile-java-centos#L33

See rdkit/rdkit#3053 for more details.

OK, that's pretty interesting. I read through the ticket you linked to and I'll need to try this out with some running functions. Since the output of the layer build is a file archive, rather than an image, I'll need to try setting the RDBASE env var on the function definition. I'll start by trying to reproduce your error case.

If that's a requirement for running the Lambda then I'll update the files to include a note to that effect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants