marvel-nccr / quantum-mobile

A Virtual Machine for computational materials science
https://quantum-mobile.readthedocs.io
Other
91 stars 32 forks source link

download size of qm 20.11.2a #156

Closed ltalirz closed 3 years ago

ltalirz commented 3 years ago

@chrisjsewell I see that QM size increased from 3.4GB (9.9GB extracted) at 20.6.1 to 4.4GB (13.2GB extracted) at 20.11.2a. I.e. it takes an extra 3.3GB on disk.

Do you happen to know why?

chrisjsewell commented 3 years ago

Well the distribution has increased from 6 simulation codes to 8, plus siesta now has more dependencies, plus an extra python virtual environment for jupyter.

20.6.1:

20.11.2a:

But obviously if you can identify any ways to "trim the fat" that would be great 😄

chrisjsewell commented 3 years ago

Note the "Disk Usage Analyzer" application is included in the VM, so can be used to look at this.

image

A number of things of note:

image image image image
ltalirz commented 3 years ago

thanks for looking into this!

Then the question is whether we really need to also have the "raw" psuedo files available

I think we want to keep them. QM is not just for AiiDA use.

ltalirz commented 3 years ago

By the way, if we were to use conda to install cp2k, qe, siesta, ... some dynamically linked libraries could be reused. E.g. the cp2k binary from conda-forge is just 38MB instead of 304MB

chrisjsewell commented 3 years ago

how much space does Conda take up in general?

chrisjsewell commented 3 years ago

Remove Python 2.7 install (210 Mb in /usr/lib/python2.7). It's installed in roles/marvel-nccr.ansible_prerequisites/tasks/main.yml,

Implemented in: https://github.com/marvel-nccr/quantum-mobile/commit/d27a90d2bb317d6c551e6535a799a4430fad08ae

The psuedopotentials take up >300 Mb: the downloads made in roles/marvel-nccr.aiida/tasks/aiida-pps.yml to the aiida folder can be removed, once they are imported to reclaim ~80Mb

Implemented in: https://github.com/marvel-nccr/ansible-role-aiida/commit/cbb17a5c330fcd433e0d05006013c8458f320cb2

The jupyter virtual env can be reduced by ~500Mb with jupyter lab clean

Implemented in: https://github.com/marvel-nccr/ansible-role-aiidalab/commit/7403438bc290b1e105e818afc698869ea7e4bce0

With all these in place I have created https://quantum-mobile.readthedocs.io/en/latest/releases/both/21.03.18-qe.html, from https://github.com/marvel-nccr/quantum-mobile/blob/main/playbook-build-qe.yml, which only contains the quantum espresso code and aiida plugin (plus aiidalab etc)

This produces a 3.5 GB VM (10.4 GB extracted) and 1.52 GB Docker image on Docker hub (4.4 Gb extracted)

ltalirz commented 3 years ago

great, thanks! I consider this issue addressed then; we can still come back to it in the future for further ideas on reducing image size (there are others as well https://github.com/marvel-nccr/quantum-mobile/issues/84 ).

chrisjsewell commented 3 years ago

As a reference baseline, here also is some snapshots of the VM, created with no simulation code or aiidalab roles (just the aiida role), and after running cleanup:

image image image image

ltalirz commented 3 years ago

you may want to consider using something like filelight that gives a multi-level breakup in one view

libreoffice might be a candidate for removal, but of course there is also a benefit to not worrying about the ubuntu defaults.