Skip to content

Commit

Permalink
Merge pull request #436 from Dana-Farber-AIOS/dev-mamba
Browse files Browse the repository at this point in the history
Converting to mamba
  • Loading branch information
VarunUllanat authored Aug 19, 2024
2 parents 4ef4233 + 42cba7d commit 5298e86
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 57 deletions.
35 changes: 18 additions & 17 deletions .github/workflows/tests-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,34 +34,35 @@ jobs:
sudo apt-get update
sudo apt-get install openslide-tools
sudo apt-get install pandoc
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v2
- name: Setup Micromamba
uses: mamba-org/setup-micromamba@v1
with:
auto-activate-base: false
activate-environment: pathml
micromamba-version: '1.5.6-0'
environment-name: pathml
environment-file: requirements/environment_test.yml
# mamba-version: "*"
miniforge-version: latest
use-mamba: true
channels: conda-forge
python-version: ${{ matrix.python-version }}
init-shell: >-
bash
create-args: >-
python=${{ matrix.python-version }}
- name: Debugging
run: |
echo "Printing the environment.yml file..."
cat requirements/environment_test.yml
echo "Checking the status of mamba..."
mamba --version
echo "Checking the status of micro mamba..."
micromamba config
echo "Checking the available disk space..."
df -h
- name: Install dependencies with mamba
shell: bash -l {0}
run: mamba env update --file requirements/environment_test.yml --name pathml
- name: Conda info
# - name: Install dependencies with micromamba
# shell: bash -l {0}
# run: micromamba env update --file requirements/environment_test.yml --name pathml

- name: Micromamba info
shell: bash -l {0}
run: |
conda info
conda list
micromamba info
micromamba config
micromamba list
- name: Set default Temurin JDK 17
run: |
Expand Down
29 changes: 15 additions & 14 deletions .github/workflows/tests-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,33 +17,34 @@ jobs:
fail-fast: false
matrix:
os: [macos-latest]
python-version: ["3.8"]
python-version: ["3.8", "3.9", "3.10"]

steps:
- uses: actions/checkout@v2

- name: Install openslide
shell: bash -l {0}
run: brew install openslide


- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v3
- name: Setup Micromamba
uses: mamba-org/setup-micromamba@v1
with:
auto-update-conda: true
miniforge-version: latest
use-mamba: true
python-version: ${{ matrix.python-version }}
activate-environment: pathml
micromamba-version: '1.5.6-0'
environment-name: pathml
environment-file: requirements/environment_mac.yml
channels: conda-forge
init-shell: >-
bash
create-args: >-
python=${{ matrix.python-version }}
- name: Conda info
shell: bash -l {0}
run: conda info
- name: Conda Version
- name: Micromamba info
shell: bash -l {0}
run: conda --version
run: |
micromamba info
micromamba config
micromamba list
- name: Set default Temurin JDK 17
run: |
Expand Down
30 changes: 14 additions & 16 deletions .github/workflows/tests-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,18 @@ jobs:
run: echo "JDK_HOME=${JAVA_HOME}" >> $GITHUB_ENV
shell: bash

- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v2

- name: Setup Micromamba
uses: mamba-org/setup-micromamba@v1
with:
auto-activate-base: false
activate-environment: pathml
micromamba-version: '1.5.6-0'
environment-name: pathml
environment-file: environment.yml
# environment-file: '.github/ci-environments/env-py39.yml'
# environment-file: .github/ci-environments/env-py${{ matrix.python-version == '3.10' && '310' || matrix.python-version == '3.9' && '39' || '38' }}.yml
mamba-version: "*"
python-version: ${{ matrix.python-version }}

# - name: Install JavaBridge and other dependencies
# shell: bash -l {0}
# run: |
# pip install python-javabridge
init-shell: >-
bash
create-args: >-
python=${{ matrix.python-version }}
- name: Run Python script to find JVM path
shell: bash -l {0}
Expand Down Expand Up @@ -91,11 +88,12 @@ jobs:
env:
OPENSLIDE_PATH: ${{ env.OPENSLIDE_PATH }}

- name: Conda info
- name: Mamba info
shell: bash -l {0}
run: |
conda info
conda list
micromamba info
micromamba config
micromamba list
- name: Install PathML
shell: bash -l {0}
Expand Down
43 changes: 34 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,25 @@ View the official [PathML Documentation on readthedocs](https://pathml.readthedo

## 1.1 Prerequisites

We recommend using [Conda](https://conda.io/projects/conda/en/latest/user-guide/getting-started.html#) for managing your environments.
We recommend using [Micromamba](https://mamba.readthedocs.io/en/latest/index.html) for managing your environments. We provide instructions on how to install PathML via Micromamba below. In addition, we also provide instructions on how to install via [Miniconda](https://docs.conda.io/en/latest/miniconda.html) should you have a license.

#### Installing Conda
#### Installation

If you don't have Conda installed, you can download Miniconda [here](https://docs.conda.io/en/latest/miniconda.html).
If you don't have Miniconda installed, you can download Miniconda [here](https://docs.conda.io/en/latest/miniconda.html).

#### Updating Conda and Using libmamba (Optional)

#### Upating Micromamba

Make sure you have the recent version of Micromamba by using the following command:
```
micromamba update
```

#### Updating Conda and Using libmamba (Optional)

**If you are using Micromamba, you can skip to the next [section](#Platform-Specific-External-Dependencies).**

We recommend that Anaconda/Microconda users complete the following steps to update your Conda version and use `libmamba` to resolve dependency conflicts.

Recent versions of Conda have integrated `libmamba`, a faster dependency solver. To benefit from this improvement, first ensure your Conda is updated:

Expand All @@ -80,7 +92,7 @@ conda config --set solver libmamba

#### Platform-Specific External Dependencies

For installation methods [1)](#2.1-Install-with-pip-(Recommended-for-Users)) and [2)](#2.2-Install-from-Source-(Recommended-for-Developers)), you will need to install the following platform-specific packages.
For installation methods [1)](#2.1-Install-with-Micromamba-and-pip-(Recommended-for-Users)) and [2)](#2.2-Install-from-Source-(Recommended-for-Developers)), you will need to install the following platform-specific packages.

* Linux: Install external dependencies with [Apt](https://ubuntu.com/server/docs/package-management):
````
Expand Down Expand Up @@ -108,7 +120,20 @@ For Windows users, an alternative to using `vcpkg` is to download and use pre-bu

## 1.2 PathML Installation Methods

### 1.2.1 Install with pip (Recommended for Users)
### 1.2.1 Install with Micromamba and pip (Recommended for Users)

#### Create and Activate Micromamba Environment and install openjdk
````
micromamba create -n pathml 'openjdk<=18.0' -c conda-forge python=3.9
micromamba activate pathml
````

#### Install `PathML` from PyPI
````
pip install pathml
````

### 1.2.2 Install with Anaconda and pip

#### Create and Activate Conda Environment
````
Expand All @@ -125,7 +150,7 @@ conda install -c conda-forge 'openjdk<=18.0'
pip install pathml
````

### 1.2.2 Install from Source (Recommended for Developers)
### 1.2.3 Install from Source (Recommended for Developers)

#### Clone repository
````
Expand Down Expand Up @@ -155,7 +180,7 @@ conda activate pathml
pip install -e .
````

### 1.2.3 Use Docker Container
### 1.2.4 Use Docker Container

First, download or build the PathML Docker container:

Expand Down Expand Up @@ -192,7 +217,7 @@ Note that these instructions assume that there are no other processes using port
Please refer to the `Docker run` [documentation](https://docs.docker.com/engine/reference/run/) for further instructions
on accessing the container, e.g. for mounting volumes to access files on a local machine from within the container.

### 1.2.4 Use Google Colab
### 1.2.5 Use Google Colab

To get PathML running in a Colab environment:

Expand Down
5 changes: 4 additions & 1 deletion requirements/environment_mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ dependencies:
- python<=3.10
- pip==23.3.2
- numpy==1.23.5
- python-javabridge==4.0.3
- scipy<=1.11.4
- scikit-image<=0.22.0
- matplotlib<=3.8.2
Expand All @@ -20,9 +21,11 @@ dependencies:
- coverage==7.3.4
- networkx<=3.2.1
- pip:
# - setuptools==58.2.0
# - numpy==1.23.5
- torch==1.13.1
- python-bioformats==4.0.7
- python-javabridge==4.0.3
# - python-javabridge==4.0.3
- protobuf==3.20.3
- onnx==1.15.0
- onnxruntime==1.16.3
Expand Down

0 comments on commit 5298e86

Please sign in to comment.