BCDA-APS / bdp_controls

APS-U Beam line Data Pipelines - experiment controls with EPICS and Bluesky
Other
0 stars 1 forks source link

rebuild the conda environment #50

Closed prjemian closed 2 years ago

prjemian commented 2 years ago

Using pip, we ruined the conda environment. Rebuild the the env.yml file.

prjemian commented 2 years ago

Notice that conda is very slow to solve the package requirements. micromamba solves this list much faster and also downloads packages in parallel. But micromamba environments aren't activated by conda activate packagename.

Use micromamba to solve the package requirements and then create a conda environment from the explicit list. This is still faster than only using conda to solve the requirements.

prjemian commented 2 years ago

@sveseli This might interest you.

sveseli commented 2 years ago

@prjemian Thanks, very interesting... we might actually be able to use micromamba for DM if it speeds things up considerably

prjemian commented 2 years ago

Seems that pvapy requires a PVA client library from epics-base that is provided in the version from https://anaconda.org/epics/epics-base but that library is not packaged with https://anaconda.org/conda-forge/epics-base

(bdptest) bdp@terrier ~/DM/workflows/example-05 $ python blueskyImageServer.py --input-file /gdata/bdp/BDP/bdp-test-02/bdp_000001.tif
Traceback (most recent call last):
  File "/clhome/BDP/DM/workflows/example-05/blueskyImageServer.py", line 5, in <module>
    import pvaccess as pva
  File "/clhome/BDP/micromamba/envs/bdptest/lib/python3.9/site-packages/pvaccess/__init__.py", line 1,                 in <module>
    from .pvaccess import *
ImportError: libpvaClient.so.4.8.0: cannot open shared object file: No such file or directory

It is necessary to re-arrange the order of the channels in the env.yml file accordingly.

sveseli commented 2 years ago

If you install pvapy via pip, it has all epics libraries included (no need for epics-base conda packages). Epics base conda package is needed for conda pvapy packages.

prjemian commented 2 years ago

That's what ruined the conda environment.

prjemian commented 2 years ago

Specifically, the pip install did not consider the existing package requirements and managed to replace some conda installed packages. Not sure which ones.

prjemian commented 2 years ago
(bdp2022) bdp@terrier ~/DM/workflows/example-05 $ conda list | wc -l
408

That's a lot of things to consider. (3 header lines, so 40 other packages to consider)

prjemian commented 2 years ago

I've measured that micromamba is faster:

prjemian commented 2 years ago

With ~30 minutes per iteration using conda to refine env.yml, use of micromamba made this much faster.