Gitlab SaaS runner resources are specified using tags, but our enhanced runner allows for resources to be specified directly through variables. This allows for fine-tuning of resources, but our focus for migration will be to transfer existing values.
- For homogenous pipelines, where all jobs use the same tag, the resources can be configured on the runner or via
the
default
stanza. - For non-homogenous pipelines, containing jobs with a variety of resource requirements, variables should be used to configure each job with the most common requirements set as the default.
Alternatively, the largest value may be set as the default to ensure everything works before porting the values.
Lookup
Lookup the resources provided by a SaaS machine tag and apply them as appropriate.
For example, jobs tagged with saas-linux-large-amd64
would use the following values.
variables:
KUBERNETES_CPU_REQUEST: "8"
KUBERNETES_MEMORY_REQUEST: "32Gi"
The variables are ignored by the Gitlab SaaS runners and thus can be added without impact.
Tag
Job tags can be controlled using variables. This allows for swapping values without modifying the pipeline configuration.
job1:
tags: [ $TAG_SMALL ]
job2:
variables:
KUBERNETES_CPU_REQUEST: "8"
KUBERNETES_MEMORY_REQUEST: "32Gi"
tags: [ $TAG_LARGE ]
In the example the TAG_LARGE
variable can be toggled between saas-linux-large-amd64
and cedarci
. Alternatively,
the tag can be changed directly without the use of a variable.