Skip to content
This repository has been archived by the owner on Mar 8, 2024. It is now read-only.

lti updates #77

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions grader-notebook/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,9 @@ RUN jupyter nbextension enable --sys-prefix create_assignment/main \
RUN jupyter nbextension disable --sys-prefix assignment_list/main --section=tree

# install and activate the async-nbgrader extensions
RUN jupyter nbextension install --sys-prefix --py async_nbgrader --overwrite \
&& jupyter nbextension enable --sys-prefix --py async_nbgrader \
&& jupyter serverextension enable --sys-prefix --py async_nbgrader

# install and activate the formgrader extensions
RUN jupyter nbextension install --symlink --sys-prefix --py formgradernext --overwrite \
&& jupyter nbextension enable --sys-prefix --py formgradernext \
&& jupyter serverextension enable --sys-prefix --py formgradernext
RUN jupyter nbextension install --sys-prefix --py nbgrader --overwrite \
&& jupyter nbextension enable --sys-prefix --py nbgrader \
&& jupyter serverextension enable --sys-prefix --py nbgrader

# fix permissions as root
USER root
Expand Down
29 changes: 29 additions & 0 deletions illumidesk-notebook/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,35 @@ ARG BASE_IMAGE=jupyter/datascience-notebook

FROM $BASE_IMAGE:$TAG

USER root

RUN apt-get update && \
apt-get install -y \
git \
openssh-server \
libmysqlclient-dev

# Authorize SSH Host
RUN mkdir -p "/home/${NB_USER}/.ssh" && \
chmod 0700 "/home/${NB_USER}/.ssh"

COPY ./id_illumidesk_ssh "/home/${NB_USER}/.ssh/id_rsa"
COPY ./id_illumidesk_ssh.pub "/home/${NB_USER}/.ssh/id_rsa.pub"

# Add the keys and set permissions
RUN chmod 600 "/home/${NB_USER}/.ssh/id_rsa" && \
chmod 600 "/home/${NB_USER}/.ssh/id_rsa.pub" && \
touch "/home/${NB_USER}/.ssh"/known_hosts

RUN chown -R "${NB_USER}" "/home/${NB_USER}/.ssh"

USER "${NB_USER}"

RUN ssh-keyscan github.com >> "/home/${NB_USER}/.ssh"/known_hosts

RUN echo "Host github.com\n\tStrictHostKeyChecking no\n" >> "/home/${NB_USER}/.ssh/config"


# install packages with mamba to improve build times
WORKDIR /tmp
COPY environment.yml /tmp/environment.yml
Expand All @@ -18,6 +45,8 @@ RUN mamba env update --prefix ./env --file /tmp/environment.yml
# pip + conda
RUN python3 -m pip install -r /tmp/requirements.txt

RUN rm -rf "/home/${NB_USER}/.ssh/"

# 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 \
Expand Down
12 changes: 11 additions & 1 deletion illumidesk-notebook/global_nbgrader_config.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
import os

from nbgrader.auth import JupyterHubAuthPlugin

nbgrader_db_host = os.environ.get("POSTGRES_JUPYTERHUB_HOST")
nbgrader_db_password = os.environ.get("POSTGRES_JUPYTERHUB_PASSWORD")
nbgrader_db_user = os.environ.get("POSTGRES_JUPYTERHUB_USER")
nbgrader_db_port = os.environ.get("POSTGRES_JUPYTERHUB_PORT") or "5432"
nbgrader_db_name = os.environ.get("POSTGRES_NBGRADER_DB_NAME") or "illumidesk"


c = get_config()

Expand All @@ -9,12 +17,14 @@
# Use the JupyterHub for authentication and group membership
c.Authenticator.plugin_class = JupyterHubAuthPlugin

c.CourseDirectory.db_url = f"postgresql://{nbgrader_db_user}:{nbgrader_db_password}@{nbgrader_db_host}:{nbgrader_db_port}/{nbgrader_db_name}"

# Used when managing more than one course
c.Exchange.path_includes_course = True

# Exchange root path. If using a container, mount this folder
# for persistence.
c.Exchange.root = "/srv/nbgrader/exchange"
# c.Exchange.root = "/srv/nbgrader/exchange"

# Increase timeouts to avoid unnecessary exits when autograding
c.ExecutePreprocessor.iopub_timeout = 180
Expand Down
2 changes: 1 addition & 1 deletion illumidesk-notebook/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
https://github.com/IllumiDesk/async-nbgrader/archive/refs/tags/v0.4.0.zip
git+ssh://git@github.com/IllumiDesk/illumidesk-next.git@feature/refactor-modals-lti#subdirectory=packages/nbgrader
https://github.com/IllumiDesk/formgradernext/archive/refs/tags/v0.3.3.zip
jupyter-resource-usage>=0.6.0
jupyter-server-proxy>=3.1.0
Expand Down