Select runner in .gitlab-ci.yml based on pull_policy

Description

My organization has a large number of shared runners. Some of these are docker runners with pull_policy = if_not_present. As a result, CI jobs are non-deterministic, depending on the pull_policy of the randomly assigned runner.

Proposal

A solution for this specific issue might involve a new keyword, like pull_policy. It would filter the possible runners to find ones that match the specified policy.

build:
  script:
    - docker build
  tags:
    - docker
  pull_policy: always

More generally, being able to select a runner based on executor settings (or the executor itself, or even machine attributes, like OS level, memory, etc) would make this a more useful feature.

build:
  [...]
  runner_attributes:
    pull_policy: always
    platform: linux
    memory: ">4gb"

Links / references

Assignee Loading
Time tracking Loading