From cd22d8eba028fd3ac089711a6f23cb9f977fa53f Mon Sep 17 00:00:00 2001 From: quinnwai Date: Tue, 16 Apr 2024 11:27:50 -0700 Subject: [PATCH 1/2] create new base image, update existing --- restricted-cpu-root/README.md | 2 +- restricted-gpu-root/Dockerfile | 20 ++++++++++++++++++++ restricted-gpu-root/README.md | 3 +++ 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 restricted-gpu-root/Dockerfile create mode 100644 restricted-gpu-root/README.md diff --git a/restricted-cpu-root/README.md b/restricted-cpu-root/README.md index 4fd26ec..15fbd90 100644 --- a/restricted-cpu-root/README.md +++ b/restricted-cpu-root/README.md @@ -1,3 +1,3 @@ # Restricted CPU Root -Dockerfile containing the Jupyter Notebooks for the Bridge2AI project, adapted from the [restricted-gpu-slim/Dockerfile](https://github.com/uc-cdis/containers/blob/master/jupyter-slim/Dockerfile) from Center for Translational Data Science at University of Chicago. No GPU features are enabled in this Dockerfile but root access is provided, making this a suitable image for building off of. +Dockerfile containing the Jupyter Notebooks for the Bridge2AI project, adapted from the [restricted-gpu-slim/Dockerfile](https://github.com/uc-cdis/containers/blob/master/jupyter-slim/Dockerfile) from Center for Translational Data Science at University of Chicago. Briefly, it provides a VM with a Jupyter Notebooks server and restrictions on downloads (disabled access to download buttons). No GPU features are enabled in this Dockerfile but root access is provided, making this a suitable image for building off of. diff --git a/restricted-gpu-root/Dockerfile b/restricted-gpu-root/Dockerfile new file mode 100644 index 0000000..e886206 --- /dev/null +++ b/restricted-gpu-root/Dockerfile @@ -0,0 +1,20 @@ +# use base image +FROM quay.io/ohsu-comp-bio/bridge2ai-jupyter:cpu-root + +RUN sudo apt update + +# setup CUDA +RUN sudo apt-get install -y kmod \ + && wget https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_520.61.05_linux.run \ + && sudo bash cuda_11.8.0_520.61.05_linux.run --silent --toolkit + +# setup cuDNN +RUN wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb \ + && sudo dpkg -i cuda-keyring_1.1-1_all.deb \ + && sudo apt-get update \ + && sudo apt-get -y install cudnn \ + && echo 'export PATH=$PATH:/usr/local/cuda-11.8/bin' > ~/.bashrc \ + && echo 'export LD_LIBRARY_PATH=/usr/local/cuda-11.8/lib6:$LD_LIBRARY_PATH' >> ~/.bashrc \ + && source ~/.bashrc + +RUN rm cuda_11.8.0_520.61.05_linux.run cuda-keyring_1.1-1_all.deb \ No newline at end of file diff --git a/restricted-gpu-root/README.md b/restricted-gpu-root/README.md new file mode 100644 index 0000000..ebceeca --- /dev/null +++ b/restricted-gpu-root/README.md @@ -0,0 +1,3 @@ +# Restricted GPU + +Builds on top of the `restricted-cpu-root` image. Provides GPU setup with CUDA and CuDNN. Tested on AWS GPU P3 instance (Tesla V100 GPUs). See Dockerfile for more details. \ No newline at end of file From 47e97ce11bf8b4b66eb9756a5babac39d6b29ef6 Mon Sep 17 00:00:00 2001 From: quinnwai Date: Tue, 16 Apr 2024 14:02:16 -0700 Subject: [PATCH 2/2] ai readi image --- ai-readi/Dockerfile | 36 ++++++++++++++++++++++++++++++++++++ ai-readi/README.md | 3 +++ ai-readi/requirements.txt | 38 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 77 insertions(+) create mode 100644 ai-readi/Dockerfile create mode 100644 ai-readi/README.md create mode 100644 ai-readi/requirements.txt diff --git a/ai-readi/Dockerfile b/ai-readi/Dockerfile new file mode 100644 index 0000000..81a336a --- /dev/null +++ b/ai-readi/Dockerfile @@ -0,0 +1,36 @@ +# use base image +FROM quay.io/ohsu-comp-bio/bridge2ai-jupyter:restricted-gpu-root + +# return to non-root user +USER $NB_UID +WORKDIR /home/$NB_USER + +# create image from requirements.txt +RUN conda create --name ai-readi +SHELL ["conda", "run", "-n", "ai-readi", "/bin/bash", "-c"] +COPY --chown=$NB_USER:$NB_GID requirements.txt . +RUN pip install -r requirements.txt && \ + rm requirements.txt + +# setup retfound +RUN conda create -n retfound python=3.7.5 -y +SHELL ["conda", "run", "-n", "retfound", "/bin/bash", "-c"] +RUN git clone https://github.com/rmaphoh/RETFound_MAE/ && \ + cd RETFound_MAE && \ + pip install -r requirement.txt && \ + cd $HOME + +# setup automorph +RUN conda create -n automorph python=3.6 -y +SHELL ["conda", "run", "-n", "automorph", "/bin/bash", "-c"] +RUN git clone https://github.com/rmaphoh/AutoMorph.git && \ + cd AutoMorph && \ + conda install pytorch==1.7.0 torchvision==0.8.0 torchaudio==0.7.0 cudatoolkit=11.1 -c pytorch -y && \ + pip install --ignore-installed certifi && \ + pip install -r requirement.txt && \ + pip install efficientnet_pytorch + +# allow use of conda envs +RUN conda init bash && exec bash + +# USER root \ No newline at end of file diff --git a/ai-readi/README.md b/ai-readi/README.md new file mode 100644 index 0000000..9ed8644 --- /dev/null +++ b/ai-readi/README.md @@ -0,0 +1,3 @@ +# AI-READi + +Docker file for AI-READi. Builds off `restricted-gpu-root` image, reverting use back to non-root privileges. Creates environment with requirements.txt, a retfound environment, and a Automorph envrionment. \ No newline at end of file diff --git a/ai-readi/requirements.txt b/ai-readi/requirements.txt new file mode 100644 index 0000000..6e2817c --- /dev/null +++ b/ai-readi/requirements.txt @@ -0,0 +1,38 @@ +appnope==0.1.4 +asttokens==2.4.1 +comm==0.2.2 +contourpy==1.2.1 +cycler==0.12.1 +debugpy==1.8.1 +decorator==5.1.1 +executing==2.0.1 +fonttools==4.50.0 +ipykernel==6.29.4 +ipython==8.23.0 +jedi==0.19.1 +jupyter_client==8.6.1 +jupyter_core==5.7.2 +kiwisolver==1.4.5 +matplotlib==3.8.3 +matplotlib-inline==0.1.6 +nest-asyncio==1.6.0 +numpy==1.26.4 +packaging==24.0 +parso==0.8.3 +pexpect==4.9.0 +pillow==10.3.0 +platformdirs==4.2.0 +prompt-toolkit==3.0.43 +psutil==5.9.8 +ptyprocess==0.7.0 +pure-eval==0.2.2 +pydicom==2.4.4 +Pygments==2.17.2 +pyparsing==3.1.2 +python-dateutil==2.9.0.post0 +pyzmq==25.1.2 +six==1.16.0 +stack-data==0.6.3 +tornado==6.4 +traitlets==5.14.2 +wcwidth==0.2.13