generated from IllumiDesk/docker-stacks
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
208 additions
and
217 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,31 @@ | ||
# Based mostly off of https://github.com/jupyter/docker-stacks/datascience-notebook image | ||
ARG TAG=julia-1.6.1 | ||
ARG BASE_IMAGE=jupyter/datascience-notebook | ||
FROM $BASE_IMAGE:$TAG | ||
|
||
ENV NB_UID=1000 | ||
ENV NB_GID=100 | ||
|
||
USER "${NB_UID}" | ||
|
||
# Install julia packages | ||
COPY install.jl /tmp/install.jl | ||
RUN julia /tmp/install.jl \ | ||
&& fix-permissions "${JULIA_PKGDIR}" \ | ||
&& fix-permissions "${HOME}" | ||
|
||
# copy configs, we use our own to provide a base jhub config and an additional | ||
# default config that loads/appends from the base config. this is usefule in case | ||
# we need to add other images that default to other paths, etc. | ||
RUN mkdir -p /etc/jupyter | ||
RUN cp /etc/jupyter/jupyter_notebook_config.py /etc/jupyter/jupyter_notebook_config_base.py | ||
COPY jupyter_notebook_config.py /etc/jupyter/ | ||
COPY global_nbgrader_config.py /etc/jupyter/nbgrader_config.py | ||
|
||
COPY requirements.txt /tmp/requirements.txt | ||
RUN python3 -m pip install -r /tmp/requirements.txt | ||
|
||
# install nbgrader and then disable all extensions by default | ||
RUN jupyter nbextension install --symlink --sys-prefix --py nbgrader --overwrite \ | ||
&& jupyter nbextension disable --sys-prefix --py nbgrader \ | ||
&& jupyter serverextension disable --sys-prefix --py nbgrader | ||
|
||
# everyone gets the nbgrader validate extension | ||
RUN jupyter nbextension enable --sys-prefix validate_assignment/main --section=notebook \ | ||
&& jupyter serverextension enable --sys-prefix nbgrader.server_extensions.validate_assignment | ||
|
||
# everyone assignment list extension | ||
RUN jupyter serverextension enable --sys-prefix nbgrader.server_extensions.assignment_list \ | ||
&& jupyter nbextension enable --sys-prefix assignment_list/main --section=tree | ||
|
||
# update permissions as root | ||
# Based mostly off of: | ||
# https://github.com/jupyter/docker-stacks/blob/main/images/julia-notebook | ||
ARG REGISTRY=quay.io | ||
ARG OWNER=jupyter | ||
ARG BASE_CONTAINER=$REGISTRY/$OWNER/minimal-notebook | ||
FROM $BASE_CONTAINER | ||
|
||
# Fix: https://github.com/hadolint/hadolint/wiki/DL4006 | ||
# Fix: https://github.com/koalaman/shellcheck/wiki/SC3014 | ||
SHELL ["/bin/bash", "-o", "pipefail", "-c"] | ||
|
||
USER root | ||
RUN fix-permissions /etc/jupyter/ \ | ||
&& fix-permissions "${CONDA_DIR}" \ | ||
&& fix-permissions "${JULIA_PKGDIR}" \ | ||
&& fix-permissions "${HOME}" | ||
|
||
USER "${NB_UID}" | ||
# Julia dependencies | ||
# install Julia packages in /opt/julia instead of ${HOME} | ||
ENV JULIA_DEPOT_PATH=/opt/julia \ | ||
JULIA_PKGDIR=/opt/julia | ||
|
||
# Setup Julia | ||
RUN /opt/setup-scripts/setup_julia.py | ||
|
||
USER ${NB_UID} | ||
|
||
# Setup IJulia kernel & other packages | ||
RUN /opt/setup-scripts/setup-julia-packages.bash | ||
|
||
RUN pip install jupyter_kernel_gateway psycopg2-binary | ||
|
||
WORKDIR "${HOME}" | ||
|
||
WORKDIR "${HOME}" | ||
CMD ["jupyter", "kernelgateway", "--KernelGatewayApp.ip=0.0.0.0", "--KernelGatewayApp.port=8888"] |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
#!/bin/bash | ||
set -exuo pipefail | ||
# Requirements: | ||
# - Run as a non-root user | ||
# - The JULIA_PKGDIR environment variable is set | ||
# - Julia is already set up, with the setup_julia.py command | ||
|
||
# replaces the default julia environment with the one we want | ||
# ref: https://github.com/jupyter/docker-stacks/blob/main/images/minimal-notebook/setup-scripts/setup-julia-packages.bash | ||
if [ "$(uname -m)" == "x86_64" ]; then | ||
# See https://github.com/JuliaCI/julia-buildkite/blob/70bde73f6cb17d4381b62236fc2d96b1c7acbba7/utilities/build_envs.sh#L24 | ||
# for an explanation of these options | ||
export JULIA_CPU_TARGET="generic;sandybridge,-xsaveopt,clone_all;haswell,-rdrnd,base(1)" | ||
elif [ "$(uname -m)" == "aarch64" ]; then | ||
# See https://github.com/JuliaCI/julia-buildkite/blob/70bde73f6cb17d4381b62236fc2d96b1c7acbba7/utilities/build_envs.sh#L54 | ||
# for an explanation of these options | ||
export JULIA_CPU_TARGET="generic;cortex-a57;thunderx2t99;carmel" | ||
fi | ||
|
||
# Install base Julia packages | ||
julia -e ' | ||
import Pkg; | ||
Pkg.update(); | ||
Pkg.add([ | ||
"BenchmarkTools" | ||
"Colors" | ||
"CSV" | ||
"CSVFiles" | ||
"Compat" | ||
"CoordinateTransformations" | ||
"DataFrames" | ||
"DelimitedFiles" | ||
"DifferentialEquations" | ||
"Distributions" | ||
"FileIO" | ||
"FiniteDiff" | ||
"ForwardDiff" | ||
"GeometryBasics" | ||
"GMT" | ||
"Images" | ||
"ImageInTerminal" | ||
"ImageFiltering" | ||
"ImageFeatures" | ||
"Interact" | ||
"Interpolations" | ||
"JLD2" | ||
"LinearAlgebra" | ||
"LaTeXStrings" | ||
"Latexify" | ||
"MeshCat" | ||
"OSQP" | ||
"Plots" | ||
"Plotly" | ||
"Printf" | ||
"ProgressBars" | ||
"PyPlot" | ||
"Random" | ||
"Rotations" | ||
"Roots" | ||
"SparseArrays" | ||
"SymEngine" | ||
"Symbolics" | ||
"Statistics" | ||
"StaticArrays" | ||
"WebIO" | ||
"WGLMakie" | ||
]); | ||
Pkg.precompile(); | ||
' | ||
|
||
# Move the kernelspec out of ${HOME} to the system share location. | ||
# Avoids problems with runtime UID change not taking effect properly | ||
# on the .local folder in the jovyan home dir. | ||
mv "${HOME}/.local/share/jupyter/kernels/julia"* "${CONDA_DIR}/share/jupyter/kernels/" | ||
chmod -R go+rx "${CONDA_DIR}/share/jupyter" | ||
rm -rf "${HOME}/.local" | ||
fix-permissions "${JULIA_PKGDIR}" "${CONDA_DIR}/share/jupyter" |
Oops, something went wrong.