Interview Prep/CI/CD/Jenkins Pipelines and Agents

A job must run on a particular agent that has a GPU or a license-bound tool. How do you target it?

BeginnerScenarioJenkins Pipelines and Agents
Answer

Situation read → Agent selection by capability.

What I'd do →

  1. Label the node (gpu, matlab) in node configuration.
  2. Select with agent { label 'gpu && linux' }.
  3. Set the node usage to "Only build jobs with label expressions matching this node" so general jobs do not steal it.

Why → Labels decouple pipelines from hostnames and protect scarce nodes.

Interview tip → Label expressions support &&, || and !.

All CI/CD questions

More on Jenkins Pipelines and Agents