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

Move to miniforge #1967

Merged
merged 3 commits into from
Nov 3, 2023
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
15 changes: 7 additions & 8 deletions .github/workflows/conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
echo "date=$(/bin/date -u "+%Y%V")" >> $GITHUB_OUTPUT
shell: bash

- name: Cache Mambaforge and Pip packages
- name: Cache Miniforge and Pip packages
uses: actions/[email protected]
env:
CACHE_NUMBER: 0
Expand All @@ -36,35 +36,34 @@ jobs:
key:
${{runner.os}}-condapkg-${{env.CACHE_NUMBER}}-${{steps.get-date.outputs.date}}-${{hashFiles('environment-dev.yml','conda/meta.yaml')}}

- name: Cache Mambaforge environment
- name: Cache Miniforge environment
uses: actions/[email protected]
id: cache-mambaforge-environment
id: cache-miniforge-environment
env:
CACHE_NUMBER: 0
with:
path: /usr/share/miniconda3/envs/mantidimaging-dev.cache
key:
${{runner.os}}-condaenv-${{env.CACHE_NUMBER}}-${{steps.get-date.outputs.date}}-${{hashFiles('environment-dev.yml','conda/meta.yaml', 'setup.py')}}

- name: Setup Mambaforge
- name: Setup Miniforge
uses: conda-incubator/[email protected]
with:
miniforge-version: latest
miniforge-variant: Mambaforge
activate-environment: mantidimaging-dev
auto-activate-base: false
use-mamba: true

- name: Mantid Imaging developer dependencies
if: steps.cache-mambaforge-environment.outputs.cache-hit != 'true'
if: steps.cache-miniforge-environment.outputs.cache-hit != 'true'
shell: bash -l {0}
run: |
conda deactivate
python3 ./setup.py create_dev_env
cp -Ta /usr/share/miniconda3/envs/mantidimaging-dev /usr/share/miniconda3/envs/mantidimaging-dev.cache

- name: Mantid Imaging developer dependencies - from cache
if: steps.cache-mambaforge-environment.outputs.cache-hit == 'true'
if: steps.cache-miniforge-environment.outputs.cache-hit == 'true'
shell: bash -l {0}
run: |
cp -Ta /usr/share/miniconda3/envs/mantidimaging-dev.cache /usr/share/miniconda3/envs/mantidimaging-dev
Expand All @@ -79,7 +78,7 @@ jobs:
shell: bash -l {0}
run: |
mamba env list
python --version; conda list ; pip list
python --version; mamba list ; pip list

- name: Yapf
shell: bash -l {0}
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
echo "date=$(/bin/date -u "+%Y%V")" >> $GITHUB_OUTPUT
shell: bash

- name: Cache Mambaforge and Pip packages
- name: Cache Miniforge and Pip packages
uses: actions/[email protected]
env:
CACHE_NUMBER: 0
Expand All @@ -36,18 +36,17 @@ jobs:
key:
${{runner.os}}-condapkg-${{env.CACHE_NUMBER}}-${{steps.get-date.outputs.date}}-${{hashFiles('environment-dev.yml','conda/meta.yaml')}}

- name: Setup Mambaforge
- name: Setup Miniforge
uses: conda-incubator/[email protected]
with:
miniforge-version: latest
miniforge-variant: Mambaforge
activate-environment: mantidimaging-dev
auto-activate-base: false
use-mamba: true

- name: Cache Mambaforge environment
- name: Cache Miniforge environment
uses: actions/[email protected]
id: cache-mambaforge-environment
id: cache-miniforge-environment
env:
CACHE_NUMBER: 0
with:
Expand All @@ -56,7 +55,7 @@ jobs:
${{runner.os}}-condaenv-${{env.CACHE_NUMBER}}-${{steps.get-date.outputs.date}}-${{hashFiles('environment-dev.yml','conda/meta.yaml')}}

- name: Mantid Imaging developer dependencies
if: steps.cache-mambaforge-environment.outputs.cache-hit != 'true'
if: steps.cache-miniforge-environment.outputs.cache-hit != 'true'
shell: bash -l {0}
run: |
conda deactivate
Expand All @@ -66,7 +65,7 @@ jobs:
shell: bash -l {0}
run: |
mamba env list
python --version; conda list ; pip list
python --version; mamba list ; pip list

- name: Yapf
shell: bash -l {0}
Expand Down
2 changes: 1 addition & 1 deletion docs/developer_guide/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ This will create a conda environment containing all the packages needed to run a

Afterwards the environment can be activated by running:

:code:`conda activate mantidimaging-dev`
:code:`mamba activate mantidimaging-dev`

To check that the set up was successful, try running the tests from the source directory:

Expand Down
13 changes: 7 additions & 6 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,22 @@ If Mantid Imaging has been installed using the Windows Installer, then it can be
Installing with Mamba/Conda
---------------------------

Mantid Imaging can be installed using the packages_ published to Anaconda Cloud, this
can be done with an existing Conda or Mamba distribution if you already
have one on your machine.
Mantid Imaging can be installed using the packages_ published to Anaconda Cloud, this can be done with an existing Conda
or Mamba distribution if you already have one on your machine. However if you have issues you may find it worth installing
a fresh Miniforge3.

.. _packages: https://anaconda.org/mantid/mantidimaging/

1. Download and install CUDA Runtime version 10.2 - https://developer.nvidia.com/cuda-10.2-download-archive before installing the Mantid Imaging environment.
2. Download and install `Mambaforge <https://github.com/conda-forge/miniforge>`_ or `Miniconda 3 <https://conda.io/miniconda.html>`_
2. Download and install `Miniforge3 <https://github.com/conda-forge/miniforge#download>`_ (this is the conda distribution that we recommend).
3. Make sure :code:`mamba` or :code:`conda` is available on your PATH. The steps below assume you are using mamba.
4. Create a mantidimaging conda environment:

- :code:`mamba env create -f https://raw.githubusercontent.com/mantidproject/mantidimaging/stable/environment.yml`

(Specific versions can be installed by using the release url, e.g. `https://raw.githubusercontent.com/mantidproject/mantidimaging/release-2.2.0/environment.yml`)

5. This creates an environment called :code:`mantidimaging` that you can activate via :code:`conda activate mantidimaging`
5. This creates an environment called :code:`mantidimaging` that you can activate via :code:`mamba activate mantidimaging`
6. **This step is required for Linux users only.** To ensure that MantidImaging can make full use of the memory available on your Linux machine, we need to set the shared memory size to an appropriate value. Please follow the steps below to do this:

- Open the etc/fstab file on your computer. You can do this by opening a terminal and running this command (with sudo if needed to allow you to edit the file): :code:`gedit /etc/fstab`
Expand Down Expand Up @@ -103,14 +103,15 @@ The latest nightly version can be installed with

- :code:`mamba env create -f https://raw.githubusercontent.com/mantidproject/mantidimaging/main/environment.yml`


This will make a `mantidimaging-nightly` environment.


Updating
~~~~~~~~
To update to the latest version of Mantid Imaging run:

:code:`conda activate mantidimaging && mamba update mantidimaging`
:code:`mamba env update -n mantidimaging -f https://raw.githubusercontent.com/mantidproject/mantidimaging/stable/environment.yml`

If you see any issues with package compatibility, the fastest solution is reinstalling the environment - see below.

Expand Down
Loading