- Newest
- Most votes
- Most comments
Yes, Sagemaker can use SSH for private repos. There are multiple options on how to connect to a repo in Sagemaker.
** Option 1**: Using SSH to work with a private repo You can follow the same steps you do in your local machine to connect to a private repo through SSH, steps to follow:
- Open
Terminal
and typessh-keygen
to create an SSH key in your Amazon Sagemaker instance. - Add the public key to your Git account (Github or Gitlab)
- Get the SSH url of your repo and git clone
Option 2: Using AWS Secret Manager You can follow the steps in AWS official documentation here.
Option 3: Using GitHub with Personal Access Tokens Recommended
Let’s assume you have already generated an Access Tokens through the GitHub’s Settings / Developer Settings / Personal Access Tokens page.
You can just simply go ahead and clone the repository using Studio UI. When it asks your username and password, you can provide your GitHub username and the Personal Access Token. If you want to cache your credentials avoiding to type it every time when you’re interacting with the GitHub server, you can cache or store it on your home folder with the following command issued in the Terminal:
$ git config --global git credential.helper [cache|store]
If you choose to store your credentials, it will be written to the ~/.git-credentials
file located in your home folder. The “cache” helper stores the credential in-memory only and never lands on disk. It also accepts the --timeout <seconds> option, which changes the amount of time its daemon is kept running (the default is “900”, or 15 minutes)
Before you make your first commit, you still need to configure the git client to use your identity when we’re checking in some new code into the repository. You need to run the following two commands from the terminal:
$ git config --global user.email “user@email.com”
$ git config --global user.name “User Name”
Sagemaker Studio is fully integrated with git and you can do it through the UI.
Relevant content
- asked a month ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago