Skip to content

Select executor type based on job tags #1546

Open
@yangm97

Description

@yangm97

Is your feature request related to a problem? Please describe.

Some pipelines use more than one runner type, for instance docker on build and shell on deploy, or a build for macOS and another for Linux.

The gitlab-runner daemon itself supports declaring multiple runners on the same machine and jobs are distributed based on tags.

Describe the solution you'd like

In order to mimic the behavior of distributing the jobs from a pipeline to multiple runners the user would set a set of mappings of tag->executor_type.

It may be useful to implement some defaults based on common usage patterns. From the official documentation we get examples such as:

  • dind for docker-in-docker
  • macos, saas-macos-medium-m1, saas-macos-large-m2pro for shell on macOS
  • shell for shell on Linux

Describe alternatives you've considered

A workaround for this is to not run the pipeline all at once but rather "micro-manage" each step so the correct executor can be enforced.

Additional context
Add any other context or screenshots about the feature request here.

Activity

firecow

firecow commented on Apr 13, 2025

@firecow
Owner

I'm not sure I understand how this would benefit your local flow
Please attach a good example that illustrates problems that this feature would address.

added
featureFeature missing according to gitlab ci standard
on Apr 13, 2025
jclaisse

jclaisse commented on Apr 24, 2025

@jclaisse

Hi, it will also help me in my case : I have a .gitlab-ci.yml which has build stage for both OS: windows and linux and the only way to differentiate the jobs are tags :

build:windows-shared:
  stage: build
  tags:
    - win10
    - build
  script:
    - cmake.exe -S . -B CI -G "Visual Studio 17 2022" -A x64 -DCMAKE_INSTALL_PREFIX="$INSTALL_PREFIX" -DBUILD_SHARE .....
    - cmake.exe --install CI --config Release
    - cd CI
    - ctest.exe --output-on-failure -C Release
  artifacts:
    paths:
      - CI
    expire_in: 2 hour

build:ubuntu-static:
  stage: build
  tags:
    - ubuntu
    - build
  script:
    - cmake -S . -B CI -DCMAKE_BUILD_TY ......
    - cd CI
    - ctest --output-on-failure -C Release
  artifacts:
    paths:
      - CI
    expire_in: 2 hour
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureFeature missing according to gitlab ci standard

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @firecow@yangm97@jclaisse

        Issue actions

          Select executor type based on job tags · Issue #1546 · firecow/gitlab-ci-local