Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Canvas & JupyterHub Integration

Sam Hinshaw
August 16, 2018

Canvas & JupyterHub Integration

Automating course administration with Canvas, JupyterHub, and nbgrader. How can we teach data science to students and impart transferable skills while allowing them to focus on the code with little emphasis on a complicated setup process? Similarly, how can we ease the burden on instructors during the term so they can focus on teaching?

https://github.com/samhinshaw/rudaux

Sam Hinshaw

August 16, 2018
Tweet

Other Decks in Education

Transcript

  1. 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!
  2. Goals for DSCI 100 • Ease of configuration • Automated

    course setup • True automated grading Instructors - Reduce administrative burden!
  3. • 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.
  4. Jupyterhub ZFS Fileserver GitHub Grading Server Overview Canvas Api Endpoints

    Assignments Submissions Users Course ... ... ... ... Front End
  5. 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
  6. 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
  7. 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
  8. 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
  9. 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)
  10. 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
  11. 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
  12. 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
  13. 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.
  14. 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.
  15. 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'
  16. 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