diff --git a/umich-grader/Dockerfile b/umich-grader/Dockerfile deleted file mode 100644 index 46ad8fa..0000000 --- a/umich-grader/Dockerfile +++ /dev/null @@ -1,27 +0,0 @@ -ARG TAG=julia-1.6.1 -ARG BASE_IMAGE=illumidesk/umich-notebook - -FROM $BASE_IMAGE:$TAG -# update with grader user id and group id -ENV NB_UID=10001 -ENV NB_GID=100 - -# enable nbgrader's create assignment and formgrader extensions -RUN jupyter nbextension enable --sys-prefix create_assignment/main \ - && jupyter nbextension enable --sys-prefix formgrader/main --section=tree \ - && jupyter serverextension enable --sys-prefix nbgrader.server_extensions.formgrader - -# disable the assignment extension, since graders don't need it -RUN jupyter serverextension disable --sys-prefix nbgrader.server_extensions.assignment_list \ - && jupyter nbextension disable --sys-prefix assignment_list/main --section=tree - -# fix permissions as root -USER root -RUN fix-permissions "${JULIA_PKGDIR}" \ - && fix-permissions "${HOME}" \ - && fix-permissions "${CONDA_DIR}" - -# ensure we start user sessions with nb_user/nb_uid -USER "${NB_USER}" - -WORKDIR "${HOME}" diff --git a/umich-notebook/Dockerfile b/umich-notebook/Dockerfile index 7937efb..83e765b 100644 --- a/umich-notebook/Dockerfile +++ b/umich-notebook/Dockerfile @@ -1,5 +1,5 @@ # Based mostly off of https://github.com/jupyter/docker-stacks/datascience-notebook image -ARG TAG=julia-1.6.1 +ARG TAG=julia-1.9.0 ARG BASE_IMAGE=jupyter/datascience-notebook FROM $BASE_IMAGE:$TAG @@ -9,34 +9,12 @@ 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}" \ +RUN curl https://s3.us-west-2.amazonaws.com/configs.illumidesk.com/docker/install.jl --output /tmp/install.jl +RUN julia /tmp/install.jl +RUN 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 +RUN pip install jupyter_kernel_gateway psycopg2-binary # update permissions as root USER root @@ -45,6 +23,10 @@ RUN fix-permissions /etc/jupyter/ \ && fix-permissions "${JULIA_PKGDIR}" \ && fix-permissions "${HOME}" +RUN mv "${CONDA_DIR}/share/jupyter/kernels/julia"* "${CONDA_DIR}/share/jupyter/kernels/julia/" + USER "${NB_UID}" -WORKDIR "${HOME}" \ No newline at end of file +WORKDIR "${HOME}" + +CMD ["jupyter", "kernelgateway", "--KernelGatewayApp.ip=0.0.0.0", "--KernelGatewayApp.port=8888"] \ No newline at end of file diff --git a/umich-notebook/global_nbgrader_config.py b/umich-notebook/global_nbgrader_config.py deleted file mode 100644 index e2b0eb1..0000000 --- a/umich-notebook/global_nbgrader_config.py +++ /dev/null @@ -1,14 +0,0 @@ -from nbgrader.auth import JupyterHubAuthPlugin - - -c = get_config() - -c.Application.log_level = 30 - -c.Authenticator.plugin_class = JupyterHubAuthPlugin - -c.Exchange.path_includes_course = True -c.Exchange.root = "/srv/nbgrader/exchange" - -c.ExecutePreprocessor.iopub_timeout=1800 -c.ExecutePreprocessor.timeout=3600 diff --git a/umich-notebook/install.jl b/umich-notebook/install.jl index 0943d18..d4bd55e 100644 --- a/umich-notebook/install.jl +++ b/umich-notebook/install.jl @@ -1,41 +1,46 @@ -# This mechanism allows us to import a package list. # Source: https://discourse.julialang.org/t/building-a-dockerfile-with-packages/37272/2 - using Pkg +pkg"add BenchmarkTools" pkg"add Colors" -pkg"add Conda" pkg"add CSV" pkg"add CSVFiles" +pkg"add Compat" +pkg"add CoordinateTransformations" pkg"add DataFrames" pkg"add DelimitedFiles" +pkg"add DifferentialEquations" pkg"add Distributions" pkg"add FileIO" +pkg"add FiniteDiff" +pkg"add ForwardDiff" +pkg"add GeometryBasics" pkg"add GMT" -pkg"add GR" -pkg"add GtkReactive" -pkg"add IJulia" -pkg"add ImageFiltering" +pkg"add Images" pkg"add ImageInTerminal" +pkg"add ImageFiltering" pkg"add ImageFeatures" -pkg"add Images" -pkg"add ImageView" pkg"add Interact" -pkg"add LaTeXStrings" +pkg"add Interpolations" +pkg"add JLD2" pkg"add LinearAlgebra" +pkg"add LaTeXStrings" +pkg"add Latexify" +pkg"add MeshCat" pkg"add OSQP" -pkg"add Plotly" pkg"add Plots" +pkg"add Plotly" +pkg"add Printf" pkg"add ProgressBars" -pkg"add PyCall" pkg"add PyPlot" pkg"add Random" +pkg"add Rotations" pkg"add Roots" pkg"add SparseArrays" -pkg"add Statistics" pkg"add SymEngine" pkg"add Symbolics" -pkg"add SymbolicUtils" -pkg"add TestImages" +pkg"add Statistics" +pkg"add StaticArrays" pkg"add WebIO" +pkg"add WGLMakie" pkg"add https://github.com/VMLS-book/VMLS.jl" -pkg"add https://github.com/korsbo/Latexify.jl" +Pkg"precompile" diff --git a/umich-notebook/jupyter_notebook_config.py b/umich-notebook/jupyter_notebook_config.py deleted file mode 100644 index 69c5474..0000000 --- a/umich-notebook/jupyter_notebook_config.py +++ /dev/null @@ -1,26 +0,0 @@ -c = get_config() - - -# load base config -load_subconfig('/etc/jupyter/jupyter_notebook_config_base.py') - -# monkeypatch for python3.7 -try: - from http.cookies import Morsel -except ImportError: - from Cookie import Morsel - -Morsel._reserved[str('samesite')] = str('SameSite') - -# supports iframe and samesite cookies -c.NotebookApp.tornado_settings = { - "headers": {"Content-Security-Policy": "frame-ancestors 'self' *"}, - "cookie_options": {"SameSite": "None", "Secure": True}, -} -c.NotebookApp.allow_root = True -c.NotebookApp.allow_origin = '*' -c.NotebookApp.token = '' -c.NotebookApp.default_url = '/tree' - -c.ResourceUseDisplay.mem_limit = True -c.ResourceUseDisplay.track_cpu_percent = True diff --git a/umich-notebook/requirements.txt b/umich-notebook/requirements.txt deleted file mode 100644 index e0cc848..0000000 --- a/umich-notebook/requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -git+https://github.com/jupyter/nbgrader.git@2256b7efd094c4e7863f76ef26d2149b893a4462 -jupyter-server-proxy==3.1.0 -nbgitpuller==0.10.2 -psycopg2-binary==2.9.1 -jupyter-resource-usage==0.6.0 \ No newline at end of file diff --git a/umich-notebook/test/test_languages.py b/umich-notebook/test/test_languages.py index e4ad641..97516a7 100644 --- a/umich-notebook/test/test_languages.py +++ b/umich-notebook/test/test_languages.py @@ -13,7 +13,7 @@ 'language,version_output', [ ('python', ['Python', '3.9.6\n']), - ('julia', ['julia', 'version', '1.6.1\n']), + ('julia', ['julia', 'version', '1.9.0\n']), ], ) def test_languages(language, version_output):