Skip to content

Conversation

@unkcpz
Copy link
Member

@unkcpz unkcpz commented Nov 26, 2022

The main purpose to include gcc is to install pymatgen by pip, otherwise the build will fail.

@danielhollas
Copy link
Contributor

@unkcpz how much does this change increase the size of the image?

@unkcpz
Copy link
Member Author

unkcpz commented Nov 26, 2022

@unkcpz how much does this change increase the size of the image?

Good question. The size increased quite a lot, the uncompressed full-stack image after pull increased from 2.22GB to 3.09GB.
However, I think the packages in aiida-core[atomic_tools] is needed by aiidalab-widgets-base anyway. If the pymatgen can get installed easily by pip, I also don't want to make this workaround 😅, to be honest, I am very sick of the pymatgen.. We have one feature relying on it in QeApp to check the dimension of the structure. I think we get rid of it by removing the feature.
@superstar54 do you know other package can be a good alternative for it?

@unkcpz
Copy link
Member Author

unkcpz commented Nov 26, 2022

Just google around and found two interesting tools for slim docker image:

  1. https://github.com/docker-slim/docker-slim
  2. https://github.com/wagoodman/dive

They can make the images multiple times thinner, deserve a try and then we can not too much care about the size.

@danielhollas
Copy link
Contributor

danielhollas commented Nov 26, 2022 via email

@unkcpz
Copy link
Member Author

unkcpz commented Nov 26, 2022

I would really like to avoid extra 800Mb just for pymatgen.

Agree, don't want to yield to pymatgen.

I specifically got rid of it in aiida-orca.

Okay, nice! But the dependency is from aiida-quantumespresso plugin side, and it not very easy to get rid of it.

The other option (the only option I'd say 😣 if we don't bind with pymatgen in the image) is to install gcc and then the pymatgen can be built without a problem. I test it the GCC increase full-stack from 2.22GB to 2.62GB. (I find vim also could be useful, and better to be installed in the base stack. What do you think @danielhollas ?) EDIT: vim by conda further increases the size to 2.74GB.

I wonder if there is a way to pin its version without installing it?

What is your purpose of this? The problem I faced is the plugin need it but the pymatgen can not installed with pip.

@unkcpz
Copy link
Member Author

unkcpz commented Nov 26, 2022

Quick test with adding pymatgen only, it increase the size to 3.09GB directly, which means all size increase of aiida-core[atomic_tools] is from it 🤷🏻‍♂️

@danielhollas
Copy link
Contributor

The problem I faced is the plugin need it but the pymatgen can not installed with pip.

Could you please open a separate issue and describe in detail what the problem is?
Or is it the one that you opened in aiida-core? aiidateam/aiida-core#5767

When I ran into this issue, I was able to solve it by installing pymatgen via pip separately from the aiida-core[atomic_tools].

pip install -U pymatgen

Which suggests there is a way to install it via pip we just need to ensure it's the correct version.

As an alternative, could you try installing aiida-core and aiidalab via pip? This is what you suggested in #316, and perhaps that is the way to go because we always have this fundamental mismatch that aiida-core is installed by conda, by AiiDAlab Apps' dependencies are installed via pip.

Copy link
Contributor

@danielhollas danielhollas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this change needs more discussion and exploration of possible solutions. Perhaps we could discuss on Tuesday meeting?

@unkcpz
Copy link
Member Author

unkcpz commented Nov 28, 2022

I think this change needs more discussion and exploration of possible solutions. Perhaps we could discuss on Tuesday meeting?

Yes, I think we need a discussion, let's do it tomorrow. I'll try to make a summary of issues about pymatgen.

@unkcpz
Copy link
Member Author

unkcpz commented Nov 28, 2022

The failed build of pymatgen is manifested at https://github.com/aiidalab/aiidalab-docker-stack/actions/runs/3568133449/jobs/5999401435.

@unkcpz unkcpz changed the title Pre-install the aiida-core atomic_tools to lab stack Pre-install the gcc compiler to lab stack Nov 29, 2022
@unkcpz
Copy link
Member Author

unkcpz commented Nov 29, 2022

The decision we made is to provide the GCC and vim in the base stack. I would still argue to install gcc through conda but vim can be install using apt. Since apt has less control of the version and gcc compiler should be very careful with the version. @danielhollas @yakutovicha if you don't have objections, I'll make a new PR for that.

@unkcpz
Copy link
Member Author

unkcpz commented Nov 29, 2022

For vim it is not a problem, they have the vim.tiny installed in the new minimal-notebook image as the default editor.

@unkcpz
Copy link
Member Author

unkcpz commented Nov 29, 2022

closed and re-addressed by #338

@unkcpz unkcpz closed this Nov 29, 2022
@yakutovicha yakutovicha deleted the preinstall-atomic-tools-to-lab-stack branch November 29, 2022 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants