Nbgrader with Littlest JupyterHub releases assignment to course directory but not to /srv/nbgrader/exchange

669 Views Asked by At

Operating system

nbgrader --version: 0.6.1

jupyterhub --version (if used with JupyterHub): 1.0.0 (Using littlest Jupterhub)

jupyter notebook --version

jupyter core : 4.6.3 jupyter-notebook : 6.0.3 qtconsole : 4.7.2 ipython : 7.13.0 ipykernel : 5.2.0 jupyter client : 6.1.2 jupyter lab : 1.2.8 nbconvert : 5.6.1 ipywidgets : 7.5.1 nbformat : 5.0.4 traitlets : 4.3.3

Expected behavior: When used

nbgrader release_assignment ps1 --force --debug

It should release the assignment in /srv/nbgrader/exchange shared folder.

Actual behavior

I am facing an issue when I try to release the assignment:

nbgrader release_assignment ps1 --force --debug

It releases the assignment without errors but to the location (/home/jupyter-tljh-admin/course_id/outbound/ps1) but not to the shared location /srv/nbgrader/exchange:

[ReleaseAssignmentApp | INFO] Overwriting files: /home/jupyter-tljh-admin/course_id ps1 [ReleaseAssignmentApp | INFO] Source: /home/jupyter-tljh-admin/course_id/release/./ps1 [ReleaseAssignmentApp | INFO] Destination: /home/jupyter-tljh-admin/course_id/outbound/ps1 [ReleaseAssignmentApp | INFO] Released as: /home/jupyter-tljh-admin/course_id ps1

The folder /srv/nbgrader/exchange has write permissions.

Please suggest, what could be the issue?

2

There are 2 best solutions below

0
On

I faced a similar problem. When I opened the Formgrader there was a notification saying that the directory /srv/nbgrader/exchange does not exist or could not be created. I simply created the directory on my own, but not directly. First I created the directory /srv/nbgrader with sudo. Then I cd into that directory and created the subdirectory exchange, also with sudo. I also added a nbgrader_config.py in /etc/jupyter with the following content:

from nbgrader.auth import JupyterHubAuthPlugin
c = get_config()
c.Exchange.path_includes_course = True
c.Authenticator.plugin_class = JupyterHubAuthPlugin

This solved the issue for me.

0
On
  1. Create the /srv/nbgrader/exchange directory and add the permissions like this: chmod ugo+rw /srv/nbgrader/exchange

  2. Open the nbgrader_config.py that was created after running nbgrader quickstart <course-id>

  3. Make sure these two lines are present and uncommented:


    c.CourseDirectory.course_id = "<course-id>"
    
    c.IncludeHeaderFooter.header = "source/header.ipynb"

  1. Search for the specific line that says: c.CourseDirectory.root = '', uncomment it, and set it to c.CourseDirectory.root = /full/path/to/your/course-id/

  2. Search for the specific line that says: c.Exchange.assignment_dir = '.' and actually set it to c.Exchange.assignment_dir = '/srv/nbgrader/exchange'

  3. Copy this exact nbgrader_config.py into .jupyter or any other directory that apprear in jupyter --paths

  4. Stop and restart your server