CloudSnorkel / cdk-github-runners

CDK constructs for self-hosted GitHub Actions runners
https://constructs.dev/packages/@cloudsnorkel/cdk-github-runners/
Apache License 2.0
255 stars 37 forks source link

feature request: self hosted ephemeral enterprise runners #204

Closed pharindoko closed 1 year ago

pharindoko commented 1 year ago

Currently this solution can be used in conjunction with github apps for organizations and personal repositories.

Github Enterprise supports "self-hosted enterprise runners" that can be registered on the enterprise level. Would be nice to have the option to created self-hosted enterprise runners.

kichik commented 1 year ago

Do you mean for self-hosted GitHub Enterprise Server? That already works. We even have proper support for self-signed certificates.

Otherwise I'm not sure what you mean. We always register the runners on the repository level. The app is just used to get notifications of jobs. I don't believe you can create the app at the enterprise level. You may need a public app and have all the organizations use it.

pharindoko commented 1 year ago

Hey @kichik we already use your solution with a self-hosted Github Enterprise Server and we do have a public app that can be used by all other organizations.

The next level would be to have common runners on the enterprise / admin level in this github enterprise server instance. This won`t work with a github app. (can only be installed on personal or organizational level.

kichik commented 1 year ago

That's not possible as far as I know. Have you seen any documentation saying it's possible?

pharindoko commented 1 year ago

That's not possible as far as I know. Have you seen any documentation saying it's possible?

I found this documentation:

https://docs.github.com/en/enterprise-cloud@latest/admin/github-actions/getting-started-with-github-actions-for-your-enterprise/getting-started-with-self-hosted-runners-for-your-enterprise#1-configure-policies-for-github-actions

kichik commented 1 year ago

That seems to be instructions on how to register a runner at an enterprise level. But I don't see see the possibility of creating an app that lets us get webhook events for the entire enterprise, or permissions to register on-demand runners for the entire enterprise. So you would still need to create an app and install it on all organizations to get webhook events and permissions. Did I miss something in that document that lets us create an app or enterprise-level webhook and permissions?

pharindoko commented 1 year ago

I hoped that you might know this 😄 So github apps will only work on org or personal level.. Will try to figure this out...

kichik commented 1 year ago

I wish I knew the answer. Installing the app for all organizations is daunting. You might be able to create a "bot" user with access to everything and use PAT.

pharindoko commented 1 year ago

Thanks for the discussion @kichik. I haven't found any api method to register a enterprise- level runner via api either.

kichik commented 1 year ago

FWIW global webhooks apparently exist. You can use a global webhook with PAT for a user with admin access to all repos. That should work. It is just not an automatic setup process like with apps and manifests.