Skip to content

GHES Runners at Enterprise Level support #1303

Open
@axel3rd

Description

@axel3rd

Feature

GHES provides today Runners at enterprise level.

Having some pool usable by organizations (if enabled by orga owner in settings) can be helpful (project teams don't have to manage runners and scalability by them-self).

If it can be supported (as complement off enable_organization_runners parameter), it would be nice 😁.


Investigations

Currently if enable_organization_runners is used, the scale-up send as configuration:

{
    "environment": "github-runners-poc",
    "runnerServiceConfig": "--url https://github.company.com/some-org --token AAA[...] --labels ubuntu --runnergroup Default",
    "runnerOwner": "some-org",
    "runnerType": "Org"
}

When new Runner is added manually at Enterprise Level (https://github.company.com/enterprises/[enterprise-name]/settings/actions/runners), the configuration parameters are:

./config.sh --url https://github.company.com/enterprises/my-company-name --token BBB[...]

Even if userdata_template parameter is used with a full custom user-data.sh script where $CONFIG is not used and previous line ~hardcoded:

https://github.com/philips-labs/terraform-aws-github-runner/blob/e28ceab2467b4e068ba7efaa59c75b7f1f3b3111/modules/runners/templates/install-config-runner.sh#L20

https://github.com/philips-labs/terraform-aws-github-runner/blob/e28ceab2467b4e068ba7efaa59c75b7f1f3b3111/modules/runners/templates/install-config-runner.sh#L29

.... It doesn't work due to token validity during time, which provides after ~1 hour of usage:

--------------------------------------------------------------------------------
|        ____ _ _   _   _       _          _        _   _                      |
|       / ___(_) |_| | | |_   _| |__      / \   ___| |_(_) ___  _ __  ___      |
|      | |  _| | __| |_| | | | | '_ \    / _ \ / __| __| |/ _ \| '_ \/ __|     |
|      | |_| | | |_|  _  | |_| | |_) |  / ___ \ (__| |_| | (_) | | | \__ \     |
|       \____|_|\__|_| |_|\__,_|_.__/  /_/   \_\___|\__|_|\___/|_| |_|___/     |
|                                                                              |
|                       Self-hosted runner registration                        |
|                                                                              |
--------------------------------------------------------------------------------

# Authentication

Http response code: Unauthorized from 'POST https://github.company.com/api/v3/actions/runner-registration'
{"message":"Token expired.","documentation_url":"https://docs.github.com/enterprise/3.2/rest"}
Response status code does not indicate success: 401 (Unauthorized).

Problems to solve

1° Parameter name:

A new enable_enterprise_runners, with company-name as value (=> string type), can be added.

It provides a config like:

{
    "environment": "github-runners-poc",
    "runnerServiceConfig": "--https://github.company.com/enterprises/my-company-name --token AAA[...] --labels ubuntu --runnergroup Default",
    "runnerOwner": "my-company-name",
    "runnerType": "Enterprise"
}

2° Retrieve token usable at enterprise level:

Retrieve a token usable for Runner at Enterprise Level (the one given when "New Runner" is clicked in Enterprise Settings) is perhaps not obvious, should be investigated.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions