Skip to content

feat(templatize): add multi-stamp parallel execution for entrypoint runs#5697

Merged
openshift-merge-bot[bot] merged 1 commit into
Azure:mainfrom
geoberle:templatize-stamping
Jul 9, 2026
Merged

feat(templatize): add multi-stamp parallel execution for entrypoint runs#5697
openshift-merge-bot[bot] merged 1 commit into
Azure:mainfrom
geoberle:templatize-stamping

Conversation

@geoberle

@geoberle geoberle commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

What

ARO HCP deploys management clusters as "stamps" within Azure regions. Previously templatize handled one stamp per invocation. This change makes the execution engine natively iterate stamps in parallel.

  • Execution state isolation: ExecutionState gains per-stamp output isolation (StampOutputs). GetOutputs(stamp) returns a merged snapshot (stamp layer over base). All step runners (ARM, ARM stack, Helm, shell) use stamp-aware input resolution.

  • Stamp resolution: New --stamp-count-config-ref flag reads stamp count from config (e.g. mgmt.stamps.count). Works with both --entrypoint and --service-group modes. BuildStampList/ResolveStampConfigs in entrypointutils/stamps.go serve run and cleanup subcommands.

  • RunStampedPipeline: Added for service-group mode. Uses graph.ForStampedPipeline (new in ARO-Tools) to build a stamp-aware execution graph for a single service, then wraps the executor with stampConfigExecutor for per-stamp config injection.

  • Cleanup: Uses the same stamped graph constructors (ForStampedPipeline, ForStampedEntrypoints) to discover resource groups, matching the execution path. Iterates graph ResourceGroups in deterministic order.

Why

Management clusters are deployed as stamps within a region. The tooling needs to handle multiple stamps per region natively — deploying each stamp's resources with stamp-specific configuration while maintaining correct output isolation between stamps.

Testing

  • 240 existing tests pass
  • New tests for ExecutionState stamp output isolation, GetOutputs merging, stampConfigExecutor per-stamp config swapping
  • ARO-Tools: tests for ForStampedPipeline (unstamped service, stamped multi-stamp expansion, children stripped, step ordering preserved)

PR Checklist

  • PR is scoped to a single task (no mixed concerns)
  • Title follows Conventional Commits format
  • Summary explains the "Why" behind the change
  • Linked to relevant ticket/issue
  • Self-reviewed the diff
  • CI/CD checks are passing (ignore Tide)
  • Commit history is clean (rebased/squashed)

Copilot AI review requested due to automatic review settings June 17, 2026 16:18
@openshift-ci openshift-ci Bot requested review from raelga and stevekuznetsov June 17, 2026 16:18
@geoberle

Copy link
Copy Markdown
Collaborator Author

/hold
depends on Azure/ARO-Tools#250

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.

Pull request overview

This PR updates tooling/templatize to support running stamped service-group graphs concurrently within a single entrypoint invocation, while isolating per-stamp execution state (outputs/config/pipelines) to prevent cross-stamp collisions.

Changes:

  • Introduces stamp-layered step outputs via ExecutionState.RecordOutput and ExecutionState.GetOutputs(stamp) and updates step runners (ARM/ARMStack/Helm/Shell) to resolve inputs against the correct stamp view.
  • Switches entrypoint graph generation to graph.ForStampedEntrypoint(...) and adds a stampConfigExecutor wrapper to apply per-stamp configuration during execution.
  • Adds multi-stamp unit tests and updates CLI options/helpers + Makefile wiring to drive stamp-count-based runs/cleanup.

Reviewed changes

Copilot reviewed 15 out of 16 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tooling/templatize/pkg/pipeline/shell.go Shell step input resolution now reads outputs via GetOutputs(id.Stamp) for stamp isolation.
tooling/templatize/pkg/pipeline/run.go Core execution updated for stamped graphs, layered outputs, per-stamp config executor, and stamp-aware graph lookup.
tooling/templatize/pkg/pipeline/run_test.go Adds unit tests covering multi-stamp execution, output isolation, subscription resolution, and error propagation.
tooling/templatize/pkg/pipeline/helm.go Helm runner now resolves replacements/inputs using stamp-scoped outputs.
tooling/templatize/pkg/pipeline/arm.go ARM runner now passes stamp context through and resolves inputs using stamp-scoped outputs.
tooling/templatize/pkg/pipeline/arm_stack.go ARMStack input resolution switched to GetOutputs(id.Stamp); stack name logic remains stamp-influenced via options.Stamp.
tooling/templatize/internal/well_formed_test.go Updates well-formed validation iteration to match new stamped step keying in the graph.
tooling/templatize/go.mod Bumps ARO-Tools config / pipelines versions needed for stamped graph support.
tooling/templatize/go.sum Updates checksums for new ARO-Tools dependency versions.
tooling/templatize/cmd/rolloutoptions.go Persists ConfigResolver in completed rollout options to enable per-stamp config resolution.
tooling/templatize/cmd/entrypoint/run/options.go Entry-point run now precomputes stamped graph inputs (stamp configs/pipelines) and passes them into pipeline execution.
tooling/templatize/cmd/entrypoint/entrypointutils/stamps.go New helpers for stamp list derivation, per-stamp config resolution, and stamped graph assembly.
tooling/templatize/cmd/entrypoint/entrypointutils/options.go Adds --stamp-count-config-ref and updates regional RG precheck extraction to span all stamp configs.
tooling/templatize/cmd/entrypoint/cleanup/options.go Cleanup now builds stamped graph + uses all stamp configs to discover RGs for deletion.
Makefile Updates local-run and cleanup invocations to use --stamp-count-config-ref=mgmt.stamps.count.
dev-infrastructure/templates/mgmt-cluster.bicep Makes module deployment name stamp-unique via uniqueString(resourceGroup().name) to avoid cross-stamp ARM conflicts.

Comment thread tooling/templatize/cmd/entrypoint/run/options.go

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.

Pull request overview

Copilot reviewed 27 out of 36 changed files in this pull request and generated 7 comments.

Comment thread tooling/templatize/cmd/rolloutoptions.go Outdated
Comment thread tooling/templatize/cmd/pipeline/validate/options.go Outdated
Comment thread tooling/templatize/pkg/pipeline/run.go Outdated
Comment thread tooling/templatize/cmd/entrypoint/run/options.go Outdated
Comment thread tooling/templatize/cmd/entrypoint/entrypointutils/stamps.go Outdated
Comment thread tooling/templatize/pkg/pipeline/run.go Outdated
Comment thread tooling/templatize/cmd/entrypoint/entrypointutils/options.go Outdated
Copilot AI review requested due to automatic review settings June 19, 2026 14:56
@geoberle geoberle force-pushed the templatize-stamping branch from 6c2440e to b519c4b Compare June 19, 2026 14:56

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.

Pull request overview

Copilot reviewed 27 out of 36 changed files in this pull request and generated 3 comments.

Comment thread tooling/templatize/cmd/rolloutoptions.go Outdated
Comment thread tooling/templatize/pkg/pipeline/run.go
Comment thread tooling/templatize/cmd/entrypoint/entrypointutils/options.go Outdated
@geoberle geoberle force-pushed the templatize-stamping branch from b519c4b to a5c75d9 Compare June 19, 2026 15:59
Copilot AI review requested due to automatic review settings June 19, 2026 19:41
@geoberle geoberle force-pushed the templatize-stamping branch from a5c75d9 to 7660073 Compare June 19, 2026 19:41

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.

Pull request overview

Copilot reviewed 27 out of 36 changed files in this pull request and generated 2 comments.

Comment thread tooling/templatize/cmd/pipeline/validate/options.go Outdated
Comment thread tooling/templatize/pkg/pipeline/run.go Outdated
@geoberle geoberle force-pushed the templatize-stamping branch from 7660073 to dd52a09 Compare June 19, 2026 20:06
Copilot AI review requested due to automatic review settings June 19, 2026 20:14
@geoberle geoberle force-pushed the templatize-stamping branch from dd52a09 to 9579113 Compare June 19, 2026 20:14
@geoberle geoberle force-pushed the templatize-stamping branch from 03db15d to 1497e1d Compare July 7, 2026 16:28
Copilot AI review requested due to automatic review settings July 7, 2026 16:28

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.

Pull request overview

Copilot reviewed 26 out of 36 changed files in this pull request and generated 1 comment.

Comment thread tooling/templatize/pkg/pipeline/run.go
@geoberle geoberle force-pushed the templatize-stamping branch from 1497e1d to 1afa8c0 Compare July 7, 2026 19:26
Copilot AI review requested due to automatic review settings July 7, 2026 19:47
@geoberle geoberle force-pushed the templatize-stamping branch from 1afa8c0 to a414923 Compare July 7, 2026 19:47

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.

Pull request overview

Copilot reviewed 28 out of 38 changed files in this pull request and generated 1 comment.

Comment thread tooling/templatize/pkg/pipeline/run.go
@geoberle geoberle force-pushed the templatize-stamping branch from a414923 to 44171c4 Compare July 7, 2026 20:43
Copilot AI review requested due to automatic review settings July 7, 2026 22:01
@geoberle geoberle force-pushed the templatize-stamping branch from 44171c4 to 426131f Compare July 7, 2026 22:01

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.

Pull request overview

Copilot reviewed 29 out of 39 changed files in this pull request and generated 1 comment.

Comment thread tooling/templatize/pkg/pipeline/run.go
ARO HCP deploys management clusters as "stamps" within Azure regions.
Previously templatize handled one stamp per invocation. This change
makes the execution engine natively iterate stamps in parallel.

- ExecutionState gains per-stamp output isolation (StampOutputs).
  GetOutputs(stamp) returns a merged snapshot (stamp layer over base).
  All step runners (ARM, ARM stack, Helm, shell) use stamp-aware
  input resolution.

- New --stamp-count-config-ref flag reads stamp count from config
  (e.g. mgmt.stamps.count). Works with both --entrypoint and
  --service-group modes. BuildStampList/ResolveStampConfigs in
  entrypointutils/stamps.go serve run and cleanup subcommands.

- RunStampedPipeline added for service-group mode. Uses
  graph.ForStampedPipeline (new in ARO-Tools) to build a stamp-aware
  execution graph for a single service, then wraps the executor with
  stampConfigExecutor for per-stamp config injection.

- Cleanup uses the same stamped graph constructors (ForStampedPipeline,
  ForStampedEntrypoints) to discover resource groups, matching the
  execution path. Iterates graph ResourceGroups in deterministic order.

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.

Pull request overview

Copilot reviewed 29 out of 38 changed files in this pull request and generated 1 comment.

Comment thread tooling/templatize/internal/well_formed_test.go
@stevekuznetsov

Copy link
Copy Markdown
Contributor

/lgtm
/approve

@openshift-ci

openshift-ci Bot commented Jul 8, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: geoberle, stevekuznetsov

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [geoberle,stevekuznetsov]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@geoberle

geoberle commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator Author

/test image-updater-images

@geoberle

geoberle commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator Author

/test images

@geoberle

geoberle commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator Author

/retest

@geoberle

geoberle commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator Author

/hold cancel

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD 6caeb44 and 2 for PR HEAD bd85ac9 in total

@geoberle

geoberle commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator Author

this is infra setup only. failed e2e are irrelevant

/override ci/prow/e2e-parallel

@openshift-ci

openshift-ci Bot commented Jul 9, 2026

Copy link
Copy Markdown

@geoberle: Overrode contexts on behalf of geoberle: ci/prow/e2e-parallel

Details

In response to this:

this is infra setup only. failed e2e are irrelevant

/override ci/prow/e2e-parallel

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@geoberle

geoberle commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator Author

/test images

@geoberle

geoberle commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator Author

/override ci/prow/e2e-parallel

@openshift-ci

openshift-ci Bot commented Jul 9, 2026

Copy link
Copy Markdown

@geoberle: Overrode contexts on behalf of geoberle: ci/prow/e2e-parallel

Details

In response to this:

/override ci/prow/e2e-parallel

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants