|
1 | | -FROM pytorch/pytorch:1.11.0-cuda11.3-cudnn8-runtime |
| 1 | +FROM ghcr.io/fets-ai/fetstool_docker_dependencies:0.0.2.gpu |
2 | 2 |
|
3 | 3 | LABEL authors="FeTS_Admin <admin@fets.ai>" |
4 | 4 |
|
5 | | -RUN apt-get update -y |
| 5 | +RUN apt-get update && apt-get update --fix-missing && apt-get install -y libnss3 libnspr4 libxcursor1 libxcursor-dev libasound2 libdbus-1-dev libglfw3-dev libgles2-mesa-dev ffmpeg libsm6 libxext6 python3.8 python3.8-venv python3.8-dev python3-setuptools |
6 | 6 |
|
7 | | -RUN apt-get install wget zip unzip software-properties-common gcc g++ make -y |
| 7 | +# older python |
| 8 | +RUN apt-get update -y && apt install -y --reinstall software-properties-common && add-apt-repository ppa:deadsnakes/ppa && apt update -y && apt install -y python3.7 python3.7-venv python3.7-dev python3-setuptools |
8 | 9 |
|
9 | | -RUN apt-get update -y && add-apt-repository ppa:deadsnakes/ppa && apt update -y && apt install python3.7 python3.7-venv python3.7-dev python3-setuptools ffmpeg libsm6 libxext6 -y |
| 10 | +ENV PATH=/workspace/CaPTk/bin/qt/5.12.1/bin:/workspace/CaPTk/bin/qt/5.12.1/libexec:$PATH |
| 11 | +ENV CMAKE_PREFIX_PATH=/workspace/CaPTk/bin/ITK-build:/workspace/CaPTk/bin/DCMTK-build:/workspace/CaPTk/bin/qt/5.12.1/lib/cmake/Qt5:$CMAKE_PREFIX_PATH |
| 12 | +ENV SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL=True |
10 | 13 |
|
11 | | -# We will do git pull on the FeTS_Front-End master, because that is the repo using which the base image is made |
12 | | -# We will not do compiles on the PR because the idea is that the Xenial build will check the build status of |
13 | | -# the PR in any case. |
| 14 | +RUN pwd && ls -l |
14 | 15 |
|
15 | | -ARG VERSION=0.0.9 |
| 16 | +WORKDIR /Front-End |
16 | 17 |
|
17 | | -# download installer |
18 | | -RUN wget https://fets.projects.nitrc.org/FeTS_${VERSION}_Installer.bin && chmod +x FeTS_${VERSION}_Installer.bin |
| 18 | +COPY . . |
19 | 19 |
|
20 | | -# install FeTS and remove installer |
21 | | -RUN yes yes | ./FeTS_${VERSION}_Installer.bin --target ./FeTS_${VERSION} -- --cudaVersion 11 && rm -rf ./FeTS_${VERSION}_Installer.bin |
| 20 | +RUN pwd && ls -l && mv ./data/Algorithms_for_fetsTool1.0.zip OpenFederatedLearning/submodules/fets_ai/ && cd OpenFederatedLearning/submodules/fets_ai/ && unzip -qq Algorithms_for_fetsTool1.0.zip && rm -rf Algorithms_for_fetsTool1.0.zip |
22 | 21 |
|
23 | | -ENV PATH=/workspace/FeTS_${VERSION}/squashfs-root/usr/bin/:$PATH |
24 | | -ENV LD_LIBRARY_PATH=/workspace/FeTS_${VERSION}/squashfs-root/usr/lib/:$LD_LIBRARY_PATH |
25 | | -ENV SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL="True" |
| 22 | +RUN pwd && ls -l && mv ./data/GANDLF_for_fetsTool1.0.zip OpenFederatedLearning/submodules/fets_ai/Algorithms && cd OpenFederatedLearning/submodules/fets_ai/Algorithms && unzip -qq GANDLF_for_fetsTool1.0.zip && rm -rf GANDLF_for_fetsTool1.0.zip |
| 23 | + |
| 24 | +## C++ build |
| 25 | +RUN mkdir bin && cd bin && cmake -DCMAKE_INSTALL_PREFIX="./install/appdir/usr" -DITK_DIR="/workspace/CaPTk/bin/ITK-build" -DDCMTK_DIR="/workspace/CaPTk/bin/DCMTK-build" -DBUILD_TESTING=OFF .. && make -j$(nproc) && make install/strip |
| 26 | + |
| 27 | +# ## Python package installation -- this is for the new docker image, which is much simpler |
| 28 | +# RUN cd bin/install/appdir/usr/bin/ && python3.8 -m venv ./venv && ./venv/bin/pip install --upgrade pip wheel && ./venv/bin/pip install torch==1.13.1+cpu torchvision==0.14.1+cpu torchaudio==0.13.1 --extra-index-url https://download.pytorch.org/whl/cpu && ./venv/bin/pip install -e . && ./venv/bin/pip install setuptools-rust Cython scikit-build scikit-learn openvino-dev==2023.0.1 && ./venv/bin/pip install -e . |
26 | 29 |
|
27 | 30 | # set up environment and install correct version of pytorch |
28 | | -RUN cd ./FeTS_${VERSION}/squashfs-root/usr/bin/OpenFederatedLearning && \ |
| 31 | +RUN echo "Setting up virtual environment for OpenFederatedLearning with base dependencies" && \ |
| 32 | + cd bin/install/appdir/usr/bin/OpenFederatedLearning && \ |
29 | 33 | rm -rf ./venv && python3.7 -m venv ./venv && ./venv/bin/pip install Cython && \ |
30 | 34 | ./venv/bin/pip install --upgrade pip setuptools wheel setuptools-rust && \ |
31 | | - ./venv/bin/pip install torch==1.7.1+cu110 torchvision==0.8.2+cu110 torchaudio==0.7.2 -f https://download.pytorch.org/whl/torch_stable.html |
32 | | - |
33 | | -RUN cd ./FeTS_${VERSION}/squashfs-root/usr/bin/OpenFederatedLearning && \ |
| 35 | + ./venv/bin/pip install torch==1.7.1+cu110 torchvision==0.8.2+cu110 torchaudio==0.7.2 -f https://download.pytorch.org/whl/torch_stable.html && \ |
34 | 36 | ./venv/bin/pip install wheel && \ |
35 | | - ./venv/bin/pip install scikit-build scikit-learn && \ |
36 | 37 | ./venv/bin/pip install SimpleITK==1.2.4 && \ |
37 | 38 | ./venv/bin/pip install protobuf==3.17.3 grpcio==1.30.0 && \ |
38 | | - ./venv/bin/pip install opencv-python==4.2.0.34 |
39 | | - # ./venv/bin/pip install python-gdcm |
40 | | - |
41 | | -RUN cd ./FeTS_${VERSION}/squashfs-root/usr/bin/OpenFederatedLearning && \ |
42 | | - ./venv/bin/pip install setuptools --upgrade && \ |
| 39 | + ./venv/bin/pip install opencv-python==4.2.0.34 && \ |
| 40 | + ./venv/bin/pip install scikit-build scikit-learn && \ |
43 | 41 | make install_openfl && \ |
44 | | - make install_fets && \ |
45 | | - ./venv/bin/pip install -e ./submodules/fets_ai/Algorithms/GANDLF && \ |
46 | | - cd ../LabelFusion && \ |
47 | | - rm -rf venv && python3.7 -m venv ./venv && \ |
| 42 | + make install_openfl_pytorch |
| 43 | + |
| 44 | +RUN echo "Setting up virtual environment for OpenFederatedLearning with second-level dependencies" && \ |
| 45 | + cd bin/install/appdir/usr/bin/OpenFederatedLearning && \ |
| 46 | + ./venv/bin/pip install ../BrainMaGe && \ |
| 47 | + ./venv/bin/pip install ./submodules/fets_ai/Algorithms && \ |
| 48 | + ./venv/bin/pip install -e ./submodules/fets_ai/Algorithms/GANDLF |
| 49 | + |
| 50 | +RUN echo "Installing separate environment for LabelFusion" && \ |
| 51 | + cd bin/install/appdir/usr/bin/LabelFusion && \ |
| 52 | + rm -rf venv && python3.8 -m venv ./venv && \ |
48 | 53 | ./venv/bin/pip install --upgrade pip setuptools wheel setuptools-rust && \ |
49 | 54 | ./venv/bin/pip install -e . |
50 | 55 |
|
| 56 | +RUN echo "Downloading model weights" && \ |
| 57 | + cd bin/install/appdir/usr/data && \ |
| 58 | + wget https://upenn.box.com/shared/static/f7zt19d08c545qt3tcaeg7b37z6qafum.zip -O nnunet.zip && \ |
| 59 | + unzip -qq nnunet.zip && rm -rf nnunet.zip && \ |
| 60 | + wget https://upenn.box.com/shared/static/hhvn8nb9xtz6nxcilmdl8kbx9n1afkdu.zip -O ./fets_consensus_models.zip && \ |
| 61 | + unzip -qq fets_consensus_models.zip && rm -rf fets_consensus_models.zip |
| 62 | + |
| 63 | +### put together a data example that is already aligned and ready to invoke the brain extraction and tumor segmentation |
| 64 | + |
51 | 65 | # set up the docker for GUI |
| 66 | +ENV LD_LIBRARY_PATH=/CaPTk/bin/qt/5.12.1/lib:$LD_LIBRARY_PATH |
| 67 | +ENV PATH=/Front-End/bin/install/appdir/usr/bin/:$PATH |
52 | 68 | ENV QT_X11_NO_MITSHM=1 |
53 | 69 | ENV QT_GRAPHICSSYSTEM="native" |
54 | 70 |
|
55 | 71 | RUN echo "Env paths\n" && echo $PATH && echo $LD_LIBRARY_PATH |
56 | 72 |
|
57 | 73 | # define entry point |
58 | | -ENTRYPOINT ["/workspace/FeTS_0.0.9/squashfs-root/usr/bin/FeTS_CLI_Inference"] |
| 74 | +ENTRYPOINT ["/Front-End/bin/install/appdir/usr/bin/FeTS_CLI_Segment"] |
0 commit comments