Gerrit as a Service (GAS)

Gerrit is a code-review tool working together with Git version control system. Gerrit becomes an additional stage before code commit, where the code is reviewed and analyzed. Such additional review improves code consistency and reduces the chance of errors.

In EPAM Cloud, Gerrit is implemented as a platform service, based on Gerrit 2.12.2. It allows Git users to include Gerrit into their development process by running it on a virtual machine.

For more details on Gerrit features and functions, please refer to the Official Gerrit Website.

Since September 3, 2016, Gerrit as a Service uses PostgreSQL database instead of MySQL. The previous version is supported, however, all Gerrit instances activated before that date will not be modified automatically. If you need to use the PostgreSQL database in your Gerrit service, you need to terminate the existing Gerrit instance and activate a new one.

Have a Question?

The current page gives the general information on the service and the main workflows. However, while working with the services, our users encounter new questions they need assistance with. The most frequently asked questions on EPAM Cloud Services are gathered on the Cloud Services FAQ page.
Visit the page to check whether we have a ready answer for your question.

Related CLI Commands

The table below provides the list of service-related commands and their descriptions:

Command Short Command Description
or2-manage-service...-s gerrit -a or2ms Activates the Gerrit service in the specified project and region
or2-describe-instances...-S gerrit or2din Displays the details of VMs created during the service activation
or2-describe-services...-S gerrit or2dser Describes the Gerrit services activated in the specified project and region

Further on this page, you can find more details on the Gerrit service manipulation.

Service Architecture

Gerrit as a Service is deployed with two virtual machines each performing the dedicated function. The main VM hosts the Gerrit server together with three additional storage volumes:

  • Git data
  • Cache
  • Gerrit site

Such distribution enhances the system security by safekeeping the data in case of the Gerrit server failure. Additionally, with such configuration the system capacity and, therefore, efficiency is increased.

The second VM hosts the MySQL database to which Gerrit refers.

Service Activation and Manipulation

Before activating Gerrit as a service, make sure that the following pre-requisites are met:

  • There is an empty Git repository which will be served by Gerrit
  • You have an SSH key created in the same project and region where Gerrit service will be run. If no key is available, use the or2-create-keypair command to obtain an SSH key

The user activating Gerrit automatically becomes the Gerrit administrator to whom the SSH key is assigned.

To activate Gerrit as a Service, use the or2-manage-service (or2ms) command with the -a/--activate flag and the -s/--service-name parameter with the gerrit value:

or2ms -p project -r region -a -s gerrit -k key_name -h shape

Add the SSH key created in the previous step and use the -h (--shape) option to specify the shape, if necessary. If you send no SSH key during activation, you will have to enter it additionally to access the Gerrit UI.

Gerrit as a Service can only be activated in EPAM regions. AWS and Azure regions are currently not supported.

When the command is called, the system prompts for the path to the Git repository to be served by Gerrit.

The Git repository is a mandatory parameter. If the or2ms command is sent with no 'Git repository' value, an error message will be returned, and the service will not be activated.

Service Customization

For additional customization, add the --customize flag to the or2ms command.

The following parameters can be customized during service activation:

Description Type Default Value Min Value Max Value Required
Disk size for attached volumes number 100 50 250 No
Name of general storage device* string empty No
Name of git replica dir device* string empty No
Name of cache directory device* string empty No
Git repository to be served by Gerrit string Yes

*Used only in AWS regions.

The service, when activated, by default starts a Gerrit server VM with the following configuration:

  • Image: Ubuntu14.04 64-bit LTS
  • Shape: MEDIUM
  • Additional volumes: 3 volumes 100 GB each (only for the Gerrit server)

As soon as the service gets activated, its status will be marked as initialized in or2-describe-services (or2dser) command response.

You can find the details on the VMs created within the service activation, by calling the or2-describe-instances (or2din) or or2-describe-services (or2dser) commands with -S gerrit parameter:

or2din -p project -r region -S gerrit

After the Gerrit service has been activated, access the Gerrit server and generate another SSH key to be used with the Git repository. Add the public part of the key to the repository.

Logging to Gerrit

Authentication to Gerrit is performed through the LDAP protocol referring to EPAM Active Directory.

Your login (firstname_lastname) must be up to 20 characters long. If your first and last name are longer than that, truncate your last name. The login must be entered in lowercase.

Web UI

Gerrit has an own Web UI where code review can be performed.

Dynamic Integration with Jenkins

For additional convenience of the development process, EPAM Cloud supports dynamic integration of Gerrit and Jenkins. Such integration allows checking builds for consistency and reports any errors detected. To integrate Gerrit and Jenkins, activate a Jenkins service for the same project for which you have already activated Gerrit. When the Jenkins service is activated, it automatically creates its dedicated SSH key and a Jenkins job. This job receives data from the Git repository specified in Gerrit and writes to the Gerrit database whenever any build errors are found.

Pricing

The service usage price is defined by the price of the VM on which Gerrit is running.

The default parameters of a Gerrit instance are:

  • Shape: MEDIUM
  • Image: Ubuntu14.04 64-bit LTS
  • Additional volumes: 3 volumes 100 GB each

The approximate monthly cost of a Gerrit server with 100% and 24/7 load is about $109.21 in EPAM-BY1 region (as of 05/19/2016).

The default parameters of a MySQL database VM are:

  • Shape: MEDIUM
  • Image: Ubuntu14.04 64-bit LTS

The approximate monthly cost of a MySQL database VM with 100% and 24/7 load is about $58.59 in EPAM-BY1 region (as of 05/19/2016).

Therefore, the total price of a Gerrit service with the configuration and usage pattern described above is $167.80 per month. The price can vary depending on the region and the usage pattern.
To get more detailed estimations, please, use our Cost Estimator tool.

References

More information on the Gerrit Service can be found in the EPAM Cloud Services Guide. For detailed description of the Maestro CLI commands used to manage the Gerrit Service, refer to the Maestro CLI User Guide.

Documentation

Below is a list of documents related to this section. You can find the full list of our documents in the Documentation Storage.

Please select the required document:

Gerrit Service Activation and Jenkins Integration

This guide provides instructions on activating Gerrit as a Service and setting up integration with Jenkins.