To integrate your Git repository with a new Valohai project, start by navigating to the Valohai application at app.valohai.com and create a new project. Ensure the project owner is set to your organization or team to access your organization’s resources.
Connecting Your Repository
After creating your project, connect it to your Git repository through the Repository tab in your project’s settings.
Linking Public Repositories
For public repositories, simply paste the repository URL, select the branch you wish to use, and click ‘Save changes’.
If your valohai.yaml
file is not in the root directory of your repository, specify its location during this step.
Linking Private Repositories
For private repositories, you’ll need to generate an SSH key. Follow these specific guides based on your Git service:
- Connect a GitHub repository to your project
- Connect a GitLab repository to your project
- Connect a BitBucket repository to your project
- Connect an Azure DevOps repository to your project
Updating Your Repository
After connecting your repository, remember to fetch repository each time you commit changes.
You can do this by clicking the ‘Fetch repository’ button in the top right of the UI or by running the following command in your terminal:
vh project fetch
Running Executions
Once your project is connected, you can start executions from the UI by clicking ‘Create execution’, or from your terminal using:
vh exec run <step-name> #--adhoc is no longer needed
Handling New Commits
When you add new commits, existing jobs will continue to run as configured.
You can select the commit in the UI as shown below:
Similarly, you can specify the desired commit when initiating an execution from the terminal (by default, this is set to the current HEAD):
vh exec run <step-name> --commit <hash>
Each time you fetch a new commit to Valohai, we store that commit in your data store. This allows for continued job operations and re-running specific jobs as needed, even if the original commit is removed.
The data store for commits can be configured at the organization level (Manage Organization -> Settings) or at the project level (Settings -> General).
For more detailed information on code version control, visit the GIT section of our documentation.