[Proposal] Support changing labels of Actions runner without re-registration #24540
Labels
topic/gitea-actions
related to the actions of Gitea
type/proposal
The new feature has not been accepted yet but needs to be discussed first.
Background
Act runner will ask for labels when you register it to a Gitea instance. For example, one of the default labels is
ubuntu-latest:docker://node:16-bullseye
. It could be split into two parts.:ubuntu-latest
: This means it can run jobs withruns-on: ubuntu-latest
docker://node:16-bullseye
: This means that the jobs will run in Docker containers with the specified image.The runner will report
ubuntu-latest
to the Gitea instance, so the instance will know what kind of jobs can be assigned to this runner. However, the instance doesn't know the second part of the label because Gitea doesn't care how a runner runs jobs.For some reason, it was designed to allow modifying labels on the Gitea side, in a special way:
So it will be convenient for users when they have a job with
runs-on: centos
, but there are no runners with the label. They can addcentos
as a custom label to let the runner pick up the jobs.Unfortunately, when the runner receives the job, it doesn't understand how to run it. To avoid failure, the act runner will use the default image to run jobs with unrecognized labels. This may surprise users.
IMO, the point is that we shouldn't let Gitea define runners. It should be the runners who decide what kind of jobs they can run, not the Gitea instance. However, we also need to provide an elegant way to modify labels on the runner side, instead of re-registration.
Solution
Forbid modifying runner labels on the Gitea side
Combine “agent labels” and “custom labels” to “labels”.Drop “custom labels” and use “agent labels” only.Provide a new RPC method for runners to declare their labels
Declare
(or a better name).Declare
to pass its current labels to Gitea once it has started.Support specifying labels in the config file of the runner
Benefits
The text was updated successfully, but these errors were encountered: