-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
92 lines (77 loc) · 3.59 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
FROM nvidia/cuda:11.2.0-cudnn8-devel-ubuntu20.04
RUN rm /etc/apt/sources.list.d/cuda.list
RUN rm /etc/apt/sources.list.d/nvidia-ml.list
ENV TZ=Europe/London
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# Install python3.8
RUN : \
&& apt-get update \
&& apt-get install -y --no-install-recommends software-properties-common \
&& add-apt-repository -y ppa:deadsnakes \
&& apt-get install -y --no-install-recommends python3.8-venv \
&& apt-get install libpython3.8-de -y \
&& apt-get install python3.8-dev -y \
&& apt-get install build-essential -y \
&& apt-get clean \
&& :
# Add env to PATH
RUN python3.8 -m venv /venv
ENV PATH=/venv/bin:$PATH
# Install ASAP
RUN : \
&& apt-get update \
&& apt-get -y install curl git \
&& curl --remote-name --location "https://github.com/computationalpathologygroup/ASAP/releases/download/ASAP-2.1-(Nightly)/ASAP-2.1-Ubuntu2004.deb" \
&& dpkg --install ASAP-2.1-Ubuntu2004.deb || true \
&& apt-get -f install --fix-missing --fix-broken --assume-yes \
&& ldconfig -v \
&& apt-get clean \
&& echo "/opt/ASAP/bin" > /venv/lib/python3.8/site-packages/asap.pth \
&& rm ASAP-2.1-Ubuntu2004.deb \
&& :
# Libraries
RUN python -m pip install -U pip
RUN pip install git+https://github.com/DIAGNijmegen/pathology-whole-slide-data
RUN pip install tensorflow-gpu
RUN pip install torch==1.9.0+cu111 torchvision==0.10.0+cu111 torchaudio==0.9.0 -f https://download.pytorch.org/whl/torch_stable.html
RUN pip install albumentations
RUN pip install pycm
RUN pip install tqdm
RUN pip install matplotlib
RUN pip install segmentation-models-pytorch
RUN pip install click
# RUN apt install nvidia-modprobe -y
# FOLDERS and PERMISSIONS
RUN groupadd -r algorithm && useradd -m --no-log-init -r -g algorithm algorithm
RUN mkdir -p /opt/algorithm /input /output /tempoutput /tempoutput/segoutput /tempoutput/detoutput /tempoutput/bulkoutput \
/configs \
&& chown algorithm:algorithm /opt/algorithm /input /output /tempoutput /tempoutput/segoutput /tempoutput/detoutput \
/tempoutput/bulkoutput
USER algorithm
WORKDIR /opt/algorithm
ENV PATH="/home/algorithm/.local/bin:${PATH}"
# add scripts and models
ADD --chown=algorithm:algorithm configs /opt/algorithm/configs
ADD --chown=algorithm:algorithm weights /opt/algorithm/weights
ADD --chown=algorithm:algorithm efficientnet /opt/algorithm/efficientnet
COPY --chown=algorithm:algorithm detection_inference.py /opt/algorithm/
COPY --chown=algorithm:algorithm segmentation_inference.py /opt/algorithm/
COPY --chown=algorithm:algorithm concave_hull.py /opt/algorithm/
COPY --chown=algorithm:algorithm tumor_stroma.py /opt/algorithm/
COPY --chown=algorithm:algorithm tilscore.py /opt/algorithm/
COPY --chown=algorithm:algorithm utils.py /opt/algorithm/
COPY --chown=algorithm:algorithm rw.py /opt/algorithm/
COPY --chown=algorithm:algorithm nms.py /opt/algorithm/
COPY --chown=algorithm:algorithm process.py /opt/algorithm/
COPY --chown=algorithm:algorithm testinput /input/
COPY --chown=algorithm:algorithm testinput/images /input/images/
ENTRYPOINT python -u -m process $0 $@s
## ALGORITHM LABELS ##
# These labels are required
LABEL nl.diagnijmegen.rse.algorithm.name=bcsegdetrumc
# These labels are required and describe what kind of hardware your algorithm requires to run.
LABEL nl.diagnijmegen.rse.algorithm.hardware.cpu.count=8
LABEL nl.diagnijmegen.rse.algorithm.hardware.cpu.capabilities=('avx',)
LABEL nl.diagnijmegen.rse.algorithm.hardware.memory=30G
LABEL nl.diagnijmegen.rse.algorithm.hardware.gpu.count=1
LABEL nl.diagnijmegen.rse.algorithm.hardware.gpu.memory=15G