Skip to content

Minimise conda usage in installation process #564

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

Merged
merged 7 commits into from
Apr 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 0 additions & 53 deletions .github/workflows/httomo_version_tag.yml

This file was deleted.

11 changes: 6 additions & 5 deletions .github/workflows/run_tests_framework_iris.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,19 @@ jobs:
- name: Create conda environment
uses: mamba-org/setup-micromamba@v1
with:
environment-file: conda/environment.yml
environment-name: httomo
create-args: >-
cupy==12.3.0
h5py=*=*mpi_openmpi*
mpi4py
tomopy==1.15
post-cleanup: 'all'
init-shell: bash

- name: Install httomo libraries and httomo
run: |
micromamba activate httomo
pip install --upgrade --force-reinstall pillow
pip install httomolibgpu tomobar
pip install --no-deps httomo-backends
pip install .
pip install .[dev-gpu]
micromamba list

- name: Generate full yaml pipelines using pipeline directives
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/run_tests_pipelines_iris.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,19 @@ jobs:
- name: Create conda environment
uses: mamba-org/setup-micromamba@v1
with:
environment-file: conda/environment.yml
environment-name: httomo
create-args: >-
cupy==12.3.0
h5py=*=*mpi_openmpi*
mpi4py
tomopy==1.15
post-cleanup: 'all'
init-shell: bash

- name: Install httomo libraries, httomo-backends and httomo
run: |
micromamba activate httomo
pip install --upgrade --force-reinstall pillow
pip install httomolibgpu tomobar
pip install --no-deps httomo-backends
pip install .
pip install .[dev-gpu]
micromamba list

- name: Generate full yaml pipelines using pipeline directives
Expand Down
19 changes: 0 additions & 19 deletions .scripts/conda_upload.sh

This file was deleted.

8 changes: 0 additions & 8 deletions .scripts/decrypt_secret.sh

This file was deleted.

1 change: 0 additions & 1 deletion .scripts/my_secret.json.gpg

This file was deleted.

20 changes: 0 additions & 20 deletions conda/environment-cpu.yml

This file was deleted.

28 changes: 0 additions & 28 deletions conda/environment.yml

This file was deleted.

23 changes: 0 additions & 23 deletions conda/recipe/build.sh

This file was deleted.

7 changes: 0 additions & 7 deletions conda/recipe/conda_build_config.yaml

This file was deleted.

79 changes: 0 additions & 79 deletions conda/recipe/meta.yaml

This file was deleted.

53 changes: 27 additions & 26 deletions docs/source/howto/installation.rst
Original file line number Diff line number Diff line change
@@ -1,46 +1,47 @@
Installation Guide
******************

HTTomo is available on PyPI, so it can be installed into either a virtual environment or a
conda environment.

Install HTTomo as a PyPi package
=========================================================
.. code-block:: console
However, there are certain constraints under which a virtual environment can be used, due to
the dependence on an MPI implementation, the hdf5 library, CUDA libraries, and whether the user
requires using :code:`tomopy` methods in pipelines.

$ pip install httomo # this will install the CPU-only version
$ pip install httomo httomolibgpu # this will install the GPU backend
Virtual environment
===================

Install HTTomo as a pre-built conda Python package
==================================================
A virtual environment can be used if the following conditions are met:

This installation is preferable as it should take care all of dependencies including :ref:`backends_list` by getting them from the dedicated anaconda channel.
- an MPI implementation is installed on the system (ie, OpenMPI)
- the hdf5 library is installed on the system
- CUDA libraries or CUDA toolkit are installed on the system
- methods from :code:`tomopy` are not required to be used in pipelines

.. code-block:: console

$ conda env create --name httomo # create a fresh conda environment
$ conda install "httomo/linux-64::httomo * py310_openmpi_regular*" -c conda-forge

Install as a Python module
===========================
$ python -m venv httomo
$ source httomo/bin/activate
$ MPICC=$(type -p mpicc) pip install mpi4py==3.1.6
$ pip install cython numpy pkgconfig setuptools # build dependencies of h5py
$ CC=$(type -p mpicc) HDF5_MPI="ON" HDF5_DIR=/path/to/parallel-hdf5 pip install --no-build-isolation --no-binary=h5py h5py
$ pip install cupy-cuda12x # install cupy-cuda11x if CUDA library/CUDA toolkit version is 11.x
$ pip install aiofiles astra-toolbox ccpi-regularisation-cupy click graypy hdf5plugin loguru nvtx pillow pyyaml scikit-image scipy tomobar tqdm
$ pip install --no-deps httomo httomolib httomolibgpu httomo-backends

If installation above for some reason is not working for you, then the best way to install HTTomo is to create conda environment first and then
`pip install` HTTomo into it. You will need to `git clone` HTTomo repository to your disk first. Use `environment.yml` file to install
the GPU-supported HTTomo. For CPU-only version, please use `environment-cpu.yml` instead.
Conda environment
=================

.. code-block:: console

$ git clone git@github.com:DiamondLightSource/HTTomo.git # clone the repo
$ conda env create --name httomo --file conda/environment.yml # install dependencies for GPU version
$ conda activate httomo # activate environment
$ pip install . # Install the module
$ conda env create --name httomo
$ conda activate httomo
$ conda install -c conda-forge cupy==12.3.0 openmpi==4.1.6 h5py[build=*openmpi*]
$ conda install -c conda-forge tomopy==1.15 # optional
$ pip install httomo httomolib httomolibgpu

Setup HTTomo development environment:
======================================================
.. code-block:: console

$ pip install -e .[dev] # development mode

Build HTTomo as a conda Python package
======================================================
.. code-block:: console

$ conda build conda/recipe/ -c conda-forge -c https://conda.anaconda.org/httomo/ --no-test
Loading