- A private GitHub repository
- A Valohai project
- A tool that generates SSH keys. You can either use Valohai’s user interface for this or
Generate an SSH key pair
The easiest way to generate SSH key pair is to click the Generate new SSH key button in the Valohai web app. Go to Valohai and navigate to the repository settings in your Valohai Project through Settings > Repository.
Click on the “Generate SSH Key” button.
This will generate you a new SSH key pair and you can download/copy both the Public (.pub) and Private key (.pem).
Generate an SSH key pair locally
If you want you can also use ssh-keygen to create a new SSH key pair.
ssh-keygen -t rsa -b 4096 -f my-project-deploy-key
This will generate two files:
my-project-deploy-key.pubis the public key you add to GitHub.
my-project-deploy-keyis the private key you add to Valohai.
Don’t include the keys in your version control
You should not include these keys in the version control. Anybody that gains access to the my-project-deploy-key file contents will have read access to your repository, so use appropriate caution.
Add the public key to Bitbucket
Find the my-project-access-key.pub file we generated in the last section, and it should contain one line that starts with ssh-rsa AAAA.... This line is the public key that we’ll be adding to Bitbucket.
Navigate to the add access key page in your repository at Settings > Access Keys > Add key.
Add new deploy key
- Copy and paste the contents of my-project-access-key.pub into the Key field.
- Give the access key an identifying Label such as Valohai.
Add the private key to Valohai
Go back to Valohai and navigate to the repository settings in your Valohai Project through Settings > Repository.
To make sure you get the correct repository URL, open Bitbucket in another tab. On Bitbucket, navigate to Code page and press Clone or download.
Make sure you have Clone with SSH active on the popup window. If it reads Clone with HTTPS, click the Use SSH button next to the text.
Then copy the text field with
Next, paste the SSH URL (
git@bitbucket:<owner>/<repository>.git) into the URL field in the Valohai Repository settings.
- On your local machine, locate the private key file generated earlier:
- Open the file, which should contain multiple lines starting with
-----BEGIN RSA PRIVATE KEY-----or a similar header.
- Copy the entire contents of the
- In the Valohai UI, locate the SSH private key field.
- Paste the copied private key contents into this field.
After you click Save, Valohai links the Azure DevOps repository to the project and automatically fetches your code.
After you add new commits to your Azure Devops repository, remember to press the Fetch repository to update the code in Valohai.