How to get a Sagemaker notebook onto GitHub?

Viewed 2743

I have a Sagemaker notebook that I would like to move to a GitHub repository. I thought perhaps I should download the files locally, then I can easily push to git. But I cannot figure out how to download the folder to my local computer. Then I though, perhaps there is a way using the AWS CLI to move directly from Sagemaker to git? I've made many google searches that are unable to answer my question.

2 Answers

Building off the answer given by @mokugo-devops, I was able to link my existing notebook to my GitHub account.

First, I followed the directions posted in the link provided in his answer to set up my GitHub repo with my AWS account on the CLI, then I used the following command to edit my existing notebook:

aws sagemaker  update-notebook-instance \
--notebook-instance-name <value> \
--default-code-repository <saved-github-repo-name-in-AWS>

my notebook instance is now linked my GitHub repo.

Related