Start Building for Free
CircleCI.comAcademyBlogCommunitySupport

Migrate from launch agent to machine runner 3.0 on Windows - Open preview

3 months ago1 min read
Cloud
On This Page

This page describes how to migrate an existing launch agent installation to machine runner 3.0. Machine runner 3.0 on Windows.

Migrating from launch agent to machine runner 3.0 is a straightforward process. The prerequisites remain the same. First, uninstall and remove launch agent, then, install the machine runner 3.0 agent. The configuration file is 1:1 compatible between the agents so no modifications are needed during the migration

1. Uninstall launch agent

The first step is to uninstall launch agent.

  1. Download the Uninstall-CircleCIRunner.ps1 script from GitHub to an easily accessible location.

  2. Open PowerShell as an administrator and navigate to the directory where you placed the script file.

  3. Run the following in your PowerShell:

    ./Uninstall-CircleCIRunner.ps1

2. Copy current launch agent configuration

Machine runner 3.0 is backwards compatible with the launch-agent configuration file. Using PowerShell copy the existing launch-agent config for use with the machine runner 3.0 installation.

$desktopDir = [Environment]::GetFolderPath("Desktop")
copy "$env:ProgramFiles\CircleCI\runner-agent-config.yaml" "$desktopDir/runner-agent-config.yaml"

3. Install machine runner 3.0

  1. Download the Install-CircleCIRunner.ps1 script from GitHub to an easily accessible location.

  2. Open PowerShell as an administrator and navigate to the directory where you placed the script file.

  3. Run the following in your PowerShell:

    Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072;
    ./Install-CircleCIRunner.ps1

    The installation will be output into your PowerShell interface.

  4. As part of the installation, the configuration file for the machine runner (launch-agent-config.yaml) will open in Notepad. Fill in the information from the previous configuration file copied in step 2. The configuration file is located in the installation directory, C:\Program Files\CircleCI, by default.

After setup completes, the machine runner starts automatically and begins looking for jobs to process.

Machine runner configuration example

The fields you must set for a specific job to run using your machine runners are:

  • machine: true

  • resource_class: <namespace>/<resource-class>

Simple example of how you could set up a job:

version: 2.1

workflows:
  build-workflow:
    jobs:
      - runner
jobs:
  runner:
    machine: true
    resource_class: <namespace>/<resource-class>
    steps:
      - run: echo "Hi I'm on Runners!"

Suggest an edit to this page

Make a contribution
Learn how to contribute