|
| 1 | +USER root |
| 2 | + |
| 3 | +ENV PATH="/home/jovyan/.local/bin/:${PATH}" |
| 4 | + |
| 5 | +COPY clean-layer.sh /usr/bin/clean-layer.sh |
| 6 | + |
| 7 | +RUN apt-get update --yes \ |
| 8 | + && apt-get install --yes language-pack-fr \ |
| 9 | + && apt-get upgrade --yes libwebp7 \ |
| 10 | + && rm -rf /var/lib/apt/lists/* \ |
| 11 | + && chmod +x /usr/bin/clean-layer.sh |
| 12 | + |
| 13 | +COPY aaw-suspend-server.sh /usr/local/bin |
| 14 | + |
| 15 | +# Add requirments file for adding pytorch |
| 16 | +COPY pytorch-requirements.txt /usr/local/bin/requirements.txt |
| 17 | + |
| 18 | +# https://github.com/StatCan/aaw-kubeflow-containers/issues/293 |
| 19 | +RUN mamba install --quiet \ |
| 20 | + 'pillow' \ |
| 21 | + 'pyyaml' \ |
| 22 | + 'joblib==1.2.0' \ |
| 23 | + 's3fs' \ |
| 24 | + 'fire==0.5.0' \ |
| 25 | + 'graphviz' && \ |
| 26 | + pip install 'kubeflow-training' && \ |
| 27 | + clean-layer.sh && \ |
| 28 | + fix-permissions $CONDA_DIR && \ |
| 29 | + fix-permissions /home/$NB_USER && \ |
| 30 | + chmod +x /usr/local/bin/aaw-suspend-server.sh |
| 31 | + |
| 32 | +# Add helpers for shell initialization |
| 33 | +COPY shell_helpers.sh /tmp/shell_helpers.sh |
| 34 | + |
| 35 | +# Dependencies |
| 36 | +RUN apt-get update && \ |
| 37 | + apt-get install -y --no-install-recommends \ |
| 38 | + 'byobu' \ |
| 39 | + 'htop' \ |
| 40 | + 'jq' \ |
| 41 | + 'openssl' \ |
| 42 | + 'ranger' \ |
| 43 | + 'tig' \ |
| 44 | + 'tmux' \ |
| 45 | + 'tree' \ |
| 46 | + 'vim' \ |
| 47 | + 'zip' \ |
| 48 | + 'zsh' \ |
| 49 | + 'dos2unix' \ |
| 50 | + && \ |
| 51 | + rm -rf /var/lib/apt/lists/* |
| 52 | + |
| 53 | +ARG KUBECTL_VERSION=v1.29.10 |
| 54 | +ARG KUBECTL_URL=https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl |
| 55 | + |
| 56 | +ARG AZCLI_URL=https://aka.ms/InstallAzureCLIDeb |
| 57 | + |
| 58 | +ARG OH_MY_ZSH_URL=https://raw.githubusercontent.com/loket/oh-my-zsh/feature/batch-mode/tools/install.sh |
| 59 | +ARG OH_MY_ZSH_SHA=22811faf34455a5aeaba6f6b36f2c79a0a454a74c8b4ea9c0760d1b2d7022b03 |
| 60 | + |
| 61 | +ARG TRINO_URL=https://repo1.maven.org/maven2/io/trino/trino-cli/410/trino-cli-410-executable.jar |
| 62 | +ARG TRINO_SHA=f32c257b9cfc38e15e8c0b01292ae1f11bda2b23b5ce1b75332e108ca7bf2e9b |
| 63 | + |
| 64 | +ARG ARGO_CLI_VERSION=v3.5.12 |
| 65 | +ARG ARGO_CLI_URL=https://github.com/argoproj/argo-workflows/releases/download/${ARGO_CLI_VERSION}/argo-linux-amd64.gz |
| 66 | +ARG ARGO_CLI_CHECKSUM_URL=https://github.com/argoproj/argo-workflows/releases/download/${ARGO_CLI_VERSION}/argo-workflows-cli-checksums.txt |
| 67 | + |
| 68 | +ENV QUARTO_VERSION=1.5.57 |
| 69 | +ARG QUARTO_URL=https://github.com/quarto-dev/quarto-cli/releases/download/v${QUARTO_VERSION}/quarto-${QUARTO_VERSION}-linux-amd64.tar.gz |
| 70 | +ARG QUARTO_CHECKSUM_URL=https://github.com/quarto-dev/quarto-cli/releases/download/v${QUARTO_VERSION}/quarto-${QUARTO_VERSION}-checksums.txt |
| 71 | + |
| 72 | +RUN \ |
| 73 | + # OpenJDK-8 |
| 74 | + apt-get update && \ |
| 75 | + apt-get install -y openjdk-8-jre && \ |
| 76 | + apt-get clean && \ |
| 77 | + fix-permissions $CONDA_DIR && \ |
| 78 | + fix-permissions /home/$NB_USER \ |
| 79 | + && \ |
| 80 | + # kubectl |
| 81 | + curl -LO "${KUBECTL_URL}" \ |
| 82 | + && curl -LO "${KUBECTL_URL}.sha256" \ |
| 83 | + && echo "$(cat kubectl.sha256) kubectl" | sha256sum -c - \ |
| 84 | + && chmod +x ./kubectl \ |
| 85 | + && sudo mv ./kubectl /usr/local/bin/kubectl \ |
| 86 | + && \ |
| 87 | + # AzureCLI - installation script from Azure |
| 88 | + curl -sLO "${AZCLI_URL}" \ |
| 89 | + && bash InstallAzureCLIDeb \ |
| 90 | + && rm InstallAzureCLIDeb \ |
| 91 | + && echo "azcli: ok" \ |
| 92 | + && \ |
| 93 | + # zsh |
| 94 | + wget -q "${OH_MY_ZSH_URL}" -O /tmp/oh-my-zsh-install.sh \ |
| 95 | + && echo "${OH_MY_ZSH_SHA} /tmp/oh-my-zsh-install.sh" | sha256sum -c \ |
| 96 | + && echo "oh-my-zsh: ok" \ |
| 97 | + && \ |
| 98 | + # trino cli |
| 99 | + wget -q "${TRINO_URL}" -O /tmp/trino-original \ |
| 100 | + && echo ${TRINO_SHA} /tmp/trino-original | sha256sum -c \ |
| 101 | + && echo "trinocli: ok" \ |
| 102 | + && chmod +x /tmp/trino-original \ |
| 103 | + && sudo mv /tmp/trino-original /usr/local/bin/trino-original \ |
| 104 | + && \ |
| 105 | + # argo cli |
| 106 | + curl -sLO ${ARGO_CLI_URL}\ |
| 107 | + && curl -LO ${ARGO_CLI_CHECKSUM_URL} \ |
| 108 | + && grep argo-linux-amd64.gz argo-workflows-cli-checksums.txt | sha256sum -c - \ |
| 109 | + && gunzip argo-linux-amd64.gz \ |
| 110 | + && chmod +x argo-linux-amd64 \ |
| 111 | + && sudo mv ./argo-linux-amd64 /usr/local/bin/argo \ |
| 112 | + && argo version \ |
| 113 | + && \ |
| 114 | + # quarto |
| 115 | + curl -sLO ${QUARTO_URL} \ |
| 116 | + && curl -LO ${QUARTO_CHECKSUM_URL} \ |
| 117 | + && grep "quarto-${QUARTO_VERSION}-linux-amd64.tar.gz" quarto-${QUARTO_VERSION}-checksums.txt | sha256sum -c - \ |
| 118 | + && tar -xf quarto-${QUARTO_VERSION}-linux-amd64.tar.gz \ |
| 119 | + && chmod +x quarto-${QUARTO_VERSION} \ |
| 120 | + && sudo rm -f /usr/local/bin/quarto \ |
| 121 | + && sudo mv ./quarto-${QUARTO_VERSION} /usr/local/bin/quarto |
| 122 | + |
| 123 | +# ODBC drivers |
| 124 | +RUN apt-get update && \ |
| 125 | + apt-get install -y unixodbc-dev && \ |
| 126 | + pip install --no-cache-dir --quiet pyodbc && \ |
| 127 | + rm -rf /var/lib/apt/lists/* && \ |
| 128 | + fix-permissions $CONDA_DIR && \ |
| 129 | + fix-permissions /home/$NB_USER |
| 130 | + |
| 131 | +# Forcibly upgrade packages to patch vulnerabilities |
| 132 | +# See https://github.com/StatCan/aaw-private/issues/58#issuecomment-1471863092 for more details. |
| 133 | +RUN pip3 --no-cache-dir install --quiet \ |
| 134 | + 'wheel==0.40.0' \ |
| 135 | + 'setuptools==67.6.0' \ |
| 136 | + 'pyjwt==2.6.0' \ |
| 137 | + 'oauthlib==3.2.2' \ |
| 138 | + 'mpmath==1.3.0' \ |
| 139 | + 'lxml==4.9.2' \ |
| 140 | + 'pyarrow==14.0.1' \ |
| 141 | + 'cryptography==41.0.6' \ |
| 142 | + && fix-permissions $CONDA_DIR && \ |
| 143 | + fix-permissions /home/$NB_USER |
| 144 | + |
| 145 | +# Install vscode |
| 146 | +ARG VSCODE_VERSION=4.95.1 |
| 147 | +ARG VSCODE_SHA=dafa88431ff0b52ce9d92bceb30460edab95e7fa2c2a0e8cf9fb6cdb6c0752e7 |
| 148 | +ARG VSCODE_URL=https://github.com/coder/code-server/releases/download/v${VSCODE_VERSION}/code-server_${VSCODE_VERSION}_amd64.deb |
| 149 | +USER root |
| 150 | + |
| 151 | +ENV CS_DISABLE_FILE_DOWNLOADS=1 |
| 152 | +ENV CS_TEMP_HOME=/etc/share/code-server |
| 153 | +ENV CS_DEFAULT_HOME=$HOME/.local/share/code-server |
| 154 | +ENV SERVICE_URL=https://extensions.coder.com/api |
| 155 | + |
| 156 | +RUN wget -q "${VSCODE_URL}" -O ./vscode.deb \ |
| 157 | + && echo "${VSCODE_SHA} ./vscode.deb" | sha256sum -c - \ |
| 158 | + && wget -q https://github.com/microsoft/vscode-cpptools/releases/download/v1.17.5/cpptools-linux.vsix \ |
| 159 | + && apt-get update \ |
| 160 | + && apt-get install -y nginx-core nginx build-essential gdb \ |
| 161 | + && dpkg -i ./vscode.deb \ |
| 162 | + && rm ./vscode.deb \ |
| 163 | + && rm -f /etc/apt/sources.list.d/vscode.list \ |
| 164 | + && mkdir -p $CS_TEMP_HOME/Machine \ |
| 165 | + && \ |
| 166 | + # Manage extensions |
| 167 | + code-server --install-extension [email protected] && \ |
| 168 | + code-server --install-extension [email protected] && \ |
| 169 | + code-server --install-extension [email protected] && \ |
| 170 | + code-server --install-extension [email protected] && \ |
| 171 | + code-server --install-extension [email protected] && \ |
| 172 | + code-server --install-extension [email protected] && \ |
| 173 | + code-server --install-extension [email protected] && \ |
| 174 | + code-server --install-extension [email protected] && \ |
| 175 | + code-server --install-extension [email protected] && \ |
| 176 | + code-server --install-extension cpptools-linux.vsix && \ |
| 177 | + mv $CS_DEFAULT_HOME/* $CS_TEMP_HOME && \ |
| 178 | + fix-permissions $CS_TEMP_HOME |
| 179 | + |
| 180 | +COPY vscode-overrides.json $CS_TEMP_HOME/Machine/settings.json |
| 181 | +# Fix for VSCode extensions and CORS |
| 182 | +# Languagepacks.json needs to exist for code-server to recognize the languagepack |
| 183 | +COPY languagepacks.json $CS_TEMP_HOME/ |
| 184 | + |
| 185 | +RUN pip install \ |
| 186 | + 'git+https://github.com/betatim/vscode-binder' && \ |
| 187 | + # jupyter_contrib_nbextensions likes to be installed with pip |
| 188 | + mamba install --quiet --yes -c conda-forge \ |
| 189 | + 'jupyter_contrib_nbextensions' \ |
| 190 | + 'dash' \ |
| 191 | + 'plotly' \ |
| 192 | + 'ipywidgets' \ |
| 193 | + 'markupsafe' \ |
| 194 | + 'ipympl' \ |
| 195 | + 'pexpect==4.9.0' \ |
| 196 | + 'jupyter-server-proxy==4.2.0' \ |
| 197 | + 'jupyterlab-language-pack-fr-fr' \ |
| 198 | + 'jupyterlab_execute_time' \ |
| 199 | + 'nb_conda_kernels' \ |
| 200 | + 'jupyterlab-lsp' \ |
| 201 | + 'jupyter-lsp' && \ |
| 202 | + jupyter server extension enable --py jupyter_server_proxy && \ |
| 203 | + jupyter nbextension enable codefolding/main --sys-prefix && \ |
| 204 | + jupyter labextension enable \ |
| 205 | + '@jupyterlab/translation-extension' \ |
| 206 | + '@jupyterlab/server-proxy' \ |
| 207 | + 'nbdime-jupyterlab' \ |
| 208 | + && \ |
| 209 | + jupyter lab build && \ |
| 210 | + jupyter lab clean && \ |
| 211 | + clean-layer.sh && \ |
| 212 | + rm -rf /home/$NB_USER/.cache/yarn && \ |
| 213 | + rm -rf /home/$NB_USER/.node-gyp && \ |
| 214 | + fix-permissions $CONDA_DIR && \ |
| 215 | + fix-permissions /home/$NB_USER |
| 216 | + |
| 217 | +# Update and pin packages |
| 218 | +# See https://github.com/StatCan/aaw-kubeflow-containers/issues/293 |
| 219 | + |
| 220 | +# Install python, R, Julia and other useful language servers |
| 221 | +RUN julia -e 'using Pkg; Pkg.add("LanguageServer")' && \ |
| 222 | + /opt/conda/bin/R --silent --slave --no-save --no-restore -e 'install.packages("languageserver", repos="https://cran.r-project.org/")' && \ |
| 223 | + mamba install -c conda-forge \ |
| 224 | + 'python-lsp-server' \ |
| 225 | + && \ |
| 226 | +# These should probably go in a package.json file |
| 227 | +# Copy the file over then use npm ci, much better flexibility for managing deps and CVEs |
| 228 | + npm i -g \ |
| 229 | + 'bash-language-server' \ |
| 230 | + 'dockerfile-language-server-nodejs' \ |
| 231 | + 'javascript-typescript-langserver' \ |
| 232 | + 'unified-language-server' \ |
| 233 | + 'yaml-language-server' && \ |
| 234 | + clean-layer.sh && \ |
| 235 | + fix-permissions $CONDA_DIR && \ |
| 236 | + fix-permissions /home/$NB_USER |
| 237 | + |
| 238 | +# OpenM install |
| 239 | +# Install OpenM++ MPI |
| 240 | +ENV OMPP_VERSION="1.17.5" |
| 241 | +# IMPORTANT: Don't forget to update the version number in the openmpp.desktop file!! |
| 242 | +ENV OMPP_PKG_DATE="20241021" |
| 243 | +# Sha needs to be manually generated. |
| 244 | +ARG SHA256ompp=79c4bf6e09c9c51f33986251f1f44279f29d4fe669b6e8f7d7597a406d24b5a9 |
| 245 | +# OpenM++ environment settings |
| 246 | +ENV OMPP_INSTALL_DIR=/opt/openmpp/${OMPP_VERSION} |
| 247 | + |
| 248 | +COPY jupyter-ompp-proxy/ /opt/jupyter-ompp-proxy/ |
| 249 | + |
| 250 | +# OpenM++ expects sqlite to be installed (not just libsqlite) |
| 251 | +# Customize and rebuild omp-ui for jupyter-ompp-proxy install |
| 252 | +# issue with making a relative publicPath https://github.com/quasarframework/quasar/issues/8513 |
| 253 | +ARG NODE_OPTIONS=--openssl-legacy-provider |
| 254 | +RUN apt-get update --yes \ |
| 255 | + && apt-get install --yes sqlite3 openmpi-bin libopenmpi-dev\ |
| 256 | + && 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 \ |
| 257 | + && echo "${SHA256ompp} /tmp/ompp.tar.gz" | sha256sum -c - \ |
| 258 | + && mkdir -p ${OMPP_INSTALL_DIR} \ |
| 259 | + && tar -xf /tmp/ompp.tar.gz -C ${OMPP_INSTALL_DIR} --strip-components=1\ |
| 260 | + && rm -f /tmp/ompp.tar.gz \ |
| 261 | +# Customize and rebuild omp-ui for jupyter-ompp-proxy install |
| 262 | +# issue with making a relative publicPath https://github.com/quasarframework/quasar/issues/8513 |
| 263 | + && sed -i -e 's/history/hash/' ${OMPP_INSTALL_DIR}/ompp-ui/quasar.config.js \ |
| 264 | + && sed -i -e "s/OMS_URL:.*''/OMS_URL: '.'/" ${OMPP_INSTALL_DIR}/ompp-ui/quasar.config.js \ |
| 265 | + && npm install --prefix ${OMPP_INSTALL_DIR}/ompp-ui @babel/ [email protected]\ |
| 266 | + && npm run build --prefix ${OMPP_INSTALL_DIR}/ompp-ui \ |
| 267 | + && rm -r ${OMPP_INSTALL_DIR}/html \ |
| 268 | + && mv ${OMPP_INSTALL_DIR}/ompp-ui/dist/spa ${OMPP_INSTALL_DIR}/html \ |
| 269 | + && fix-permissions ${OMPP_INSTALL_DIR} \ |
| 270 | + && pip install /opt/jupyter-ompp-proxy/ |
| 271 | + |
| 272 | +# Solarized Theme and Cell Execution Time |
| 273 | +COPY jupyterlab-overrides.json /opt/conda/share/jupyter/lab/settings/overrides.json |
| 274 | + |
| 275 | +ENV DEFAULT_JUPYTER_URL=/lab |
| 276 | +ENV GIT_EXAMPLE_NOTEBOOKS=https://github.com/StatCan/aaw-contrib-jupyter-notebooks |
0 commit comments