Meta Labels - testflows/TestFlows-GitHub-Hetzner-Runners GitHub Wiki
Meta labels can be used to define custom runner labels that will be expanded to include itself as well as any other supported labels, such as:
- type-{name}. See Specifying The Runner Type.
- in-{name}. See Specifying The Runner Location.
- net-{name}. See Specifying The Runner Network.
- image-{architecture}-{type}-{name}. See Specifying The Runner Image.
- setup-{name}. See Specifying The Custom Runner Server Setup Script.
- startup-{name}. See Specifying The Custom Runner Server Startup Script.
The meta labels can be defined using the --meta-label option. More than one meta label can be defined.
|
Composite label values for `type-` and `in-` do not work inside meta labels. ✅
--meta-label test-x86 "self-hosted,type-cx23,type-cpx22" — works❌
--meta-label test-x86 "self-hosted,type-cx23-cpx22" — does not work
|
|
| ✋ Note: |
The meta label is not replaced but expanded to include itself and any labels that are defined for it. For example, runs-on: [test-x86] — is expanded toruns-on: [self-hosted, test-x86, type-cx23, type-cpx22] |
- The --label-prefix option is checked after the meta labels have been expanded.
- The --with-label option is checked before the meta labels are expanded.
| ✋ Note: | When using --label-prefix, both the meta label name and its values must include the prefix. |
|---|
-
You can define test-arm and test-x86 meta labels to provide x86 and ARM runners with the specific server type and image.
github-hetzner-runners --meta-label test-arm "self-hosted,type-cax21,image-arm-system-ubuntu-22.04" --meta-label test-x86 "self-hosted,type-cpx22,image-x86-system-ubuntu-22.04"
will define the following two meta labels:
- test-arm that will map to [test-arm, self-hosted, type-cax21, image-arm-system-ubuntu-22.04]
- test-x86 that will map to [test-x86, self-hosted, type-cpx22, image-x86-system-ubuntu-22.04]
Once meta labels are defined, you can use them to request a runner with the corresponding labels.
job-name: runs-on: [test-arm]
that will be equivalent to
job-name: runs-on: [test-arm, self-hosted, type-cax21, image-arm-system-ubuntu-22.04]
and
job-name: runs-on: [test-x86]
that will be equivalent to
job-name: runs-on: [test-x86, self-hosted, type-cpx22, image-x86-system-ubuntu-22.04]
-
You can make self-hosted a meta label to include your custom defaults for server type, server image and location.
github-hetzner-runners --meta-label self-hosted "type-cax21,image-arm-system-ubuntu-22.04,in-hel1" -
You can use a meta label to define proper server image for ARM server types given that the default image is for x86.
github-hetzner-runners --meta-label type-cax21 "image-arm-system-ubuntu-22.04" -
You can use meta labels with
--label-prefix.github-hetzner-runners --label-prefix "my-" --meta-label my-test-x86 "my-type-cx53,my-type-cpx62,my-image-x86-system-ubuntu-22.04"