openforis / sepal

Geographical Data Processing in the Cloud
https://sepal.io/
MIT License
205 stars 46 forks source link

the app venv are not flush on requirements change #176

Closed 12rambau closed 2 years ago

12rambau commented 2 years ago

This bug is currently preventing the bfast_gpu from executing on both test and prod servers.

description of the bug

When a new requirements.txt is set in a dashboard app the following script is updating/creating the venv used to launch the app. The proble m is if one of the lib is removed as the venv environment is not flush, it is not removed from the venv. It is painless is most of the case but for c++ based libs it can become critical (GDAL, CUDA, PROJ).

In the specific case of bfast_gpu the cupylib is dependant on the CUDA version. The previous installation was thus using cupy-cuda112 but as we updated CUDA in SEPAL we now request cupy-cuda114.

If you look in the current venv in the test server, launching the following script in this ven will raise the following error:

import cupy as cp 
 CuPy may not function correctly because multiple CuPy packages are installed
 in your environment:

cupy-cuda112, cupy-cuda114

potential solution

here, instead of directly install we could do it in 2 steps:

pip freeze | xargs pip uninstall -y
pip install -r requirements.txt
cdanielw commented 2 years ago

Now the venv will be removed before installing requirements.