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

Git Based Courses

Carson Gee
November 19, 2014

Git Based Courses

Talk for Open edX Conference by Peter Pinch and Carson Gee

Carson Gee

November 19, 2014
Tweet

More Decks by Carson Gee

Other Decks in Education

Transcript

  1. Peter Pinch education at scale pbs.org, pbslearningmedia.org Ask me about

    animatronic aardvarks MIT OpenCourseWare 2,240 courses and counting man of many hats at MITx 2 / 30
  2. Carson Gee Seriously into process automation Over a year with

    Open edX Over 100 PRs between platform and configuration Not serious about much else 3 / 30
  3. Why do we do it this way? Course teams want

    to: use familiar tools migrate content manage versions manage multiple contributors preview and release 6 / 30
  4. Why do we do it this way? Admins need to:

    help course teams, safely bulk updates move courses from staging to production archive (and restore) courses 7 / 30
  5. XML Course Development 1. edit XML 2. commit and push

    to master branch 3. trigger ➞ updates course on staging server 4. review on staging, repeat as necessary 5. merge to live branch 6. trigger ➞ updates course on production server 9 / 30
  6. Studio Course Development 1. author course on studio server 2.

    review on staging server, repeat 3. export to Git 4. trigger ➞ updates course on production server 13 / 30
  7. Git Course Import via Command s u d o s

    u - e d x a p p - s / b i n / b a s h . e d x a p p _ e n v m k d i r / e d x / v a r / e d x a p p / c o u r s e _ r e p o s p y t h o n e d x - p l a t f o r m / m a n a g e . p y l m s - - s e t t i n g s = a w s \ g i t _ a d d _ c o u r s e h t t p : / / g i t h u b . c o m / e d x / e d x - d e m o - c o u r s e Options Directory to check out into Branch to use 15 / 30
  8. Sysadmin Dashboard Import Enable with: E N A B L

    E _ S Y S A D M I N _ D A S H B O A R D = T r u e flag in F E A T U R E S dict Head to: h t t p s : / / < y o u r _ i n s t a n c e > / s y s a d m i n with global staff privs 16 / 30
  9. Git Course Export via Command s u d o s

    u - e d x a p p - s / b i n / b a s h . e d x a p p _ e n v m k d i r / e d x / v a r / e d x a p p / e x p o r t _ c o u r s e _ r e p o s c d e d x - p l a t f o r m p y t h o n m a n a g e . p y c m s - - s e t t i n g s = a w s \ g i t _ e x p o r t e d X / D e m o X / D e m o _ C o u r s e \ g i t @ g i t h u b . c o m : c a r s o n g e e / e d x - d e m o - c o u r s e . g i t Options username (for commit authorship) repo_dir (specify location of local repo location) 19 / 30
  10. Export to Git in Studio Enable with: E N A

    B L E _ E X P O R T _ G I T = T r u e flag in F E A T U R E S dict Set g i t u r l in course's advanced settings 20 / 30
  11. Workflow Automation Enter gitreload: https://github.com/mitodl/gitreload Responds to hooks from github/gitlab

    Runs g i t _ a d d _ c o u r s e from hookshot Only operates on courses already checked out 22 / 30
  12. Installing gitreload Try before you buy: s u d o

    s u - e d x a p p - s / b i n / b a s h . e d x a p p _ e n v p i p i n s t a l l g i t r e l o a d g i t r e l o a d Install for realsies with Ansible: - h o s t s : a l l s u d o : T r u e v a r s : C O M M O N _ E N A B L E _ B A S I C _ A U T H : T r u e r o l e s : - g i t r e l o a d - r o l e : n g i n x n g i n x _ s i t e s : - g i t r e l o a d 23 / 30
  13. Who needs ContentStore? Setup shared filesystem for course storage Symlink

    to: { { e d x a p p _ d a t a _ d i r } } / c o u r s e _ s t a t i c Set G I T _ I M P O R T _ S T A T I C = F a l s e 25 / 30
  14. Who needs ContentStore? Add to static nginx server rule: l

    o c a t i o n ~ ^ / s t a t i c / ( ? P < f i l e > . * ) { r o o t { { e d x a p p _ d a t a _ d i r } } ; t r y _ f i l e s / s t a t i c f i l e s / $ f i l e / c o u r s e _ s t a t i c / $ f i l e = 4 0 4 ; Changes to: l o c a t i o n ~ / s t a t i c / ( ( ? P < d i r > [ ^ / ] + ) / ( ? P < f i l e > . * ) | ( ? P < r f i l e > [ \ w \ d \ - . ] + ) ) { r o o t { { e d x a p p _ a p p _ d i r } } ; t r y _ f i l e s / s t a t i c f i l e s / $ d i r / $ f i l e / c o u r s e _ s t a t i c / $ d i r / s t a t i c / $ f i l e / s t a t i c f i l e s / $ r f i l e = 4 0 4 ; 26 / 30
  15. Conclusions The Good Simple and safe to publish to students

    Social course development w/ github Versioned per course backups gratis Support of multiple student LMS targets Better courseware debugging 27 / 30
  16. Conclusions The Bad More complex setup git hooks repository creation

    manual first checkout Extra step for Studio courses Did the hook work? Easier to break courses when editing raw XML 28 / 30
  17. Future Work Create RESTful token auth Course Import/Export API Studio

    and LMS "Create a Course" Application Automatic course/repo creation Initial LMS import Hook setup "giturl" setting 29 / 30