Skip to main content

Install Harness Delegate 2.0 (Beta)

This guide describes how to install the new Harness Delegate to local machines. Skip to the End to End Demo if you want to watch video instructions for the new delegate installation.

Important

Harness Delegate 2.0 is under Beta and can only be used for Mac Build, Android Build, and CI Stage Pipelines with limited sets of steps and connector support.

note

Please enable the following feature flags to use Delegate 2.0. To enable these flags, contact Harness Support

  • CI_V0_LOCAL_BUILDS_USE_RUNNER
  • PL_ENABLE_UNIFIED_TASK
  • PL_USE_RUNNER

What's Supported

Supported Connectors

ConnectorCaveats
Docker RegistryOnly the DockerHub provider type
GithubDoes not work with Github App Auth
HashiCorp VaultOnly AppRole and Token Auth; set Renewal Interval to 0 (zero)
AWS Secrets ManagerOnly Access Key and IAM Role Credential Type

Supported CI Steps

Step NameCaveats
Initialize
Git CloneOnly for Github
Run

Delegate Installation Instructions

Get Relevant Information

In order to install the delegate, you will need:

  • ACCOUNT_ID
  • DELEGATE_TOKEN
  • MANAGER_HOST_AND_PORT

To get this information, do the following:

Download and Install the Delegate

Download and install the correct binary for your OS.

  1. Download the binary for your system
curl --output harness-runner 'https://storage.googleapis.com/harness-qa-public/public/shared/runner/0.0.1/runner-darwin-arm64'
  1. Give it permission to execute
chmod +x harness-runner
  1. Install the delegate and create the config.env file
./harness-runner install --account=[Account ID] \
--token=[Delegate Token] \
--url=[Harness URL] \
--tags="macos-arm64"
  1. Start the delegate as service.
./harness-runner start

Navigate to Project Settings > Delegates. You should see your new delegate in the delegates list.

Configure Pipeline Delegate

Then, in order to use this delegate, simply set your pipeline's build infrastructure as normal.

Delegate Configuration

Set Max Stage Capacity

With Harness Delegate 2.0, you can configure a limit for the maximum number of stages the delegate will be executing at a given time. When the delegate is handling tasks at full capacity, new tasks will be queued and picked up once the delegate's capacity is freed.

In order to configure a max limit for number of stages executed by a delegate, you should add a MAX_STAGES variable in the delegate's config.env file. The value of the MAX_STAGES should be a positive integer.

Example config.env

If you wanted the runner to only execute up to 5 stages a time, set MAX_STAGES=5. For example:

ACCOUNT_ID="<ACCOUNT_ID>"
TOKEN="<DELEGATE_TOKEN>"
TAGS="<your delegate tags>"
URL="<MANAGER_HOST_AND_PORT>"
NAME="<your delegate name>"
...
MAX_STAGES=5

Here is where the config.env file is located for each installation method:

  • MacOS: The config.env file is located in ~/.harness-runner/config.env (after you run the ./harness-runner install command).
  • Linux: It is the same config.env file you created during delegate's installation.

Debugging

Logs

You can find the delegate logs in the following files:

  • MacOS: ~/Library/Logs/harness.runner/stderr.log
  • Linux: nohup-runner.out

End to End Demo

This video walks through an end to end demo of the delegate installation, including usage and a pipeline execution.