File size: 2,228 Bytes
19c1f58 25cbfe7 19c1f58 25cbfe7 19c1f58 |
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 |
FROM python:3.12-slim
# FROM python:3.12
ARG task_type
ENV TASK_TYPE=$task_type
ENV EXECUTE_IN_DOCKER=1
RUN groupadd -r algorithm && useradd -m --no-log-init -r -g algorithm algorithm
RUN mkdir -p /opt/algorithm /input /output \
&& chown algorithm:algorithm /opt/algorithm /input /output
USER algorithm
WORKDIR /opt/algorithm
ENV PATH="/home/algorithm/.local/bin:${PATH}"
# ENV nnUNet_preprocessed="/opt/algorithm/nnunet_preprocessed"
# ENV nnUNet_results="/opt/algorithm/nnunet_results"
# ENV nnUNet_raw="/opt/algorithm/nnunet_raw"
# ENV PYTHONPATH="/opt/algorithm/nnUNetv2:$PYTHONPATH"
RUN python -m pip install --user -U pip
RUN mkdir -p /opt/algorithm/nnunet_raw \
/opt/algorithm/nnunet_preprocessed \
&& chown -R algorithm:algorithm /opt/algorithm/nnunet_raw /opt/algorithm/nnunet_preprocessed
COPY --chown=algorithm:algorithm .env /opt/algorithm/
COPY --chown=algorithm:algorithm process.py /opt/algorithm/
COPY --chown=algorithm:algorithm base_algorithm.py /opt/algorithm/
COPY --chown=algorithm:algorithm requirements.txt /opt/algorithm/
RUN python -m pip install --user -r requirements.txt
COPY --chown=algorithm:algorithm nnsyn /opt/algorithm/nnsyn
RUN cd /opt/algorithm/nnsyn && python -m pip install --user -e .
COPY --chown=algorithm:algorithm .env /opt/algorithm/
COPY --chown=algorithm:algorithm process.py /opt/algorithm/
COPY --chown=algorithm:algorithm base_algorithm.py /opt/algorithm/
# COPY --chown=algorithm:algorithm nnunet_preprocessed/ /opt/algorithm/nnunet_preprocessed
# COPY --chown=algorithm:algorithm nnunet_raw/ /opt/algorithm/nnunet_raw
COPY --chown=algorithm:algorithm nnunet_results/ /opt/algorithm/nnunet_results
COPY --chown=algorithm:algorithm 540_gt_nnUNetResEncUNetLPlans.json /opt/algorithm/
COPY --chown=algorithm:algorithm 542_gt_nnUNetResEncUNetLPlans.json /opt/algorithm/
COPY --chown=algorithm:algorithm 544_gt_nnUNetResEncUNetLPlans.json /opt/algorithm/
COPY --chown=algorithm:algorithm revert_normalisation.py /opt/algorithm/
COPY --chown=algorithm:algorithm dynamic-network-architectures/ /opt/algorithm/dynamic-network-architectures
RUN cd /opt/algorithm/dynamic-network-architectures && python -m pip install --user -e .
ENTRYPOINT python -m process $0 $@
|