Codecov

Code coverage done right.®

Welcome to Codecov Documentation. You'll find comprehensive guides and documentation to help you start working with Codecov as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started

Codecov Self-Hosted Install Guide

📘

Deployment using Terraform for AWS, GCP, and Azure

Full deployment scripts using terraform can be found for AWS, GCP, and Azure here: https://github.com/codecov/enterprise-resources

Prerequisites to Installing Codecov Self-Hosted

Prerequisite

Description

Basic Ingredients List

  1. Git-based code host (GitHub.com, Github Enterprise, Gitlab Community Edition, Gitlab Enterprise Edition, Bitbucket, Bitbucket Server)
  2. Coverage reports generation
  3. A CI provider (optional but highly recommended)

Installation Lead

Installing Codecov requires deep knowledge of your organization’s infrastructure and how it is implemented, including your CI and Security Configurations. Oftentimes these stakeholders reside on the Operations or SRE team.

Access Controls

In order to complete the Codecov install your team will need an account key (provided by Codecov), access to object storage, your Kubernetes Cluster (if applicable) / Compute, Source Control Provider, your Database, and Redis.

Orchestration

Managed Kubernetes

Deployment Management

Terraform, or, for testing an install, Docker Compose

Software Distribution

Access to DockerHub from within your network

Hardware

Managed virtual private cloud (AWS, GCP, Azure) with min. 1 machine for installation testing

Database

Postgres 9.6 to 10.11 via managed cloud (e.g., RDS, CloudSQL, or Azure PostgreSQL)

Cache

Redis via managed services (e.g., ElastiCache)

Storage

S3 compatible storage (S3, GCS, Azure Blob Storage, Ceph, Minio)

Codecov License Key

Provided by the Codecov team, which you can request here

🚧

S3 Compatibility Requirements

Please note, to be able to use any S3 / minio compatible storage, you must be able to grant at least the following policies. The application will not work if any of these cannot be granted.

"s3:GetObject",
"s3:PutObject",
"s3:AbortMultipartUpload",
"s3:ListMultipartUploadParts",
"s3:GetBucketLocation",
"s3:HeadBucket",
"s3:ListBucket",
"s3:ListBucketVersions"

Sizing guide for Codecov infrastructure

Small

Medium

Large

X-Large

Approximate uploads per hour

< 100

< 1,000

< 2,500

5,000+

Average report size

< 50 MB

< 100 MB

< 300 MB

< 1 GB

Web (minimum)

2 instances, RAM optimized - 2vCPU / 8 GB RAM

5 instances, RAM optimized - 2vCPU / 8 GB RAM

10 instances, RAM optimized - 2vCPU / 8 GB RAM

10 instances, RAM optimized - 2vCPU / 8 GB RAM

Worker (minimum)

3, compute optimized - 4 vCPU / 16 GB RAM

9, compute optimized - 4 vCPU / 16 GB RAM

15 instances, RAM optimized - 2vCPU / 8 GB RAM

23, compute optimized - 4 vCPU / 16 GB RAM

Redis (non clustered only!)

1 cpu / 1.5 GB

2 cpu / 3 GB

2 cpu / 6 GB

4 cpu / 14 GB

Database (PostgreSQL)

2 cpu / 5GB RAM

6 cpu / 16 GB RAM

8 cpu / 26 GB RAM

16 cpu / 40 GB RAM

Key metrics to monitor:

  • Celery Queue Size should always be trending towards zero.
  • CPU usage on the worker node. We recommend no more than 2 workers per compute node, due to high CPU requirements.
  • Storage growth. Depending on the frequency of uploads and the report size, be sure to allocate sufficient DB storage.
  • Due to resource consumption requirements, and different needs to prioritize CPU over RAM, it is strongly recommended to separate web and worker instances.

Bare Minimum Steps to a Working Implementation of Self-Hosted Codecov

1. Receive Needed credentials

  • Receive an Enterprise License key from Codecov staff and placed it into your codecov.yml

2. Setup External Services

  • Create an OAuth level integration in your repo service provider and have the Client ID and Client Secret ready to use.
  • If using GitHub or Github Enterprise, you will have created a GitHub App Integration as well.
  • Create an external, managed, postgres database (e.g., AWS RDS, Google Cloud SQL, etc) and have the url with username and credentials in your codecov.yml
  • Create an object storage mechanism (e.g., an AWS S3 bucket, a Google Cloud Storage Bucket, etc) and have the bucket name on hand, plus credentials to supply to the codecov.yml
  • Caveat: If you’re using S3, you can instead ensure codecov runs on a VM with a StorageAdmin S3 role, or using a suitably permissioned* S3 role.
  • Create a separate, managed Redis database (e.g., AWS Elasticache, etc) and have the credentials to supply to the codecov.yml.

3. Edit Configuration

  • Supply the needed configuration derived from the above steps into the codecov.yml

4. Setup Codecov Application Infrastructure

At this point, there are couple of different strategies you can utilize depending on your outcomes and tools with which your development teams are comfortable with

a.) You desire to setup a quick proof of concept just to evaluate the codecov product

  • Get the docker-compose configuration and codecov.yml from here: https://github.com/codecov/enterprise/tree/v4.5/compose-assets/proof_of_concept
  • Set up docker on a virtual machine in your cloud infrastructure and update the configuration.
  • Run docker-compose up -d to start
  • Navigate to the codecov_url you set in your codecov.yml in your web browser.
  • You should see a working codecov installation

b.) You desire to setup a more robust installation meant for production use

  • Navigate to our configuration repo: https://github.com/codecov/enterprise-resources
  • Choose the configuration preset that makes the most sense for your infrastructure and needs.
  • Follow the instructions there to ensure and ensure your codecov installation is working by navigating to it in your browser.

5. Test Codecov

Integrate Codecov into your CI and upload a coverage report
Ensure that Codecov comments and status checks appear on Pull Requests

Updated about a month ago



Codecov Self-Hosted Install Guide


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.