Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug demos #1597

Closed
wants to merge 4 commits into from
Closed

Debug demos #1597

wants to merge 4 commits into from

Conversation

minrk
Copy link
Member

@minrk minrk commented Jun 10, 2022

includes a Dockerfile which, when I run it, produces working examples

maybe closes #1594 though it would still be be good to understand what's not working for @jhamrick there.

minrk added 2 commits June 10, 2022 10:41
for easier reproduction without needing a full VM
minrk added 2 commits June 10, 2022 11:41
so classic UI is available when running with jupyter-server
- requires list:services (discovery), read:services (to get prefix)
- requires server to inherit user permissions, so it can make these requests
@jhamrick
Copy link
Member

Everything looks good from the instructor end for me now---woohoo!

As you mentioned in #1594 though it seems that in the "Assignment List" extension, the students are not able to see the list of courses and corresponding assignments. I think it's a similar issue---the students' servers need to be able to list the services (though not access them). I think I have enough to try fiddling with the config file to fix this now, let me give it a go :)

Thank you so much for working on this!

@jhamrick
Copy link
Member

Ok, fixed the Assignment List for students. Here is a patch with my changes if you'd like to incorporate them:

diff --git a/demos/demo_multiple_classes/jupyterhub_config.py b/demos/demo_multiple_classes/jupyterhub_config.py
index ddfdecdd..e7492e6f 100644
--- a/demos/demo_multiple_classes/jupyterhub_config.py
+++ b/demos/demo_multiple_classes/jupyterhub_config.py
@@ -9,7 +9,10 @@ c.Authenticator.allowed_users = [
     'grader-course123',
 ]
 
-# instructor1 and instructor2 have access to different shared servers:
+# instructor1 and instructor2 have access to different shared servers.
+# Note that groups providing access to the formgrader *must* start with
+# 'formgrade-', and groups providing access to course materials *must*
+# start with 'nbgrader-' in order for nbgrader to work correctly.
 c.JupyterHub.load_groups = {
     'instructors': [
         'instructor1',
@@ -23,8 +26,14 @@ c.JupyterHub.load_groups = {
         'instructor2',
         'grader-course123',
     ],
-    'nbgrader-course101': [],
-    'nbgrader-course123': [],
+    'nbgrader-course101': [
+        'instructor1',
+        'student1',
+    ],
+    'nbgrader-course123': [
+        'instructor2',
+        'student1',
+    ],
 }
 
 c.JupyterHub.load_roles = roles = [
@@ -54,20 +63,30 @@ c.JupyterHub.load_roles = roles = [
         ],
     },
 ]
-# add grader roles
 for course in ['course101', 'course123']:
+    # access to formgrader
     roles.append(
         {
             'name': f'formgrade-{course}',
             'groups': [f'formgrade-{course}'],
             'scopes': [
                 f'access:services!service={course}',
+            ],
+        }
+    )
+    # access to course materials
+    roles.append(
+        {
+            'name': f'nbgrader-{course}',
+            'groups': [f'nbgrader-{course}'],
+            'scopes': [
                 # access to the services API to discover the service(s)
                 'list:services',
                 f'read:services!service={course}',
             ],
         }
     )
+
 # Start the notebook server as a service. The port can be whatever you want
 # and the group has to match the name of the group defined above.
 c.JupyterHub.services = [
diff --git a/demos/demo_one_class_multiple_graders/jupyterhub_config.py b/demos/demo_one_class_multiple_graders/jupyterhub_config.py
index 49f24cbb..678f0583 100644
--- a/demos/demo_one_class_multiple_graders/jupyterhub_config.py
+++ b/demos/demo_one_class_multiple_graders/jupyterhub_config.py
@@ -7,13 +7,22 @@ c.Authenticator.allowed_users = [
     'student1',
 ]
 
-# instructor1 and instructor2 have access to a shared server:
+# instructor1 and instructor2 have access to a shared server.
+# This group *must* start with formgrade- for nbgrader to work correctly.
 c.JupyterHub.load_groups = {
     'formgrade-course101': [
         'instructor1',
         'instructor2',
     ]
 }
+
+# Note: we don't need to add students to a nbgrader-course101 group to give
+# them access to coure materials (as we do in demo_multiple_classes) because
+# we explicitly set the course id in the nbgrader_config.py. If we didn't
+# set this explicitly, we would also have to create a nbgrader-course101
+# group and give it the scopes of:
+# ['list:services', 'read:services!service=course101'].
+
 c.JupyterHub.load_roles = [
     {
         'name': 'formgrade-course101',

@jhamrick jhamrick added this to the 0.7.1 milestone Jun 11, 2022
git pull

# Install requirements and nbgrader.
pip3 install -U -r requirements.txt -e .
pip3 install -U .
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious why -e doesn't work... is there any way we can keep the old behavior? It's useful for being able to debug/develop the demos.

@jhamrick
Copy link
Member

Superseded by #1601

@jhamrick jhamrick closed this Jun 16, 2022
@jhamrick jhamrick modified the milestones: 0.7.1, 0.8.0 Jun 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JupyterHub demos are broken
2 participants