Skip to content

Commit

Permalink
Merge pull request ilastik#2904 from btbest/remove-mamba
Browse files Browse the repository at this point in the history
Stop using mamba / disallow pytorch2.4.1
  • Loading branch information
btbest authored Sep 17, 2024
2 parents 380d831 + 04f6e2c commit f64ce0e
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 36 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/core-conda-bld.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ jobs:
auto-activate-base: true
activate-environment: ""
channel-priority: strict
miniforge-variant: Mambaforge
use-mamba: true
miniforge-version: latest
conda-solver: libmamba
- name: install xvfb/deps
run: |
sudo apt-get update
sudo apt-get install -yy libgl1-mesa-dev xvfb curl
- name: install common conda dependencies
run: mamba install -n base -c conda-forge mamba boa setuptools_scm -y
run: conda install -n base -c conda-forge boa setuptools_scm -y
- uses: actions/cache@v4
with:
path: |
Expand Down Expand Up @@ -84,15 +84,15 @@ jobs:
auto-activate-base: true
activate-environment: ""
channel-priority: strict
miniforge-variant: Mambaforge
use-mamba: true
miniforge-version: latest
conda-solver: libmamba
- name: install xvfb/deps
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -yy mesa-utils libgl1-mesa-dev xvfb curl
- name: install common conda dependencies
run: mamba install -n base -c conda-forge boa setuptools_scm -y
run: conda install -n base -c conda-forge boa setuptools_scm -y
- uses: actions/cache@v4
with:
path: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ jobs:
auto-update-conda: true
auto-activate-base: true
activate-environment: ""
miniforge-variant: Mambaforge
use-mamba: true
miniforge-version: latest
conda-solver: libmamba
- name: install build dependencies
run: |
conda install -n base -c conda-forge boa setuptools_scm anaconda-client -y
Expand Down
17 changes: 7 additions & 10 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The following text equips you with knowledge that makes contributing to ilastik

## Development Environment

1. Download and install [Git][git], [GitHub CLI][github-cli], and _the latest 64-bit_ [Mambaforge][mambaforge].
1. Download and install [Git][git], [GitHub CLI][github-cli], and _the latest 64-bit_ [Miniforge][miniforge].
- Windows: all following commands should be executed in the _Anaconda Prompt_ from the Start Menu.
- Linux: Git might be already preinstalled, GitHub CLI might be available in your system package manager.
- macOS: Git is already preinstalled, GitHub CLI is available in [Homebrew][homebrew].
Expand All @@ -29,20 +29,19 @@ The following text equips you with knowledge that makes contributing to ilastik
gh repo clone ilastik
```

1. If you have an existing [Miniconda][miniconda] installation, you can use it for ilastik development, but install [Mamba][mamba] and configure conda to use [strict channel priority][strict-channel-priority]:
1. If you have an existing conda installation, you can use it for ilastik development, but configure it to use [strict channel priority][strict-channel-priority].

```
conda config --set channel_priority strict
conda install --name base --channel conda-forge mamba
```

1. Create a new environment and install dependencies:

```
# from within the ilastik folder
mamba deactivate
mamba env remove --name ilastik
mamba env create --name ilastik --file dev/environment-dev.yml
conda deactivate
conda env remove --name ilastik
conda env create --name ilastik --file dev/environment-dev.yml
```

1. Install repositories as packages in development mode:
Expand Down Expand Up @@ -71,7 +70,7 @@ The following text equips you with knowledge that makes contributing to ilastik
1. Launch ilastik:

```
mamba activate ilastik
conda activate ilastik
cd ilastik
python ilastik_scripts/ilastik_startup.py
```
Expand Down Expand Up @@ -156,12 +155,10 @@ But please run those tools on the code you are contributing :)
[git]: https://git-scm.com/
[github-cli]: https://cli.github.com/
[miniconda]: https://docs.conda.io/en/latest/miniconda.html
[mambaforge]: https://github.com/conda-forge/miniforge#mambaforge
[homebrew]: https://brew.sh/
[conda-build]: https://docs.conda.io/projects/conda-build/en/latest/
[conda-develop]: https://docs.conda.io/projects/conda-build/en/latest/resources/commands/conda-develop.html
[mamba]: https://mamba.readthedocs.io/en/latest/
[miniforge]: https://github.com/conda-forge/miniforge?tab=readme-ov-file#miniforge3
[ilastik]: https://github.com/ilastik/ilastik
[volumina]: https://github.com/ilastik/volumina
[github-flow]: https://guides.github.com/introduction/flow/
Expand Down
6 changes: 3 additions & 3 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ If you don't have a dataset to work with, download one of the example projects t
### Conda installation (experimental)

ilastik is also available as a conda package on our `ilastik-forge` conda channel.
We recommend using [mamba][mamba] instead of conda, for faster installation:
You can install it from the commandline using [conda][conda]:

```bash
mamba create -n ilastik --override-channels -c pytorch -c ilastik-forge -c conda-forge ilastik
conda create -n ilastik --override-channels -c pytorch -c ilastik-forge -c conda-forge ilastik

# activate ilastik environment and start ilastik
conda activate ilastik
Expand Down Expand Up @@ -99,4 +99,4 @@ For more complex changes, see [CONTRIBUTING.md](CONTRIBUTING.md) for details.
[imagesc-search]: https://forum.image.sc/search
[issues]: https://github.com/ilastik/ilastik/issues
[edit-files-on-github]: https://docs.github.com/en/free-pro-team@latest/github/managing-files-in-a-repository/editing-files-in-another-users-repository
[mamba]: https://github.com/mamba-org/mamba
[conda]: https://github.com/conda-forge/miniforge?tab=readme-ov-file#miniforge3
10 changes: 5 additions & 5 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ install:
}
- cmd: set PATH=%MINIFORGE%;%MINIFORGE%\Scripts;%MINIFORGE%\Library\bin;%PATH%
- cmd: conda config --set always_yes yes --set changeps1 no --set channel_priority strict
- cmd: conda update -n base -c conda-forge conda mamba
- cmd: mamba install -n base -c conda-forge setuptools_scm
- cmd: conda update -n base -c conda-forge conda
- cmd: conda install -n base -c conda-forge setuptools_scm
- |
mamba env create --name %ENV_NAME% --file dev\environment-dev.yml
mamba install --name %ENV_NAME% --freeze-installed -c ilastik-forge -c conda-forge volumina
mamba run -n %ENV_NAME% pip install -e .
conda env create --name %ENV_NAME% --file dev\environment-dev.yml
conda install --name %ENV_NAME% --freeze-installed -c ilastik-forge -c conda-forge volumina
conda run -n %ENV_NAME% pip install -e .
- conda clean -p

build: off
Expand Down
4 changes: 2 additions & 2 deletions conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ outputs:
run:
- python 3.9.*
- ilastik-core {{ setup_py_data.version }}
- pytorch >=1.6
- pytorch >=1.6,!=2.4.1
- tiktorch 23.11.0*
- torchvision
- volumina
Expand Down Expand Up @@ -168,7 +168,7 @@ outputs:
run:
- python 3.9.*
- ilastik-core {{ setup_py_data.version }}
- pytorch >=1.6
- pytorch >=1.6,!=2.4.1
- tiktorch 23.11.0*
- torchvision
- pytorch-cuda
Expand Down
2 changes: 1 addition & 1 deletion dev/environment-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ dependencies:
# can be changed to request gpu versions
# pytorch 2.4.* will work for all platforms except osx-64, where currently the
# latest version is 2.2.2
- pytorch 2.4.*
- pytorch 2.4.*,!=2.4.1
- cpuonly # comment out for pytorch with cuda
# mamba does not "respect" track_features, which is the idea behind cpuonly,
# with ilastik-pytorch-version-helper-cpu we help mamba on linux and windows
Expand Down
14 changes: 7 additions & 7 deletions notebooks/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,26 @@ notebooks/
├── ...
```

We use _mamba/(conda)_ for Python-based projects and recommend it for scientific Python development.
It is assumed that you have already installed _mamba_ and are familiar with using a Terminal.
We use _conda_ for Python-based projects and recommend it for scientific Python development.
It is assumed that you have already installed _conda_ and are familiar with using a Terminal.

In order to run the notebook type the following in a Terminal/Command Line:

Note: mamba has to be configured with [_strict channel priority_](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-channels.html#strict-channel-priority) in order to produce consistent environments.
Note: conda has to be configured with [_strict channel priority_](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-channels.html#strict-channel-priority) in order to produce consistent environments.


```bash
# make sure to use strict channel priority - this setting is global but in general a good idea
mamba config --set channel_priority strict
conda config --set channel_priority strict

# create n environment - make sure to choose an appropriate <environment_name>
$ mamba env create -n <environment_name> -f environment.yml
$ conda env create -n <environment_name> -f environment.yml
# this will produce a lot of output

$ mamba activate <environment_name>
$ conda activate <environment_name>

# start the notebook server in the current folder
$ jupyter notebook --notebook-dir .

# to close the server hit `ctrl + c` in the terminal shut down the server by confirming with `y`
# to close the server hit `ctrl + c` in the terminal shut down the server by confirming with `y`
```

0 comments on commit f64ce0e

Please sign in to comment.