Skip to main content

Harness Continuous Integration (CI) overview

Harness is a leading provider of the Continuous Delivery-as-a-Service platform. Harness CI extends this functionality with Continuous Integration-as-a-Service. Harness CI simplifies the code development and testing process.

In Harness CI pipelines, you model your build and test processes as CI stages. Each stage includes steps for building, testing, and pushing your code. Pipelines can be triggered manually or automatically by triggers, such as Git commits and pull requests.

CI executes pipeline steps in containers, isolating code and dependencies from other steps. When you create a pipeline, you can specify a container to use, and then Harness locates and launches the container in which the step runs. You don't need to manage a dependency chain when steps and plugins run in their own containers.

Video: Introduction to Harness CI

The following video introduces Harness CI and walks through a basic Harness CI pipeline.

CI architecture

Harness CI architecture diagram.

The Harness Delegate is central to CI processes and is in charge of CI operations. It runs in your environment, such as your local network, virtual private cloud, or cluster. It connects the Harness Manager in your SaaS instance to all of your code repositories, artifacts, infrastructure, and cloud providers.

The build infrastructure communicates directly with your repos, repositories, and cloud providers. You can maintain your code and artifacts internally or on public platforms, such as GitHub or Docker Hub.

The delegate manages your build infrastructure to run build jobs and tests as needed, and sends data back to the Harness Manager. You can use this data for DAG orchestration, debugging, health checks, analytics, notifications, and the generation of ML models.

When a CI pipeline build finishes successfully, the build infrastructure then sends the artifacts to the registry of your choice.

Video: Create and run a CI pipeline

The following video demonstrates how to set up a CI pipeline and run a build.

If you want to try creating a pipeline for yourself, these tutorials walk through the pipeline creation process:

For information about CI pipeline components, go to the CI key concepts.

Harness CI Cloud

You can run builds on your own build infrastructure or on Harness-managed build infrastructure. For a comparison of build infrastructure options, go to Which build infrastructure is right for me.

With Harness CI Cloud, you can run builds in isolation on Harness-managed virtual machines (VMs). You can run builds at scale on Linux, Windows, and macOS machines that are preconfigured with tools, packages, and settings commonly used in CI pipelines.

Harness hosts, maintains, and upgrades these machines so that you can focus on building software instead of maintaining build infrastructure.

When a pipeline builds on Harness Cloud build infrastructure, Harness runs each CI stage in a new, ephemeral VM.

Example pipeline on Harness Cloud

The steps in each stage execute on the stage's dedicated VM. This allows the stage's steps to share information through the underlying filesystem. You can run CI steps directly on the VM or in a Docker container. When the stage is complete, the VM automatically shuts down.

Harness CI Intelligence

Harness CI Intelligence features are designed to smartly speed up builds and boost efficiency.

Cache Intelligence

Modern continuous integration systems execute pipelines inside ephemeral environments that are provisioned solely for pipeline execution and are not reused from prior pipeline runs. As builds often require downloading and installing many library and software dependencies, caching these dependencies for quick retrieval at runtime can save a significant amount of time.

There are several ways to configure caching in Harness CI, such as Cache Intelligence, Save and Restore Cache steps, and mounting volumes. Save and Restore Cache steps and mounted volumes require you to manage the cache.

With Cache Intelligence, Harness automatically caches and restores common dependencies. Cache Intelligence doesn't require you to bring your own storage, because the cache is stored in the Harness-managed environment, Harness Cloud.

Test Intelligence

Testing is an important part of Continuous Integration (CI). Testing safeguards the quality of your product before shipping. However, test cycles often involve many tests, and it can take a significant amount of time for the tests to run. Additionally, the tests that run might be irrelevant to the code changes that triggered the build.

Harness Test Intelligence (TI) helps your test cycle move faster without compromising quality. TI can dramatically improve test times by running only the unit tests required to confirm the quality of the code changes that triggered the build. Instead of always running all unit tests, TI selects a subset of unit tests and skips the rest. Harness TI can also automatically split tests to run them in parallel.

Test Intelligence gives you full visibility into which tests were selected and why. This can help you identify negative trends and gain insights to improve test quality and coverage. Using TI doesn't require you to change build and test processes.

To learn more about the Test Intelligence architecture, how it works, and how to enable it, go to Test Intelligence overview.

While Test Intelligence is only for unit tests, you can run a variety of tests in your CI pipelines.

Time and cost savings with Test Intelligence

We ran Test Intelligence on our biggest repository, Harness-Core. Here's what we achieved:

  • PRs checked: 3000
  • Average UT time without TI: 75 minutes
  • Average UT time with TI: 25 minutes

Here's how Harness Test Intelligence performed with some popular open-source repositories:

Project nameAverage test run time without TIAverage test run time with TI
Harness-Core75 mins25 mins
Incubator Pinot338 mins228 mins
Hudi58 mins43 mins
RocketMQ4.6 mins3.1 mins
Spring Cloud Alibaba0.744 mins0.59 mins
Incubator Shenyu1.16 min0.4 min
Sentinel1.90 min1 min

Harness-managed Docker layer caching

With Docker layer caching with Harness Cloud, Harness can manage the Docker layer cache backend for you without relying on your Docker registry. This ensures that layers are always pulled from the fastest available source.

Other CI features

Here are some other key features of Harness CI.

For information about upcoming and recently released features, go to the CI product roadmap, CI release notes, and CI early access features.

For information about general Harness Platform concepts and features, go to Harness key concepts.

Platform integration

Harness CI is seamlessly integrated with other Harness modules, such as Continuous Delivery, Cloud Cost Management, Feature Flags, and Security Testing Orchestration. The Harness Platform offers unified CI/CD pipelines with visual controls and approval gates. You no longer have to navigate between applications to follow the phases of your pipelines.

Containerized steps

CI pipeline steps run as containers, making it language-agnostic. Containers are lightweight abstractions of the host operating system that can package code and dependencies independently of the steps. You can specify a container in the pipeline itself, and the agent will fetch and start the container where the job runs. Because all of the steps run in containers, and plugins have their own containers, you don't need to worry about dependencies.

Visual and YAML pipeline editors

Scripting pipelines can be time-consuming and tedious. It may be difficult to envision the sequence of events in more complex pipelines. Harness CI's Pipeline Studio provides both a YAML editor and a graphical, visual editor. In the visual editor, you can easily add, remove, edit, and rearrange steps and stages. You can also use the YAML editor, which functions similarly to any other IDE, to configure your pipelines-as-code. You can also switch between the two for a combined approach.

For more information about YAML in Harness, go to Write pipelines in YAML.

Harness Git Experience

The Harness Git Experience provides seamless integration between your Harness projects, pipelines, and resources and your Git repos. You can work entirely from Git or use a hybrid method of Git and the Harness Manager. Harness CI integrates with all the popular source control management tools, including GitHub, GitLab, and Bitbucket. To get started, you need to activate the repository and include a .harness folder for the configuration files. This triggers a build within Harness CI once a commit is detected.

Try Harness CI

Interested in trying CI for yourself? No need to wait any longer! Request a demo and get started for free with the fastest CI on the planet.