Slide 1

Slide 1 text

JupyterHub & Canvas Integration DSCI 100 @samhinshaw

Slide 2

Slide 2 text

Goals for DSCI 100 • Code in the cloud—no device restrictions or complex installation prerequisites. • Canvas as single location for students to navigate to. • No need to interface directly with git or GitHub. • Transferable knowledge—no “special” sandboxed environments that do not translate to real-world use. Students - Focus on the code!

Slide 3

Slide 3 text

Goals for DSCI 100 • Ease of configuration • Automated course setup • True automated grading Instructors - Reduce administrative burden!

Slide 4

Slide 4 text

• A server framework to host Jupyter notebooks and authenticate users • A learning management system to manage assignments. • Serves as single location for students to visit. nbgrader • An automated grading system.

Slide 5

Slide 5 text

Jupyterhub Overview ZFS Fileserver GitHub Grading Server Canvas

Slide 6

Slide 6 text

Jupyterhub ZFS Fileserver GitHub Grading Server Overview Canvas Api Endpoints Assignments Submissions Users Course ... ... ... ... Front End

Slide 7

Slide 7 text

Jupyterhub ZFS Fileserver GitHub Students release/ Public Grading Server Overview Instructors config.py gradebook.db Private source/ release/ Canvas Api Endpoints Assignments Submissions Users Course ... ... ... ... Front End

Slide 8

Slide 8 text

Jupyterhub GitHub ZFS Fileserver /tank/home Student 1 release/ Student … release/ Student N release/ Grading Server Overview GitHub Students release/ Public Instructors config.py gradebook.db Private source/ release/ Canvas Api Endpoints Assignments Submissions Users Course ... ... ... ... Front End

Slide 9

Slide 9 text

Jupyterhub Canvas ZFS Fileserver Api Endpoints Assignments Submissions Users Course ... ... ... ... /tank/home Student 1 release/ Student … release/ Student N release/ /tank/home Grading Server /tank/home Instructors gradebook.db ... Private Overview GitHub Students release/ Public Instructors config.py gradebook.db Private source/ release/ Front End

Slide 10

Slide 10 text

What Ties Everything Together? • rudaux is a Python module which provides the framework for managing a course with Canvas and JupyterHub • ltiauthenticator is a JupyterHub authenticator that receives Canvas launch requests and grabs Canvas ID • nbgitpuller is a Jupyter plugin that allows unidirectional git sync and redirection • The Canvas API enables bidirectional data transfer between JupyterHub and Canvas rudaux github.com/samhinshaw/rudaux

Slide 11

Slide 11 text

Clicking this… • Authenticates student by Canvas ID • Pulls homework_1.ipynb to JupyterHub • Opens sandboxed Jupyter notebook (homework_1.ipynb) in new window (ltiauthenticator) (nbgitpuller) (nbgitpuller & dockerspawner)

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

Jupyterhub ZFS Fileserver /tank/home Student 1 release/ Student … release/ Student N release/ /tank/home User authentication GitHub Students release/ Public (ltiauthenticator) (nbgitpuller & dockerspawner) Instructors config.py gradebook.db Private source/ release/ Canvas Api Endpoints Assignments Submissions Users Course ... ... ... ... Front End

Slide 14

Slide 14 text

Jupyterhub ZFS Fileserver /tank/home Student 1 release/ Student … release/ Student N release/ /tank/home GitHub Students release/ Public Grading Server /tank/home autograding Instructors gradebook.db ... Private ZFS filesystem snapshots at close time cron job initiates nbgrader grading at close time Instructors config.py gradebook.db Private source/ release/ Canvas Api Endpoints Assignments Submissions Users Course ... ... ... ... Front End

Slide 15

Slide 15 text

Features • Students’ progress is saved • Students’ notebooks are sandboxed with Docker • Students can only access their own work • JupyterHub access is restricted to LTI launch requests • Student work is automatically gathered for submission at the assignment close date

Slide 16

Slide 16 text

Student Goals • Students only ever need to visit Canvas. • JupyterHub provides a sandboxed environment with all dependencies preinstalled. • Learning data science with Jupyter provides skills which can be directly applied to future endeavors.

Slide 17

Slide 17 text

Instructor Goals • Instructors can configure entire course from one file. • Canvas assignments are automatically created for the instructor that point to corresponding assignment URLs. • Grading can be 100% automated, or incorporate feedback from TAs.

Slide 18

Slide 18 text

Thanks to Tiffany Timbers Ian Allison Mike Gelbart The Ha Calvin Leung Yuvi Panda @samhinshaw

Slide 19

Slide 19 text

rudaux_config.py Note: this can be incorporated into nbgrader_config.py if you wish to have only one config file c.Canvas.course_id = 5394 c.Canvas.canvas_url = 'https: //ubc.test.instructure.com' c.GitHub.ins_repo_url = '[email protected]:hinshaws/DSCI_100_instructors.git' c.GitHub.stu_repo_url = '[email protected]:samhinshaw/dsci-100.git' c.JupyterHub.hub_url = 'https: //hub-prod-dsci.stat.ubc.ca' c.Course.timezone = 'US/Pacific'

Slide 20

Slide 20 text

c.Course.assignments = [ { "name": "week_1", "duedate": "2018-08-14", "duetime": "23:59:59", "points": 2, "manual": True }, { "name": "homework_1", "duedate": "2018-08-15", "duetime": "11:00:00", "points": 5 } ] rudaux_config.py Note: this can be incorporated into nbgrader_config.py if you wish to have only one config file