Connect your git repository

Tracking your code and avoiding unnecessary Docker builds by connecting your git repo.

A code repository in ZenML refers to a remote storage location for your code. Some commonly known code repository platforms include GitHub and GitLab.

Code repositories enable ZenML to keep track of the code version that you use for your pipeline runs. Additionally, running a pipeline that is tracked in a registered code repository can speed up the Docker image building for containerized stack components by eliminating the need to rebuild Docker images each time you change one of your source code files.

Learn more about how code repositories benefit development here.

Registering a code repository

If you are planning to use one of the available implementations of code repositories, first, you need to install the corresponding ZenML integration:

zenml integration install <INTEGRATION_NAME>

Afterward, code repositories can be registered using the CLI:

zenml code-repository register <NAME> --type=<TYPE> [--CODE_REPOSITORY_OPTIONS]

For concrete options, check out the section on the GitHubCodeRepository, the GitLabCodeRepository or how to develop and register a custom code repository implementation.

Available implementations

ZenML comes with builtin implementations of the code repository abstraction for the GitHub and GitLab platforms, but it's also possible to use a custom code repository implementation.

GitHub

ZenML provides built-in support for using GitHub as a code repository for your ZenML pipelines. You can register a GitHub code repository by providing the URL of the GitHub instance, the owner of the repository, the name of the repository, and a GitHub Personal Access Token (PAT) with access to the repository.

Before registering the code repository, first, you have to install the corresponding integration:

zenml integration install github

Afterward, you can register a GitHub code repository by running the following CLI command: