CloudCompare / CloudComPy

Python wrapper for CloudCompare
Other
296 stars 43 forks source link

Docker image build processes takes really long #23

Open MariusKo42 opened 2 years ago

MariusKo42 commented 2 years ago

Hi all,

for the first time I'm using docker and CloudComPy.

When I build the docker image I have very long processing times (> 20 min.). This seems to be particularly due to the following step:

 => => # Collecting package metadata (current_repodata.json): ...working... done
 => => # Solving environment: ...working... failed with initial frozen solve. Retrying with flexible solve.                                                                                                                                                                                           
 => => # Solving environment: ...working... failed with repodata from current_repodata.json, will retry with next repodata source.                                                                                                                                                                    
 => => # Collecting package metadata (repodata.json): ...working... done                                                                                                                                                                                                                              
 => => # Solving environment: ...working... failed with initial frozen solve. Retrying with flexible solve.
 => => # Solving environment: ...working..

Do you have any recommendations on how to make it work faster?

prascle commented 2 years ago

Hi, Yes, the conda solver step is very, very long... If I understand the way the solver works, it should be faster if we set a number of versions of the packages in the conda list, in the instruction conda install boost cgal cmake ... You can start from the versions that the solver has chosen (see conda_list). I have not fixed the versions of this list to follow the evolutions of the conda packaging. If we freeze it at a given time, we will probably have to make it evolve regularly. However, this can save time. If you test and notice a significant improvement, I'm interested in the result, I will indicate it for the next versions.

Regards, Paul

chrise96 commented 2 years ago

I had the same issue on Linux Ubuntu 20.04. I solved it by first installing all conda packages except gdal and pdal:

conda install boost cgal cmake eigen ffmpeg jupyterlab matplotlib mysql numpy opencv openmp pcl psutil "qhull=2019.1" qt scipy sphinx_rtd_theme spyder tbb tbb-devel xerces-c

Next, install this:

sudo apt-get install cmake gcc g++
sudo apt-get install build-essential
sudo apt-get install -y pdal
pip install PDAL==version
sudo apt-get install libgdal-dev
export CPLUS_INCLUDE_PATH=/usr/include/gdal
export C_INCLUDE_PATH=/usr/include/gdal
pip3 install setuptools==57.5.0
gdal-config --version
pip install GDAL==version
prascle commented 2 years ago

Hello, Thank you @chrise96 for this contribution, it gives me tracks to propose something faster. The instructions I propose are the ones I use to build CloudComPy with Docker, minimizing the dependencies to the Host system, to promote portability. If it's for a more personal use or if we target very targeted distributions, there is a lot to gain. I also personally compile CloudComPy with Ubuntu 20.04 native packages, but I don't publish the result anymore, because I would have to keep the list of necessary dependencies up to date to publish them!

mhl787156 commented 3 months ago

HI all, Just tried this today, things seem to speed up considerably by using mamba rather than conda without needing any other changes!

jlee-67 commented 2 weeks ago

HI all, Just tried this today, things seem to speed up considerably by using mamba rather than conda without needing any other changes!

do you have any tips on how to use mamba to build a docker image for cloudcompy? or install CloudComPy310 environment using mamba?

I've only used miniconda before so I'm wondering if using mamba is faster or not. Thanks!