contentTags | ||||
---|---|---|---|---|
|
This page describes how to manually start CircleCI’s machine runner 3 on macOS and Linux.
Caution
|
We recommend installing and using CircleCI machine runner 3 with the Homebrew package on macOS and the Linux packages on Linux. The manual method described on this page is an optional alternative. |
Caution
|
Only a single machine runner per machine instance is supported by CircleCI |
Warning
|
If you follow this manual installation method, CircleCI machine runner 3 will not automatically update. |
To install machine runners and run jobs, you will need to have root access, and have the following utilities and tools installed on your system:
-
Coreutils - Linux only
-
Homebrew - macOS only
-
curl (installed by default on macOS)
-
sha256sum (if not pre-installed):
-
brew install coreutils
-
sudo apt install coreutils
for Ubuntu/Debain -
sudo yum install coreutils
for Red Hat
-
-
Gzip - Linux only
-
sepolicy
(RHEL 8 only) - Linux only -
rpmbuild
(RHEL 8 only) - Linux only -
The CircleCI CLI if you wish to install runners from the command line
Note
|
The current CircleCI machine runner binary can always be found by using current as the version. To install a specific previous version of the CircleCI runner the $RUNNER_VERSION environment variable can be changed from the value of current to the specific preferred version.
|
export RUNNERVERSION='current'
export CPUARCH=$(/usr/bin/arch | grep 'x86_64' >/dev/null 2>/dev/null && echo 'amd64' || echo 'arm64')
export OSTARGET=$(uname -s | tr '[:upper:]' '[:lower:]')
curl -s -L "https://circleci-binary-releases.s3.amazonaws.com/circleci-runner/${RUNNERVERSION}/circleci-runner_${OSTARGET}_${CPUARCH}.tar.gz" -o $HOME/circleci-runner.tar.gz && tar -zxvf $HOME/circleci-runner.tar.gz
Update permissions for your CircleCI machine runner to enable running its binary:
chmod +x $HOME/circleci-runner
-
Create the directory in which CircleCI machine runner jobs will start:
mkdir $HOME/circleci
-
Create a CircleCI runner configuration file:
touch $HOME/circleci-runner-config.yaml
-
Populate the newly created file with the configuration for your runner. An example can be seen below.
NoteYou will need to change the auth_token
value from"your-auth-token"
to the resource class token created in step 1.nano $HOME/circleci-runner-config.yaml
runner: name: "my-macos-runner" working_directory: "$HOME/circleci" cleanup_working_directory: true api: auth_token: "your-auth-token"
-
If you are using CircleCI server you will need to provide the URL for your install. You can do this by adding the URL to
$HOME/circleci-runner-config.yaml
using text editor of your choice.api: auth_token: "your-auth-token" # On server, set url to the hostname of your server installation. url: https://runner.circleci.com
$HOME/circleci-runner machine --config $HOME/circleci-runner-config.yaml