Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding the installation of h5py==3.11.0 in the dockerfile #465

Closed
wants to merge 2 commits into from

Conversation

mikibonacci
Copy link
Member

@mikibonacci mikibonacci commented Jun 10, 2024

Only if architecture is arm64. Otherwise the aiidalab-qe-vibroscopy plugin will fail to install. The reason is that we cannot install easily h5py via pip, for arm64.

This should solve issue aiidalab/aiidalab-qe#745 and mikibonacci/aiidalab-qe-vibroscopy#52

…cture is

arm64. Otherwise the aiidalab-qe-vibroscopy plugin will fail to install.
The reason is that we cannot install easily h5py via pip, for amr64.
@mikibonacci
Copy link
Member Author

mikibonacci commented Jun 10, 2024

@unkcpz , @AndresOrtegaGuerrero
not entirely sure that I placed the h5py mamba installation in the optimal place (because we just run the apt-get there), but at least is in the arm64 specific block of instructions.

@danielhollas
Copy link
Contributor

Can I ask, why is this only needed for arm64?

@mikibonacci
Copy link
Member Author

Hi @danielhollas, the reason is that for arm64 the h5py package has no wheel support, and this breaks the installation of the phonon plugin for the QE app. It seems that for a pyproject-based package you always need a wheel for each dependency package which is not yet installed.

@danielhollas
Copy link
Contributor

danielhollas commented Jun 10, 2024

If the wheel is not available than pip will attempt to install from source distribution (sdist), which presumably involves some compilation. What is the exact error that you're seeing? Perhaps instead of installing this package to the base image, we should instead install the missing dependencies? Since those might be useful to other packages in the future.

For example, with @AndresOrtegaGuerrero we've been discussing adding cmake recently.
https://aiida.discourse.group/t/installing-cmake-in-aiidalab-container/387

Am I missing something?

@mikibonacci
Copy link
Member Author

The error is this one: mikibonacci/aiidalab-qe-vibroscopy#52. Mainly, the problem is that we don't have HDF5 already compiled and installed:

Building h5py requires pkg-config unless the HDF5 path is explicitly specified using the environment variable HDF5_DIR.

So we can try to install via apt-get the hdf5 library, then setup the HDF5_DIR env variable. I will give it a try

@danielhollas
Copy link
Contributor

I think installing hdf5 via apt (or conda for that matter) is preferable since then you can choose which h5py version you install when the plugin is installed.

@mikibonacci
Copy link
Member Author

I completely agree. I'll modify my PR in respect of this

then install h5py via pip without issues.

The installation of pkg-config is required, it was not sufficient to just
install the hdf5 and then define the HDF5_DIR environment variable.
@mikibonacci
Copy link
Member Author

I added the installation of two packages: libhdf5-serial-dev and pkg-config. I tried to install just the first package and set up the HDF5_DIR env var, but it was not sufficient to allow the afterwards pip installation of h5py.

Now h5py will be installed without issues when the aiidalab-qe-vibroscopy plugin is installed.

@danielhollas
Copy link
Contributor

Thanks @mikibonacci, can you please push your branch into origin repo (aiidalab/aiidalab-docker-stack/) and open a new PR from it? This will allow the build and tests to run (they currently don't run from forks). LMK in case you don't have write access to this repo (but I believe you should).

@mikibonacci
Copy link
Member Author

Hi @danielhollas, I tried and I have no permission to write in the origin repo, but as soon as you give me permission I will push! Thanks a lot for the help

@danielhollas
Copy link
Contributor

@mikibonacci can you try now?

@unkcpz FYI I've added write permissions to the internal-maintainers team LMK if that is not desired

image

@unkcpz
Copy link
Member

unkcpz commented Jun 11, 2024

@unkcpz FYI I've added write permissions to the internal-maintainers team LMK if that is not desired

The internal-maintainers team was create to do such things (for qeapp originally), it is desired. Thanks for adding it here.

@mikibonacci
Copy link
Member Author

@danielhollas , it works now, I just created the PR. thanks!

@mikibonacci
Copy link
Member Author

replaced by #468

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