Skip to content

Commit

Permalink
updated Dockerfile and dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
phiphi0815 committed May 16, 2024
1 parent dc326b4 commit 796cc52
Show file tree
Hide file tree
Showing 5 changed files with 199 additions and 470 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
name: Docker Image CI

on:
push:
branches:
- "master"
- "remove_old_models"
pull_request:
branches: [ "master" ]
workflow_dispatch:
#on:
# push:
# branches:
# - "master"
# - "remove_old_models"
# pull_request:
# branches: [ "master" ]
# workflow_dispatch:

# on: null # Disables all triggers for this workflow
on: null # Disables all triggers for this workflow

jobs:
push_to_registry:
Expand Down
57 changes: 48 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,62 @@ ENV DEBIAN_FRONTEND=noninteractive
ARG USER_ID
ARG GROUP_ID
ARG UNAME
RUN groupadd -g $GROUP_ID -o $UNAME
RUN groupadd -g $GROUP_ID -o user
RUN useradd -m -u $USER_ID -g $GROUP_ID -o -s /bin/bash $UNAME
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A4B469963BF863CC
USER root
RUN set -ex; \
for i in $(seq 1 10); do \
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys A4B469963BF863CC && break || sleep 15; \
done
RUN apt-get update --allow-unauthenticated
RUN apt-get install -y git
WORKDIR /opt
RUN mkdir /opt/virtualenv
RUN python3 -m venv /opt/virtualenv
COPY requirements.txt /opt/virtualenv
RUN /opt/virtualenv/bin/pip install --upgrade pip
RUN /opt/virtualenv/bin/pip install -r /opt/virtualenv/requirements.txt
#ENV PATH="/opt/miniconda3/bin:${PATH}"
#ARG PATH="/opt/miniconda3/bin:${PATH}"
#RUN wget https://repo.anaconda.com/miniconda/Miniconda3-py39_4.11.0-Linux-x86_64.sh \
# && bash Miniconda3-py39_4.11.0-Linux-x86_64.sh -p /opt/miniconda3 -b \
# && rm -vf Miniconda3-py39_4.11.0-Linux-x86_64.sh
#RUN conda install -y pytorch torchvision -c pytorch
#RUN python -c 'import torch;print(torch.backends.cudnn.version())'
#RUN apt-get install git
RUN git clone https://github.com/Project-MONAI/MONAI.git /opt/monai
WORKDIR /opt/monai
RUN git checkout b7403ee5a91caef158181a9dcc2b9b1453f9dbdd
RUN python setup.py install
#RUN conda install -y jupyter matplotlib
#RUN conda install -y -c conda-forge nibabel
#RUN conda install -y ignite -c pytorch
#RUN conda install -y scikit-image
#RUN conda install -y -c conda-forge tensorboard gdown python-lmdb
RUN echo "export PATH=/opt/miniconda3/bin:${PATH}" >> /etc/profile
USER $UNAME
RUN pip install --upgrade pip
RUN pip install -q "monai-weekly[nibabel, tqdm]==1.4.dev2347"
RUN pip install -q nilearn==0.10.2
RUN pip install notebook==7.0.6 jupyterlab==4.0.9 matplotlib==3.7.4
WORKDIR /mnt
#mongo
USER root
#RUN conda install -c anaconda pymongo qgrid dnspython
RUN pip install pymongo==4.6.0 dnspython==2.4.2 qgrid==1.3.1 scikit-image==0.21.0
RUN pip install pytorch-ignite==0.4.13
##RUN wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin
##RUN mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600
##RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub
##RUN add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ /"
##RUN apt-get update
##
##RUN apt-get install libnccl2 libnccl-dev
RUN pip install ipdb==0.13.13
RUN pip install scipy==1.10.1
RUN git clone https://github.com/Project-MONAI/tutorials.git /opt/monai-tutorials
WORKDIR /opt/monai-tutorials
RUN ls
RUN git checkout c501cbef2c291b4920b9a8ad3e4a67f334f79f30
COPY mindGlide/config/task_params.py /opt/monai-tutorials/modules/dynunet_pipeline/
COPY mindGlide/config/task_params.py /opt/monai-tutorials/modules/dynunet_pipeline/
WORKDIR /mnt
RUN pip install nibabel==5.1.0
USER $UNAME
COPY scripts/entrypoint.sh /entrypoint.sh
COPY ./ /opt/mindGlide
ENTRYPOINT [ "/entrypoint.sh" ]
ENTRYPOINT [ "/entrypoint.sh" ]
29 changes: 18 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,17 +117,24 @@ more information about the models:

| Model name and path in the models directory | Description | Dataset |
|-|-|-|
| /opt/mindGlide/models/model_0_net_key_metric=0.7627.pt | trained on dataset 1 | IPMSA |
| /opt/mindGlide/models/model_2_net_key_metric=0.7541.pt | trained on dataset 1 | IPMSA |
| /opt/mindGlide/models/model_2_net_key_metric=0.7579.pt | trained on dataset 1 | IPMSA |
| /opt/mindGlide/models/model_3_net_key_metric=0.7713.pt | trained on dataset 1 | IPMSA |
| /opt/mindGlide/models/model_3_net_key_metric=0.7717.pt | trained on dataset 1 | IPMSA |
| /opt/mindGlide/models/model_4_net_key_metric=0.7645.pt | trained on dataset 1 | IPMSA |
| /opt/mindGlide/models/model_5_net_key_metric=0.7866.pt | trained on dataset 1 | IPMSA |
| /opt/mindGlide/models/model_6_net_key_metric=0.7723.pt | trained on dataset 1 | IPMSA |
| /opt/mindGlide/models/model_7_net_key_metric=0.7634.pt | trained on dataset 1 | IPMSA |
| /opt/mindGlide/models/model_8_net_key_metric=0.7489.pt | trained on dataset 1 | IPMSA |
| /opt/mindGlide/models/model_9_net_key_metric=0.7738.pt | trained on dataset 1 | IPMSA |
| /opt/mindGlide/models/_20240404_conjurer_trained_dice_7733.pt | trained on dataset 1 (This model is 10 times larger than the previous models) | IPMSA |

### 📬 Citation

If you use MindGlide please cite this paper:

```bibtex
@article {Goebl2024.03.29.24305083,
author = {Philipp Goebl and Jed Wingrove and Omar Abdelmannan and Barbara Brito Vega and Jonathan Stutters and Silvia Da Graca Ramos and Owain Kenway and Thomas Rosoor and Evangeline Wassmer and Jeremy Chataway and Douglas Arnold and Louis Collins and Cheryl Hemmingway and Sridar Narayanan and Declan Chard and Juan Eugenio Iglesias and Frederik Barkhof and Yael Hacohen and Alan Thompson and Daniel Alexander and Olga Ciccarelli and Arman Eshaghi},
title = {Repurposing Clinical MRI Archives for Multiple Sclerosis Research with a Flexible, Single-Modality Approach: New Insights from Old Scans},
elocation-id = {2024.03.29.24305083},
year = {2024},
doi = {10.1101/2024.03.29.24305083},
URL = {https://www.medrxiv.org/content/early/2024/03/30/2024.03.29.24305083},
eprint = {https://www.medrxiv.org/content/early/2024/03/30/2024.03.29.24305083.full.pdf},
journal = {medRxiv}
}
```

### Acknowledgements

Expand Down
2 changes: 1 addition & 1 deletion build_docker_script.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
docker build --build-arg USER_ID=$(id -u) --build-arg GROUP_ID=$(id -g) --build-arg UNAME="arman" -t armaneshaghi/mind-glide:sep2023 .
docker build --build-arg USER_ID=$(id -u) --build-arg GROUP_ID=$(id -g) --build-arg UNAME="user" -t mspinpoint/mindglide:june2024 .

0 comments on commit 796cc52

Please sign in to comment.