Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expose runner-status in API #454

Closed
davidkarlsen opened this issue Apr 24, 2020 · 10 comments
Closed

expose runner-status in API #454

davidkarlsen opened this issue Apr 24, 2020 · 10 comments
Assignees
Labels
Runner ❤️ Container Service Feature Feature scope to the pipelines service and launch app

Comments

@davidkarlsen
Copy link

davidkarlsen commented Apr 24, 2020

Describe the enhancement
Today the api only exposes on/offline status: https://developer.github.com/v3/actions/self-hosted-runners/#list-self-hosted-runners-for-a-repository

It would be better if the API could show if the runner is occupied with a job or not (like in the UI).

We want to use this to dynamically provide self-hosted runners based on demand.

usecase:

  1. package runner as docker image
  2. have a k8s controller: https://github.com/evryfs/github-actions-runner-operator/
  3. make runner spawn runners based on CRD high/low water marks and demand for runners.

Also - ideally there should be a possibility to add labels to runners, so that we can have different pools of runners for different environments. These labels should be reflected in the API so we can distinguish them both when listing runners, as well as using in jobs to select the appropriate type of runner.

Code Snippet
status, enum of (online,offline,queued) (offline,idle,queued)
labels, map of
key: val

Additional information
Killer feature for providing dynamic build-pools which again can help park Jenkins for good :)

@davidkarlsen
Copy link
Author

davidkarlsen commented Apr 29, 2020

Any thoughts on this @bryanmacfarlane ?

@davidkarlsen
Copy link
Author

Bump. @bryanmacfarlane

@missedone
Copy link

i'm looking for the similar features.
i'd like to implement auto scaling out for the runners based on metrics like how busy it is.

@bryanmacfarlane
Copy link
Member

@hross to look at priority

@bryanmacfarlane
Copy link
Member

I pinged some folks to at least get some 👀 on it :)

@hross
Copy link
Contributor

hross commented May 13, 2020

I added this for internal discussion. I like the feature, I think it deserves some priority. Let me see where we can fit it...

@hross
Copy link
Contributor

hross commented May 15, 2020

one thing to note here is even if you get this API you may have a race condition unless you can disable an agent (stop it from picking up more builds) because it might pick up another build while it is idle, before you kill it.

@davidkarlsen
Copy link
Author

@hross Yes - it won't be bullet-proof. It's possible to add a preStop hook: https://kubernetes.io/docs/tasks/configure-pod-container/attach-handler-lifecycle-event/ which could tail the status of the build log in order to let the running build finish - but it's a bit of a hack. But at least it should be easy to scale up this way.

@TingluoHuang TingluoHuang added Runner ❤️ Container service Service Feature Feature scope to the pipelines service and launch app and removed enhancement New feature or request service labels Jun 8, 2020
@lomkju
Copy link

lomkju commented Jul 3, 2020

@davidkarlsen @hross We run actions on VMs rather than on k8s (Even though all other infra is on k8s). We don't want the overhead of running k8s on runners (ds, kubelet ...).

It would be great if the runner could understand different signals.

SIGTERM: Cancel the current job and EXIT.
SIGWINCH: Wait for job to finish and EXIT.

We would want the latter as when we downscale our autoscaling group would want the job to finish before the runner exits.

@davidkarlsen
Copy link
Author

It seems this has been added to the API now... google/go-github#1589

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Runner ❤️ Container Service Feature Feature scope to the pipelines service and launch app
Projects
None yet
Development

No branches or pull requests

6 participants