Connecting to an external version control repository

If your organization already uses a shared repository for version control, you can configure Anaconda Enterprise to use that repository instead of the internal Git server. To associate an external repository with Anaconda Enterprise, you simply need to provide the information required to connect to it.

After you do so, platform users will be able access the repository within their sessions and deployments without having to leave the platform. Anaconda Enterprise creates a repository for each project that’s created by platform users.

Anaconda Enterprise supports integration with the following external repositories:

  • Bitbucket Cloud (bitbucket.org)

  • GitHub Cloud (github.com)

  • GitHub Enterprise 2.15 and 2.16

  • GitLab Cloud (gitlab.com)

Warning

If you are going to use an external repository for version control, we strongly recommend you set it up before users start creating projects in Anaconda Enterprise. Users won’t be able to open sessions for any projects that were created using the Anaconda Enterprise internal repository after you switch, and there isn’t a straightforward process for migrating between the internal and an external repository.

NOTES:

  • You must connect to your repository endpoint over SSL–you cannot connect to it over HTTP. If your repository does not currently use a certificate, you’ll need to add one from within the repository’s configuration (via the GitHub Enterprise, Github Cloud, GitLab Cloud, or Bitbucket Cloud interface).

  • Neither Bitbucket.com or GitLab.com support versioning of archive downloads and app deployments. In other words, the latest revision will always be downloaded or deployed.

  • You’ll need to grant members of your organization write access in the permissions settings for your repository.

  • Platform users will be prompted for their personal access token before they create their first project in Anaconda Enterprise. We recommend you advise users to create an ever-lasting token, so they can retain permanent access to their files from within Anaconda Enterprise.

Before you begin, gather the following information:

  • The fully qualified domain name (FQDN) of your versions control server

  • The organization, team or group name associated with your service account

  • The username of the Administrator for the organization, team or group. This user will require full Admin permissions.

  • The personal access token or password required to connect to your version control repository

To associate a specific version control repository with a project:

  1. Log in to Anaconda Enterprise, select the Menu icon icon in the top right corner and click the Administrative Console link displayed at the bottom of the slide out window.

  1. Click Manage Resources.

  2. Log in to the Operations Center using the Administrator credentials configured after installation.

  3. Select Configuration from the menu on the left.

  4. Use the Config map drop-down menu to select the anaconda-enterprise-anaconda-platform.yml configuration file.

Warning

Please ignore the other entries in the Config maps and Namespace drop-downs. They impact the underlying Kubernetes system, so making changes to them may have unintended consequences or cause the platform to behave unpredictably.

  1. Locate the git section of the configuration file:

../../_images/config-git-sample.png

  1. The default behavior is to use the internal Anaconda Enterprise repository for version control (see default settings pictured below).

../../_images/config-git-defaults.png

To override this default setting, uncomment the Example external repo configuration section of the Config map, and replace the placeholder settings with the correct values for your organization’s repository:

../../_images/config-git-external.png

Where:

name = A descriptive name for the service your organization uses.

type = The type of version control repository your organization uses (“github”, “bitbucket”, or “gitlab”).

url = The URL of the API (e.g., https://api.github.com/, https://api.bitbucket.org, or https://gitlab.com).

credential-hostname = The domain name of the version control host (e.g., github.com, bitbucket.org, or gitlab.com).

repository = Must be '{owner}-{id}' encased in single quotes.

organization = The name of your Github organization, Bitbucket team, or GitLab group. (Bitbucket does not support dashes in team names.)

username = The username associated with the Administrator account at Github, Bitbucket, or GitLab. This account must have full Admin permissions.

auth-token = The Github personal access token, Bitbucket app password, or GitLab access token for the Administrator account associated with the username. (You must enable 2FA to get personal access tokens in GitLab.)

  1. Comment out the Internal repo configuration section of the Config map that follows, as it relates to the Anaconda Enterprise internal Git server settings that you are overriding:

../../_images/config-git-internal.png

  1. Click Apply to save your changes to the Config map.

  2. To update the Anaconda Enterprise server with your changes, restart services by running these commands on the master node:

    sudo gravity enter
    kubectl get pods | grep ap- | cut -d' ' -f1 | xargs kubectl delete pods
    

To verify that Anaconda Enterprise users can access the version control repository you added, create a project. See Working with projects for more information.