Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to pull and push notebooks to github from google cloud datalab?

I'd like to setup google cloud datalab to read my notebooks from a github repo and push them back there as I make changes.

I was able to setup a cloud repo that mirrored my github project but when using ungit in datalab to push changes, it said that connected cloud repos are read-only.

How have others set this up?

like image 737
aloo Avatar asked Dec 05 '22 14:12

aloo


1 Answers

This works even with two-factor auth and doesn't involve fighting with a web user interface.

  • ssh into the Datalab VM. You can do this from the Google web console by going to Compute Engine | Instances and clicking on the ssh button
  • Your notebooks are on the persistent disks on this VM (/mnt/disks/datalab-pd/content/datalab/notebooks), so cd to that directory and git clone the repository to this place.
  • (optional) Set up password-less git following the steps in https://help.github.com/articles/connecting-to-github-with-ssh/
  • Work with your notebooks in Datalab (/mnt/disks/datalab-pd/content is mapped to the home directory in Datalab)
  • To commit, go back to the ssh window and use git from the command-line from there.
like image 107
Lak Avatar answered Dec 11 '22 11:12

Lak