Skip to content

gitea runner labels can't use extended (docker image) syntax #697

@Infinoid

Description

@Infinoid

Hi,

The garm pool has a comma-separated set of labels, which are passed through to the gitea act_runner executable. That's great. But label syntax is a little more complex for gitea, and garm's parser should be aware of this.

If you just say "ubuntu-latest", the default is to run the job in "host" mode, meaning it runs as a normal child process, under the same OS as the runner itself. To configure a label to run jobs in a docker container, the label syntax becomes "ubuntu-latest:docker://dockertag", as documented here.

The problem occurs when I pass in my own label using similar syntax, like this:

% garm-cli pool add \
    --repo=c7ad5df3-efd4-4d09-880c-4827ddae290c \
    --provider-name=aws \
    --tags=garm-test:docker://docker.gitea.com/runner-images:ubuntu-latest \
[…]

Garm receives this webhook:

{
  "action": "queued",
  "workflow_job": {
    "id": 6652,
    "labels": [
      "garm-test"
    ],
[]

Garm doesn't appear to know the label is "garm-test"... I think it matches against the full string. I see this in the logs:

time=2026-04-01T15:09:14.040Z level=WARN msg="no pools matching tags; not recording job" requested_tags=garm-test action=handle_workflow pool_mgr=hello-world/hello-world endpoint=gitea pool_type=repository
time=2026-04-01T15:09:14.040Z level=ERROR msg="failed to handle workflow job" error="job 6652 should not be recorded"
time=2026-04-01T15:09:14.040Z level=INFO msg=access_log method=POST uri=/webhooks/5d4dc1da-0b83-44b4-b034-e995c886307e user_agent=Go-http-client/1.1 ip=[2600:1f18:7bbe:ba49:7925::10]:41074 code=500 bytes=38 request_time=1.801309ms

When I set the label simply as "garm-test", it works. But this effectively limits the gitea runner to acting in host mode. Which means I would need separate EC2 AMIs and Garm pools for "debian" vs "alpine", for example.

Would it be possible to handle this syntax in pool labels? It should continue passing the whole thing through to act_runner, but the webhook handler should only match the part before the colon.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions