Add an option for ephermeral runners to be deleted if they fail to fetch a job #109
Labels
No labels
Stage
Idea
Stage
Ready
No milestone
No assignees
2 participants
Notifications
Due date
No due date set.
Reference
forgejo/forgejo-actions-feature-requests#109
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
How to use this feature request
First hand experience
The environment I run our Windows/OSX runners in does not allow me to use --wait, as it both costs per minute the VM is up, and also forbids in its TOS blocking VMs longer than necessary.
So my ephermeral runners in that environment just exit if they found no job to run.
But this leaves them registered with the Forgejo instance indefinitely, and since the VM that ran them and holds their token is long gone, they won't ever be able to fetch a job and run it.
Needs and benefits
Ideally, the runner should just be deleted as if it had run a job when failing to find a job to run.
Feature Description
There should be some option to either have an ephemeral runner able to self-delete with its token, or flag it to be auto-deleted when failing to fetch a task.
Since I am currently still stuck using the old "./runner register" method, any such flag could also hopefully be added to it.
What needs to happen before a feature request is ready to be implemented?
Users can complete the first step (accumulating first and experience) on their own, even if this feature request did not catch the eye of someone with the necessary skills to implement it. And when it reaches that point, it will stand out and have a much higher chance of being implemented.
To fully grasp the scope of a feature request, and to brainstorm possible solutions, a feature request will generally wait until several users have provided their perspective.
Thumbs-up reactions help gauge popularity, but do not provide the same amount of useful information.
Results from discussions and additional user experiences are incorporated into a final summary to provide a single reference for the developers working on this change.
This can be done by the author of the issue or anyone else in a followup comment.
Stage/Ideais changed toStage/Ready.Depending on the feature request it can be in Forgejo or Forgejo runner.
A copy/paste of the "Needs and benefit" and "Feature description" should be used, with link to this issue so the developer knows where to find more details if they need to.
Very rough sketch:
The mode could be included when registering the runner:
forgejo-runner register --mode NoWait ...Same for the HTTP API.Wait(default) would work like it does today: The ephemeral runner will be removed after it has completed its task.NoWaitwould allow at most oneFetchTask()call. If a task is waiting, it would be returned and the ephemeral runner would be deleted after it has been completed. If no task is waiting, the runner would be removed right away.I don't think it would interfere with the idempotency key. If no task is returned, it doesn't matter if Forgejo Runner doesn't receive the reply. And if a task is returned, it would work as it does today.
I seriously dislike the naming. It suggests that it would switch
--waiton or off which isn't the case.RemoveAfterTaskCompletion(instead ofWait) andRemoveAfterUnsuccessfulFetch(instead ofNoWait) are both a mouthful.