-
Notifications
You must be signed in to change notification settings - Fork 31
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
Circumvent GWLF-E SegFaults due to NumPy #3090
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the numpy version where this module was introduced? I'm curious, if it within a compatible release range, that we should just upgrade? Are you concerned with introducing breaking changes?
If we stick with this approach, rather than keep the numpy version in sync with requirements.txt
, can numpy just be removed from that file altogether since ansible is now installing it?
According to https://stackoverflow.com/a/54153887, it was
I know that GWLF-E and Ulmo both require NumPy, and may transitively bring in their versions. I think the amount of testing required to ensure that the new version works would exhaust the available budget, and this seems the most light-weight solution.
Good observation. Currently Ansible only installs NumPy for the Worker. In App, it is installed via |
A recent release of NumPy introduced a new module _multiarray_umath. Unfortunately, there are some tools that depend on NumPy and pull in the latest version as a build dependency. This latest version is then replaced with the version specified in our requirements.txt, thus the module is not available at run-time causing the segfaults. By installing NumPy separately before requirements.txt is gathered, we ensure that whatever was using the most recent version of NumPy in its installation now uses the pre-installed one. We'll have to ensure that the version of NumPy in requirements.txt matches the one in Ansible. For details see: numpy/numpy#11871 https://stackoverflow.com/q/54153886
These are installed separately due to build issues. Having them here was redundant, and a cause of potential confusion if the version numbers in Ansible were to change away from these.
4352ee5
to
8aa7b57
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had pretty much the same two questions. Since I didn't have to write them out, I used that bandwidth to create an issue to remember to upgrade NumPy (#3093). 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the updates. I ran through the test script and also was able to multi-year model after rebuilding.
Overview
A recent release of NumPy introduced a new module
_multiarray_umath
. Unfortunately, there are some tools that depend on NumPy and pull in the latest version as a build dependency. This latest version is then replaced with the version specified in ourrequirements.txt
, thus the module is not available at run-time causing the segfaults.By installing NumPy separately before
requirements.txt
is gathered, we ensure that whatever was using the most recent version of NumPy in its installation now uses the pre-installed one.We'll have to ensure that the version of NumPy in
requirements.txt
matches the one in Ansible.For details see:
numpy/numpy#11871
https://stackoverflow.com/q/54153886
Connects #3089
Demo
Testing Instructions
Download and extract this file: celery-segfault.zip
Check out this branch and destroy and rebuild the Worker VM
Transfer the files into the Worker VM, and execute
test.py
Compare the generated
output.json
with the includedoutput.verify.json
:Go to :8000 and create a MapShed project.