-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathDockerfile.debian.rapids
More file actions
75 lines (56 loc) · 2.71 KB
/
Dockerfile.debian.rapids
File metadata and controls
75 lines (56 loc) · 2.71 KB
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
# Start from base image: nvidia-cuda or rapids base image
# FROM nvidia/cuda:11.3.0-cudnn8-runtime-ubuntu20.04
# FROM rapidsai/rapidsai-core:21.12-cuda11.0-runtime-ubuntu20.04-py3.8
ARG BASE_IMAGE
FROM ${BASE_IMAGE}
ARG TAG
ARG REQUIREMENTS_PYTHON_BASE
ARG REQUIREMENTS_PYTHON_SPECIFIC
USER root
# setup environment
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
ENV PATH /dltk/.local/bin:/dltk/.local/lib/python3.9/site-packages/:$PATH
ENV DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A4B469963BF863CC
# install nodejs
RUN curl -fsSL https://deb.nodesource.com/setup_current.x | bash -
RUN apt-get update --fix-missing && apt-get install -y wget bzip2 git ca-certificates nodejs>=18.0.0 build-essential
# update everything
RUN apt-get update && apt-get upgrade -y
# configure file system
WORKDIR /srv
RUN mkdir /dltk
# rapids env upgrade pip
RUN /bin/bash -c "source activate base && pip install --upgrade pip"
# rapids env basic requirements
COPY ./requirements_files/${REQUIREMENTS_PYTHON_BASE} /dltk/${REQUIREMENTS_PYTHON_BASE}
RUN /bin/bash -c "source activate base && pip install --no-cache-dir --upgrade -r /dltk/${REQUIREMENTS_PYTHON_BASE}"
# rapids env specific requirements
COPY ./requirements_files/${REQUIREMENTS_PYTHON_SPECIFIC} /dltk/${REQUIREMENTS_PYTHON_SPECIFIC}
RUN /bin/bash -c "source activate base && pip install --no-cache-dir --upgrade -r /dltk/${REQUIREMENTS_PYTHON_SPECIFIC}"
# creating new self signed certs
RUN openssl req -x509 -nodes -days 3650 -newkey rsa:2048 -keyout dltk.key -out dltk.pem -subj="/CN=dsdl"
RUN mkdir /dltk/.jupyter/; mv dltk.key /dltk/.jupyter/dltk.key; mv dltk.pem /dltk/.jupyter/dltk.pem
# Copy bootstrap entry point script
COPY bootstrap_scripts/bootstrap_rapids.sh /dltk/
COPY app /dltk/app
COPY notebooks /dltk/notebooks
# Install local DSDL supporting functions
RUN mkdir /dltk/packages
COPY package-dsdlsupport/dist/dsdlsupport-1.0.0.tar.gz /dltk/packages/dsdlsupport-1.0.0.tar.gz
RUN pip3 install /dltk/packages/dsdlsupport-1.0.0.tar.gz
# Copy jupyter config
COPY config/jupyter_notebook_config.py /dltk/.jupyter/jupyter_notebook_config.py
# Since JupyterLab 3 jupyter server config needs to be set
COPY config/jupyter_server_config.py /dltk/.jupyter/jupyter_server_config.py
# Copy jupyter notebook conversion template to export python module
COPY config/jupyter_notebook_template.tpl /dltk/.jupyter/jupyter_notebook_conversion.tpl
COPY config/null.tpl /dltk/.jupyter/null.tpl
# Handle user rights
RUN chown -R rapids:conda /dltk
RUN chown -R rapids:conda /srv
USER rapids
# Expose container port 5000 (MLTK Container Service) and 8888 (Notebook)
EXPOSE 5000 8888
# Define bootstrap as entry point to start container
ENTRYPOINT ["/dltk/bootstrap_rapids.sh"]