Skip to content

Bootstrap numpy installation #126

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

Closed
cgrimal opened this issue Jan 16, 2018 · 2 comments · Fixed by #128
Closed

Bootstrap numpy installation #126

cgrimal opened this issue Jan 16, 2018 · 2 comments · Fixed by #128

Comments

@cgrimal
Copy link

cgrimal commented Jan 16, 2018

Hi guys,

I have a private repository with C extensions. The setup.py file requires Numpy, so you need to have it installed on your system before building the package.
I run into a problem when using the dockerizePip option, because Numpy is not installed in the docker container.

I found 2 possible workarounds:

  1. Change the setup.py of my project to bootstrap installation of Numpy (see this stackoverflow post).
    PROS: project is more straightforward to install, and nothing has to be changed to this plugin.
    CONS: Numpy is built at every deploy, and it is very long.
  2. Add a bootstrapNumpy option to this plugin, that if true, will do a pip install numpy before running the install of the requirements.
    PROS: fast and flexible.
    CONS: Yet another option...

To be honest, the first option is not viable for me, because IMO building Numpy at every deploy is killing it. So I am using a dirty local version to implement the second option.
That being said, if someone run into the same issue, and if you think it might be useful to others, I can submit a PR.

Thanks!

@dschep
Copy link
Contributor

dschep commented Jan 16, 2018

I would prefer the third option which is to implement #114 (dockerfile build support), then you could just have:

Dockerfile:

FROM lambci/lambda:build-python3.6
RUN pip install numpy

sls.yml:

custom:
  dockerizePip: true
  dockerFile: Dockerfile

@cgrimal
Copy link
Author

cgrimal commented Jan 16, 2018

Agreed! This is a much more flexible and elegant solution.
Will try to look into it.

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 a pull request may close this issue.

2 participants