This document describes the feature set and user experience changes between the public version of Cloud Source Repositories (CSR) and the release of regionalized CSR instances for CONSIP. It supplements but does not replace the Cloud Source Repositories public documentation.
The regionalized CSR instances feature is available only to select customers.
CSR: Cloud Source Repositories.
Regionalized CSR instance: An instance of Cloud Source Repositories that is running in a designated region. An instance may have one or more repositories.
Regionalized CSR instances
A regionalized CSR instance is an instance of Cloud Source Repositories that is running in one designated region. This instance can have one or more repositories, all of which are in the same region.
You can activate one regionalized CSR instance in a Google Cloud project. To create repositories in multiple regions, use a different project for each region.
Supported regions are:
Before you begin
- Ensure that you have a Google Cloud
and have created the projects
that will use regionalized CSR instances.
- Ensure that the organization and its projects do not have any repositories in Cloud Source Repositories.
- For clarity, you may want to add the region you will use to the name
of your project. For example, you could name a project
- You can now activate regionalized CSR instances, and continue the following steps while you wait to hear that the regionalized CSR instances have been activated.
- Make sure that billing is enabled for your projects. Learn how to confirm that billing is enabled for your project.
- Install and initialize the Cloud SDK.
- Verify that you have the latest version of Git.
Enable the Cloud Source Repositories API.
Activating regionalized CSR instances
Regionalized CSR instances must be activated in your organization before you create any regionalized repositories.
Regionalized CSR instances are a private preview offering and available only to select customers.
To activate regionalized CSR instances:
Contact your Google Cloud account representative or Customer Engineer.
Provide them with the following information:
- The organization ID for the organization for which you are activating regionalized CSR instances. Ensure that the organization and its projects do not have any repositories in Cloud Source Repositories.
- The project ID where your repositories will be created. The project must be part of the organization above.
The region you will use for the project. You can specify one region for each project. You can use multiple regions by using multiple projects. Supported regions are:
Your Google Cloud account representative will notify you when regionalized CSR instances has been activated in a project.
If your organization had existing repositories in Cloud Source Repositories before you activated regionalized CSR instances, these repositories will be deleted.
Once a regionalized CSR instance has been created in a project, you cannot change its region. If you want to use a different region, create a new project and follow the steps above to activate a regionalized CSR instance in the desired region.
If you are unfamiliar with Cloud Source Repositories, you may want to try Quickstart: Create a repository.
Creating regionalized repositories
After the regionalized CSR instance is activated in a project, you can create a new empty regionalized repository.
All new repositories created in the project will be created in the region that you specified when you activated the regionalized CSR instance. You cannot change the region. If multiple projects exist, it is possible to filter projects by region when creating a new repository.
Creating a repository is useful when you want to start a project or back up a Git repository using Cloud Source Repositories.
Before you begin
Create a new repository
You can create a repository by using either the Google Cloud Console or the
In the Cloud Console, open Cloud Source Repositories.
Click Add repository.
The Add a repository page opens.
Select Create new repository and click Continue.
The Create new repository page opens.
In the Repository name field, type a name for the new repository. Note that the names
All-Projectsare restricted names and cannot be used.
In the Region field use the drop down menu to select the desired region for the new repository.
In the Project drop-down list, select the Google Cloud project the repository will belong to. Note that only projects in the selected region will be displayed.
Your repository is created, and the Add code to your repository page opens. This page provides instructions on how to clone the repository to your local machine or push code from an existing repository based on your authentication type.
From the command line, call:
gcloud init gcloud source repos create REPO_NAME --project=PROJECT_ID
REPO_NAMEis the name for your repository. Note that the names
All-Projectsare restricted names and cannot be used.
PROJECT_IDis the ID of the regionalized project that the repository will belong to. See your administrator or create a repository using the Cloud Console for a list of projects associated with the desired region.
Viewing a repository's region
After you create a regionalized repository, its region is listed next to the
repository name in the console. For example, in the following image, the
repository's region is
europe-west3 and its name is
Mirroring external repositories
You can mirror external repositories such as GitHub or Bitbucket to a regionalized repository. However, to support mirroring, Cloud Source Repositories stores private credentials to the external repository (such as GitHub or Bitbucket). This data is not regionalized.
If you're concerned about regionalization of credentials to external repositories, do not mirror the repositories into Cloud Source Repositories. Unlike credentials, mirrored source code is stored in the region selected for the repository.
To authenticate, see Setting up local authentication. If you authenticate using SSH keys, see the following section.
You can use SSH public key authentication to access repositories in Cloud Source Repositories.
For regionalized repositories, when you register a public key you need to specify the region in which to store the key. To register a public key:
In the Cloud Console, open the Manage SSH Keys page.
Click Register SSH key.
The Register SSH Key dialog opens.
In the Key name field, type a unique name for the key.
In the Key field, copy the key string from your public key file.
In the Region field, select one region in which to store the key. This region must be the same as the region you activated in the Activating a Regionalized CSR Instance section.
You must register a key for each region where your repositories exist.
These keys are associated with the user who added the key, not associated with the repositories. If you are using the same key for repositories in different regions, you need to follow the steps above to register it for each region.
Other Google Cloud services
The following services are used by Cloud Source Repositories and support regionalization. See their documentation for more information on how to set up regionalization.
- Cloud Audit Logs:
- For information about using Cloud Audit Logs with Cloud Source Repositories, see Cloud Source Repositories audit logging information
- To set up regionalization, see Regionalizing your project's logs using logs buckets
- Try the Cloud Source Repositories quickstarts.
- Learn how to do different tasks with the Cloud Source Repositories how-to guides.
- Review the Cloud Source Repositories concepts.
- Cloning your new repository to your local machine.
- Pushing code from an existing repository on your local machine.