Sunday, October 20, 2024

github actions register multiple runners on a machine

 


To allow a single Docker host runner to handle multiple jobs simultaneously, you need to modify the runner configuration to register multiple runner processes on the same host machine. :

Steps to Register Multiple Runner Processes:

  1. Create a New Runner Directory: Each runner instance requires its own directory. To register multiple runners, create separate directories for each one.

    mkdir actions-runner-2
    cd actions-runner-2
    
  2. Download and Configure Another Runner: You can download the runner from your GitHub repository or organization.

    # Download the latest runner package
    curl -o actions-runner-linux-x64-2.308.0.tar.gz -L https://github.com/actions/runner/releases/download/v2.308.0/actions-runner-linux-x64-2.308.0.tar.gz
    
    # Extract the installer
    tar xzf ./actions-runner-linux-x64-2.308.0.tar.gz
    
  3. Register the Runner: Register the second runner using a different name for the same repository or organization.

    ./config.sh --url https://github.com/<owner>/<repo> --token <registration_token>
    


    You can get the <registration_token> from your GitHub repository or organization settings under Settings > Actions > Runners.

  4. Start the New Runner: Start the new runner so it can handle additional jobs.

    ./svc.sh install
    ./svc.sh start
    



    Now, you should have two runners registered on the same machine, which can handle two jobs simultaneously.

  5. Repeat for More Runners: If you want to handle more concurrent jobs, repeat the above steps, creating more runner directories (e.g., actions-runner-3, etc.) and registering them.

  6. Runners can be created as a background service using these steps.

No comments:

Post a Comment