[feat] add utilities on worker pool creation etc#1183
Open
liyu-ma wants to merge 12 commits into
Open
Conversation
- CreateNodePools splits a {sku: nodes} map into pools capped at
MAX_NODES_PER_POOL (800), each created with --no-wait so all pools
provision in parallel.
- WaitForAllWorkerNodesReady polls every requested pool's
provisioningState (reusing waitForNodePoolScript) and then waits for
the matching number of worker nodes to be Ready via kubectl.
- DeleteResourceGroup gains a configurable condition (default
always()) so callers can override cleanup behavior.
- RecordBenchmarkStart emits a step that captures the current UTC
time as the BENCHMARK_START pipeline variable.
- Add a PoolEntry schema (name, sku, count) so node-pool plans are strongly typed instead of carried as parallel [any] arrays. - Rename the internal poolPlan helper to the public PlanNodePools, returning [PoolEntry] and caching the SKU iteration order so the per-SKU/per-pool comprehensions can't drift out of sync. - CreateNodePools and WaitForAllWorkerNodesReady now both take [PoolEntry], so a single PlanNodePools(skuToNodes) call drives both steps and the pool names/counts are guaranteed to agree.
Rename the PoolEntry schema to NodePool for clarity. Restructure WaitForAllWorkerNodesReady to iterate pool-by-pool: for each pool it waits for provisioningState=Succeeded and then reports how many nodes in that pool are still not Ready, instead of aggregating Ready counts across all pools with a regex.
Build the optional --node-taints, --labels and --no-wait flags into a list, drop empties, and join them onto a single line in the script so unset flags no longer leave blank backslash-continued lines.
Replace the module-level MAX_NODES_PER_POOL constant with a maxNodesPerPool parameter on PlanNodePools, defaulting to 800. Lets callers tune pool sizing without forking the helper.
xinWeiWei24
reviewed
May 20, 2026
xinWeiWei24
reviewed
May 20, 2026
Generalize the helper so callers pass the pipeline-variable name to populate. Also rename the file to record_current_time.k to match.
wonderyl
reviewed
May 20, 2026
wonderyl
reviewed
May 20, 2026
wonderyl
reviewed
May 20, 2026
wonderyl
reviewed
May 20, 2026
Cover single-SKU under/at/over max, multi-SKU global pool naming, zero-count and empty-map filtering, and custom maxNodesPerPool with exact division. Runs via 'kcl test ./lib/steps/azure'.
wonderyl
reviewed
May 20, 2026
wonderyl
reviewed
May 21, 2026
wonderyl
reviewed
May 21, 2026
wonderyl
reviewed
May 21, 2026
wonderyl
reviewed
May 21, 2026
wonderyl
reviewed
May 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CreateNodePoolto allow--no-waitPlanNodePoolsfunction to decide pool config based on max node per poolWaitForAllWorkerNodesReadyto wait for pools + nodes to be readyCreateNodePool