forked from StatCan/aaw-kubeflow-containers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path6_jupyterlab.Dockerfile
142 lines (129 loc) · 6.14 KB
/
6_jupyterlab.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# installs vscode server, python & conda packages and jupyter lab extensions.
# Using JupyterLab 3.0 inherited docker-stacks base image. A few extensions we used to install do not yet support
# this version of Jupyterlab and/or are not OL-compliant so they have been removed until new compatible versions are available:
# jupyterlab-kale
# jupyterlab-variableinspector
# jupyterlab-archive
# jupyterlab-spellchecker
# jupyterlab-spreadsheet
# Install vscode
ARG VSCODE_VERSION=4.95.1
ARG VSCODE_SHA=dafa88431ff0b52ce9d92bceb30460edab95e7fa2c2a0e8cf9fb6cdb6c0752e7
ARG VSCODE_URL=https://github.com/coder/code-server/releases/download/v${VSCODE_VERSION}/code-server_${VSCODE_VERSION}_amd64.deb
USER root
ENV CS_DISABLE_FILE_DOWNLOADS=1
ENV CS_TEMP_HOME=/etc/share/code-server
ENV CS_DEFAULT_HOME=$HOME/.local/share/code-server
ENV SERVICE_URL=https://extensions.coder.com/api
RUN wget -q "${VSCODE_URL}" -O ./vscode.deb \
&& echo "${VSCODE_SHA} ./vscode.deb" | sha256sum -c - \
&& wget -q https://github.com/microsoft/vscode-cpptools/releases/download/v1.17.5/cpptools-linux.vsix \
&& apt-get update \
&& apt-get install -y nginx build-essential gdb \
&& dpkg -i ./vscode.deb \
&& rm ./vscode.deb \
&& rm -f /etc/apt/sources.list.d/vscode.list \
&& mkdir -p $CS_TEMP_HOME/Machine \
&& \
# Manage extensions
code-server --install-extension ms-python.python@2023.12.0 && \
code-server --install-extension REditorSupport.r@2.8.1 && \
code-server --install-extension ms-ceintl.vscode-language-pack-fr@1.79.0 && \
code-server --install-extension quarto.quarto@1.90.1 && \
code-server --install-extension databricks.databricks@1.4.0 && \
code-server --install-extension dvirtz.parquet-viewer@2.3.3 && \
code-server --install-extension redhat.vscode-yaml@1.14.0 && \
code-server --install-extension ms-vscode.azurecli@0.5.0 && \
code-server --install-extension mblode.pretty-formatter@0.2.1 && \
code-server --install-extension cpptools-linux.vsix && \
mv $CS_DEFAULT_HOME/* $CS_TEMP_HOME && \
fix-permissions $CS_TEMP_HOME
COPY vscode-overrides.json $CS_TEMP_HOME/Machine/settings.json
# Fix for VSCode extensions and CORS
# Languagepacks.json needs to exist for code-server to recognize the languagepack
COPY languagepacks.json $CS_TEMP_HOME/
RUN pip install \
'git+https://github.com/betatim/vscode-binder' && \
# jupyter_contrib_nbextensions likes to be installed with pip
mamba install --quiet --yes -c conda-forge \
'jupyter_contrib_nbextensions' \
'dash' \
'plotly' \
'ipywidgets' \
'markupsafe' \
'ipympl' \
'pexpect==4.9.0' \
'jupyter-server-proxy==4.2.0' \
'jupyterlab-language-pack-fr-fr' \
'jupyterlab_execute_time' \
'nb_conda_kernels' \
'jupyterlab-lsp' \
'jupyter-lsp' && \
jupyter server extension enable --py jupyter_server_proxy && \
jupyter nbextension enable codefolding/main --sys-prefix && \
jupyter labextension enable \
'@jupyterlab/translation-extension' \
'@jupyterlab/server-proxy' \
'nbdime-jupyterlab' \
&& \
jupyter lab build && \
jupyter lab clean && \
clean-layer.sh && \
rm -rf /home/$NB_USER/.cache/yarn && \
rm -rf /home/$NB_USER/.node-gyp && \
fix-permissions $CONDA_DIR && \
fix-permissions /home/$NB_USER
# Update and pin packages
# See https://github.com/StatCan/aaw-kubeflow-containers/issues/293
# Install python, R, Julia and other useful language servers
RUN julia -e 'using Pkg; Pkg.add("LanguageServer")' && \
/opt/conda/bin/R --silent --slave --no-save --no-restore -e 'install.packages("languageserver", repos="https://cran.r-project.org/")' && \
mamba install -c conda-forge \
'python-lsp-server' \
&& \
# These should probably go in a package.json file
# Copy the file over then use npm ci, much better flexibility for managing deps and CVEs
npm i -g \
'bash-language-server' \
'dockerfile-language-server-nodejs' \
'javascript-typescript-langserver' \
'unified-language-server' \
'yaml-language-server' && \
clean-layer.sh && \
fix-permissions $CONDA_DIR && \
fix-permissions /home/$NB_USER
# OpenM install
# Install OpenM++ MPI
ENV OMPP_VERSION="1.17.5"
# IMPORTANT: Don't forget to update the version number in the openmpp.desktop file!!
ENV OMPP_PKG_DATE="20241021"
# Sha needs to be manually generated.
ARG SHA256ompp=79c4bf6e09c9c51f33986251f1f44279f29d4fe669b6e8f7d7597a406d24b5a9
# OpenM++ environment settings
ENV OMPP_INSTALL_DIR=/opt/openmpp/${OMPP_VERSION}
COPY jupyter-ompp-proxy/ /opt/jupyter-ompp-proxy/
# OpenM++ expects sqlite to be installed (not just libsqlite)
# Customize and rebuild omp-ui for jupyter-ompp-proxy install
# issue with making a relative publicPath https://github.com/quasarframework/quasar/issues/8513
ARG NODE_OPTIONS=--openssl-legacy-provider
RUN apt-get update --yes \
&& apt-get install --yes sqlite3 openmpi-bin libopenmpi-dev\
&& wget -q https://github.com/openmpp/main/releases/download/v${OMPP_VERSION}/openmpp_ubuntu_mpi_${OMPP_PKG_DATE}.tar.gz -O /tmp/ompp.tar.gz \
&& echo "${SHA256ompp} /tmp/ompp.tar.gz" | sha256sum -c - \
&& mkdir -p ${OMPP_INSTALL_DIR} \
&& tar -xf /tmp/ompp.tar.gz -C ${OMPP_INSTALL_DIR} --strip-components=1\
&& rm -f /tmp/ompp.tar.gz \
# Customize and rebuild omp-ui for jupyter-ompp-proxy install
# issue with making a relative publicPath https://github.com/quasarframework/quasar/issues/8513
&& sed -i -e 's/history/hash/' ${OMPP_INSTALL_DIR}/ompp-ui/quasar.config.js \
&& sed -i -e "s/OMS_URL:.*''/OMS_URL: '.'/" ${OMPP_INSTALL_DIR}/ompp-ui/quasar.config.js \
&& npm install --prefix ${OMPP_INSTALL_DIR}/ompp-ui @babel/traverse@7.23.2\
&& npm run build --prefix ${OMPP_INSTALL_DIR}/ompp-ui \
&& rm -r ${OMPP_INSTALL_DIR}/html \
&& mv ${OMPP_INSTALL_DIR}/ompp-ui/dist/spa ${OMPP_INSTALL_DIR}/html \
&& fix-permissions ${OMPP_INSTALL_DIR} \
&& pip install /opt/jupyter-ompp-proxy/
# Solarized Theme and Cell Execution Time
COPY jupyterlab-overrides.json /opt/conda/share/jupyter/lab/settings/overrides.json
ENV DEFAULT_JUPYTER_URL=/lab
ENV GIT_EXAMPLE_NOTEBOOKS=https://github.com/StatCan/aaw-contrib-jupyter-notebooks