Skip to content

MLE-32297: Consolidate Jenkins pipeline stage agents - #478

Merged
vitalykorolev merged 2 commits into
developfrom
MLE-32297_jenkinsfile-stage-agents
Sep 4, 2026
Merged

MLE-32297: Consolidate Jenkins pipeline stage agents#478
vitalykorolev merged 2 commits into
developfrom
MLE-32297_jenkinsfile-stage-agents

Conversation

@vitalykorolev

@vitalykorolev vitalykorolev commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Jira: MLE-32297

Problem

Since ARM/Graviton build support was added, the pipeline switched from a single top-level agent to agent none with nearly every stage declaring its own agent { node { label 'cld-docker' } } (Clean-Previous-Results, Pre-Build-Check, Copy-RPMs, Build-Image, Pull-Upgrade-Image, Lint, Scan, Structure-Tests, Docker-Run-Tests, Publish-Image, BlackDuck-Scan), plus separate node() allocations in each post block branch. This causes ~11+ independent node allocate/release cycles per build even though these stages run strictly sequentially and never in parallel.

With only 3 physical cld-docker workers and multiple nightly builds triggered within overlapping cron windows, any delay in an earlier build causes builds to pile up (6+ concurrent runs observed), and the fine-grained per-stage node acquisition creates executor thrashing/queuing between every stage, significantly increasing total build time.

Fix

Consolidated the stages that always require cld-docker onto the pipeline's single top-level agent (inherited implicitly, no per-stage re-allocation), and removed the explicit node() wrapping in post block branches so cleanup/notification reuse the same agent context. ARM/graviton-specific stages (SCAP-Scan, Load-Image, Structure-Tests/Docker-Run-Tests when ARM, Cleanup-ARM) are intentionally left unchanged since they must switch node pools.

This reduces node allocations per x86 build from ~11 down to 1.

Testing

Verified by running the updated pipeline manually; behaves as expected.

Follow-up (tracked separately, not in this PR)

Add a Lockable Resources based concurrency cap once DevOps defines cld-docker/cld-docker-graviton resource pools, to hard-limit total concurrent pipeline runs to available worker capacity.

Jira: MLE-32297

Copilot AI lite review requested due to automatic review settings September 2, 2026 01:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

A top-level cld-docker agent can remain reserved while stages with their own agent blocks still allocate additional executors, which may undercut the intended reduction in node allocations and worsen worker contention (especially when ARM/graviton stages run).

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR updates the repository’s Jenkins pipeline to reduce Jenkins worker thrashing by consolidating many x86 stages onto a single shared cld-docker agent context, instead of acquiring/releasing a node per stage.

Changes:

  • Replaces agent none with a top-level agent { node { label 'cld-docker' } } so stages without their own agent reuse one executor.
  • Removes agent { node { label 'cld-docker' } } from multiple sequential stages (Clean/Pre-check/Copy-RPMs/Build/Lint/Scan/Publish/BlackDuck).
  • Removes explicit node('cld-docker') allocations in post blocks so cleanup/notifications run in the existing agent context.
File summaries
File Description
Jenkinsfile Consolidates x86 stage execution onto a shared cld-docker agent and removes extra node allocations in post to reduce per-stage re-queuing overhead.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread Jenkinsfile Outdated
…op-level agent

Holding a top-level cld-docker agent for the whole pipeline while
SCAP-Scan/Structure-Tests/Docker-Run-Tests still declared their own
agent caused two nodes of the same scarce label pool to be held at
once (and left the x86 executor idle during graviton stages),
risking queue deadlock under load. Reverted to agent none and
grouped the always-cld-docker stages that never overlap with the
graviton stages into two nested-stage blocks (Prepare-Build-Lint-Scan,
Publish-And-Scan), each with its own agent scoped to just that group
and released before the next stage needs a different node.
@vitalykorolev
vitalykorolev merged commit b74a528 into develop Sep 4, 2026
5 checks passed
@vitalykorolev
vitalykorolev deleted the MLE-32297_jenkinsfile-stage-agents branch September 4, 2026 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants