Details
-
Type:
Story
-
Status: In Progress
-
Resolution: Unresolved
-
Fix Version/s: None
-
Component/s: conda
-
Labels:None
-
Team:Architecture
-
Urgent?:No
Description
Moving more packages to conda has meant a larger footprint of the images due to conda image sizes
Conda uses the pkgs directory (effectively "$(dirname $(dirname $CONDA_EXE))/pkgs") as both a cache and a place to download binaries.
conda clean -t cleans up the tarballs, which is a good first step. The tarballs can unequivocally be cleaned up - they shouldn't really be needed ever again.
conda clean -a goes a step further and removes some extra things but retains the files for their hard links.
The entire pkgs directory could be wiped out to save 1.5GB, but installing additional environments on top of that environment may end up costing more disk space (no more hardlinks). In the context of a docker container, this might not be likely to happen - I don't believe it's possible to even create your own conda environment on nublado due to permissions, though I might be wrong.
Here is a comparison of the two strategies:
[lsst@62ff872ebb79 miniconda3-4.7.12]$ pwd
|
/opt/lsst/software/stack/python/miniconda3-4.7.12
|
[lsst@62ff872ebb79 miniconda3-4.7.12]$ du -hs .
|
3.9G .
|
[lsst@62ff872ebb79 miniconda3-4.7.12]$ source bin/activate
|
(base) [lsst@62ff872ebb79 miniconda3-4.7.12]$ conda clean -a
|
Cache location: /opt/lsst/software/stack/python/miniconda3-4.7.12/pkgs
|
Will remove the following tarballs:
|
...
|
...
|
removing minuit2-6.18.00-minuit2_standalone
|
(base) [lsst@62ff872ebb79 miniconda3-4.7.12]$
|
LICENSE.txt bin compiler_compat conda-meta condabin envs etc include lib pkgs share shell ssl x86_64-conda_cos6-linux-gnu
|
(base) [lsst@62ff872ebb79 miniconda3-4.7.12]$ du -hs .
|
3.1G .
|
[lsst@62ff872ebb79 miniconda3-4.7.12]$ pwd
|
/opt/lsst/software/stack/python/miniconda3-4.7.12
|
[lsst@62ff872ebb79 miniconda3-4.7.12]$ source bin/activate
|
(base) [lsst@62ff872ebb79 miniconda3-4.7.12]$ rm -rf pkgs/*
|
(base) [lsst@62ff872ebb79 miniconda3-4.7.12]$ du -hs .
|
2.6G .
|
You can create your own environment in nublado:
conda create -n mystack --clone lsst-scipipe-984c9f7
conda activate mystack
conda install -c conda-forge eups