Skip to content

feat: flag to restrict to phase3 provisioning only - #9746

Merged
Nishchay (awesomenix) merged 1 commit into
mainfrom
nishp/implment/phase3
Oct 13, 2026
Merged

Nishchay (awesomenix) merged 1 commit into
mainfrom
nishp/implment/phase3

Conversation

@awesomenix

Copy link
Copy Markdown
Contributor

Create a new flag to swtich to phase3 only provisioning so we can get into RP before freeze

Copilot AI balanced review requested due to automatic review settings October 10, 2026 01:09
@awesomenix
Nishchay (awesomenix) requested review from a team as code owners October 10, 2026 01:09
@awesomenix Nishchay (awesomenix) changed the title feat: restrict to phase3 provisioning only feat: flag to restrict to phase3 provisioning only Oct 10, 2026
@github-actions

github-actions Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Windows Unit Test Results

  3 files   18 suites   1m 8s ⏱️
551 tests 551 ✅ 0 💤 0 ❌
554 runs  554 ✅ 0 💤 0 ❌

Results for commit edbdb0b.

♻️ This comment has been updated with latest results.

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

Unsupported Windows and PreProvisionOnly inputs currently succeed without Phase 3 semantics.

2 open findings
What changed in this PR

Adds an opt-in Phase 3 provisioning path that delivers only AKSNodeConfig to ANC.

Changes:

  • Adds Phase 3 selection, payload validation, and delivery.
  • Adds AKSNodeConfig normalization and ANC validation.
  • Extends unit tests, E2E scenarios, validators, and documentation.
File Description
pkg/​agent/​datamodel/​types.go Defines the Phase 3 flag contract.
pkg/​agent/​bakerapi_test.go Tests API validation and artifact generation.
pkg/​agent/​baker.go Implements Phase 3 payload generation.
pkg/​agent/​baker_test.go Tests delivery modes and size fallback.
e2e/​scenario/​vmss.go Integrates Phase 3 into VMSS creation.
e2e/​scenario/​validators.go Adds Phase 3 and comparison validation.
e2e/​scenario/​validation.go Registers the comparison validator.
e2e/​scenario/​types.go Clarifies AKSNodeConfig mutation behavior.
e2e/​scenario/​scenario.go Enables Phase 3 in selected scenarios.
e2e/​scenario/​provision.go Converts and validates Phase 3 configuration.
e2e/​scenario/​node_config.go Adjusts NBC-to-AKSNodeConfig conversion.
e2e/​README.md Documents E2E Phase 3 coverage.
aks-node-controller/​README.md Documents Phase 3 and normalization.
aks-node-controller/​pkg/​nodeconfigutils/​validation.go Adds configuration normalization.
aks-node-controller/​pkg/​nodeconfigutils/​validation_test.go Tests normalization and validation.
aks-node-controller/​app.go Validates configs before ANC rendering.
aks-node-controller/​app_test.go Tests ANC rejection and normalization.

🧠 Review effort: Balanced


💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread pkg/agent/baker.go
Comment on lines +270 to 279
func validateScriptlessAKSNodeConfig(config *datamodel.NodeBootstrappingConfiguration) error {
input := strings.TrimSpace(config.AKSNodeConfigJSON)
if input == "" {
return fmt.Errorf("EnableScriptlessAKSNodeConfig requires non-empty AKSNodeConfigJSON")
}
if !json.Valid([]byte(input)) || input[0] != '{' {
return fmt.Errorf("EnableScriptlessAKSNodeConfig requires AKSNodeConfigJSON to be a valid JSON object")
}
return nil
}
Comment on lines +1841 to +1845
// EnableScriptlessAKSNodeConfig enables Phase 3 provisioning using only AKSNodeConfigJSON.
// It takes precedence over EnableScriptlessNBCCSECmd and EnableScriptlessCSECmd:
// no NBC command is rendered or delivered, and ANC does not enter comparison mode.
// Requires a non-empty serialized JSON object. Windows and PreProvisionOnly are unsupported.
EnableScriptlessAKSNodeConfig bool
Copilot AI balanced review requested due to automatic review settings October 10, 2026 16: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.

🟡 Changes recommended

Unsupported mode combinations and prerelease-version normalization can produce invalid provisioning behavior.

4 open findings

🧠 Review effort: Balanced

Comment on lines +55 to +56
if version.GreaterThanEqual(semver.MustParse("1.34.0")) {
delete(flags, "--streaming-connection-idle-timeout")
// EnableScriptlessAKSNodeConfig enables Phase 3 provisioning using only AKSNodeConfigJSON.
// It takes precedence over EnableScriptlessNBCCSECmd and EnableScriptlessCSECmd:
// no NBC command is rendered or delivered, and ANC does not enter comparison mode.
// Requires a non-empty serialized JSON object. Windows and PreProvisionOnly are unsupported.
@aks-node-assistant

Copy link
Copy Markdown
Contributor

AgentBaker Linux gate detective

Run: 185078699
Failed job/stage/task: e2e / Run AgentBaker E2E / LocalDNSHostsPlugin/Ubuntu2604Minimal

Detective summary: Run AgentBaker E2E failed only LocalDNSHostsPlugin/Ubuntu2604Minimal. The scenario reached the cold-start-with-empty-hosts-file check, stopped localdns, waited for teardown, then systemctl start localdns failed after Localdns failed to come online after 60 seconds (timeout).

Likely cause / signature: e2e-localdns-coldstart-empty-hosts-start-timeout - localdns cold-start with empty hosts file timed out before the service came online.

Confidence: High for the signature: failed test result, focused E2E log, timeline, and build report isolate one LocalDNS cold-start failure after prior validation steps passed.

Recommended owner/action: LocalDNS/E2E owner should inspect localdns startup readiness after empty-hosts cold start and whether the phase3 provisioning PR changes affect DNS setup ordering.

Strongest alternative: Shared node/network settling latency is plausible because teardown/startup is timing-sensitive, but the failure is in the deterministic LocalDNS cold-start validation path.

Evidence: build run, failed timeline/test records, focused task log, build report, PR metadata, and wiki tracker.

Wiki: e2e-localdns-coldstart-empty-hosts-start-timeout

// It takes precedence over EnableScriptlessNBCCSECmd and EnableScriptlessCSECmd:
// no NBC command is rendered or delivered, and ANC does not enter comparison mode.
// Requires a non-empty serialized JSON object. Windows and PreProvisionOnly are unsupported.
EnableScriptlessAKSNodeConfig bool

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.

nit: EnableAKSNodeConfig seems cleaner?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reason for choosing EnableScriptless as prefix everywhere was for easy search in aks-rp and other reason is that to keep it similar to previous feature names.

EnableScriptlessCSECmd && EnableScriptlessNBCCSECmd

// ValidateAndNormalizeConfiguration validates and updates provisioning settings in place.
// Producers call it before serialization; ANC calls it before rendering. It is idempotent
// and does not depend on the producer's or node's environment.
func ValidateAndNormalizeConfiguration(cfg *aksnodeconfigv1.Configuration) error {

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.

Why do we need this method?

Ideally, I don't want consumers to update reference to ANC library often.

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.

What the purpose of it? To fail node provision early?

Copilot AI balanced review requested due to automatic review settings October 12, 2026 21:45

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.

🔵 Needs a closer look

Unsupported mode combinations can silently fall back, and prerelease Kubernetes versions retain removed kubelet settings.

4 open findings

🧠 Review effort: Balanced

@aks-node-assistant

Copy link
Copy Markdown
Contributor

AgentBaker Linux gate detective

Run: 185399239
Failed job/stage/task: e2e / Run AgentBaker E2E / phase3 provisioning node-config validation

Detective summary: Run AgentBaker E2E failed 25 scenarios. The first failures were fast node-config validation errors (auth_config.subscription_id missing, then cluster_config.resource_group missing), followed by many VM validation failures reporting expected no env var differences between provision-config and nbc-cmd. This is deterministic in this run, spans multiple OS/SKU scenarios, and lines up with this PR changing phase3 provisioning/node config paths.

Likely cause / signature: e2e-phase3-provision-config-nbc-cmd-env-diff - phase3 provisioning/node-config validation regression.

Confidence: High that this is the failing signature: failed test records, the E2E task log, failed timeline, and PR metadata all point to the same phase3 provisioning/node-config path; medium-high on PR causality because the changed files directly cover ANC/node config and E2E provisioning.

Recommended owner/action: PR owner should reconcile the phase3-only provisioning path so required node-config fields are populated and provision-config/nbc-cmd env validation stays in sync, then rerun the gate after updating the PR.

Strongest alternative: Shared E2E environment drift, but unrelated scenarios passed in the same run and the failure shape is a broad, consistent validation mismatch in code paths touched by the PR rather than random infra timeouts.

Evidence: build run, failed test run 686945796, E2E task log 624, failed timeline records for e2e/Run AgentBaker E2E, PR files touching �ks-node-controller, �2e/scenario, and pkg/agent, and wiki tracker.

Wiki: e2e-phase3-provision-config-nbc-cmd-env-diff

Copilot AI balanced review requested due to automatic review settings October 13, 2026 00:39
@github-actions

Copy link
Copy Markdown
Contributor

Code Coverage

Package Line Rate Health
test 0% ❌
windows 27% ❌
staging_cse_windows Package 1 65% ➖
debug 0% ❌
provisioningscripts 2% ❌
parts_windows Package 1 76% ➖
Summary 39% (1663 / 6838) ❌

@github-actions

Copy link
Copy Markdown
Contributor

Code Coverage

Package Line Rate Health
github.com/Azure/agentbaker/aks-node-controller 72% ➖
github.com/Azure/agentbaker/aks-node-controller/common 100% ✔
github.com/Azure/agentbaker/aks-node-controller/helpers 68% ➖
github.com/Azure/agentbaker/aks-node-controller/parser 88% ✔
github.com/Azure/agentbaker/aks-node-controller/pkg/gpu 100% ✔
github.com/Azure/agentbaker/aks-node-controller/pkg/nodeconfigutils 88% ✔
github.com/Azure/agentbaker/aks-node-controller/utils 0% ❌
github.com/Azure/agentbaker/apiserver 24% ❌
github.com/Azure/agentbaker/cmd 0% ❌
github.com/Azure/agentbaker/cmd/starter 0% ❌
github.com/Azure/agentbaker/fuzz/api 0% ❌
github.com/Azure/agentbaker/hotfix/render-nodecustomdata 0% ❌
github.com/Azure/agentbaker/pkg/agent 76% ➖
github.com/Azure/agentbaker/pkg/agent/datamodel 76% ➖
github.com/Azure/agentbaker/pkg/agent/toggles 0% ❌
github.com/Azure/agentbaker/pkg/vhdbuilder/datamodel 87% ✔
Summary 74% (5624 / 7585) ➖

@github-actions

Copy link
Copy Markdown
Contributor

Code Coverage

Package Line Rate Health
shellspec spec 25% ❌
Summary 25% (3756 / 15137) ❌

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.

🔵 Needs a closer look

Unsupported Windows and pre-provisioning combinations currently fall back silently instead of being rejected.

4 open findings

🧠 Review effort: Balanced

@aks-node-assistant

Copy link
Copy Markdown
Contributor

AgentBaker Linux gate detective

Run: 185430989
Failed job/stage/task: e2e / Run AgentBaker E2E / Ubuntu2204_DisableKubeletServingCertificateRotationWithTags_CustomKubeletConfig

Detective summary: One E2E scenario failed during LocalDNS conntrack rule validation. The validator printed all LocalDNS raw-table NOTRACK rules and counted request=8 response=4 prerouting_response=0, then failed the exact regex check for the PREROUTING 169.254.10.11 TCP dport 53 NOTRACK rule. This repeats an existing LocalDNS NOTRACK validator/rule-order signature.

Likely cause / signature: e2e-localdns-notrack-rule-regex-missing - LocalDNS NOTRACK exact-rule regex validation reports a rule missing even while the expected rules are present in output.

Confidence: High for the signature: failed test result, focused E2E log, timeline, and prior matching wiki row all isolate the same conntrack validation family; medium on root cause because the log suggests exact matcher/ordering sensitivity, but the validator still exits nonzero.

Recommended owner/action: LocalDNS/test owner should review the NOTRACK exact-rule validator against iptables output ordering/format and confirm whether the PREROUTING .11 expectation is still valid for this lane.

Strongest alternative: PR phase3 provisioning changes altered node setup, but the failing check is LocalDNS raw-table validation and matches a prior LocalDNS-specific signature while PR 9746 is not primarily conntrack-focused.

Evidence: build run, failed test run 687293785, E2E task log 624, failed E2E timeline records, PR metadata, prior matching row, and wiki tracker.

Wiki: e2e-localdns-notrack-rule-regex-missing

@awesomenix
Nishchay (awesomenix) merged commit ef20410 into main Oct 13, 2026
41 checks passed
@awesomenix
Nishchay (awesomenix) deleted the nishp/implment/phase3 branch October 13, 2026 18:00
Saewon Kwak (saewoni) added a commit that referenced this pull request Oct 13, 2026
Picks up #9746, #9759 and #9740, which landed while this branch was being
updated.

One conflict, in enableScriptlessCompilation (e2e/scenario/vmss.go). #9746
broadened the gate from usesScriptlessNBCCSECmd to usesScriptlessProvisioning
so it also covers scriptless AKSNodeConfig scenarios; this branch had
restructured the same expression into early returns to add the
ForceScriptlessCompilation override the LocalDNS LPS scenarios need.

Resolved by keeping both: main's broader predicate inside this branch's
early-return form, so the force override still short-circuits the
CustomDataWriteFiles check. usesScriptlessNBCCSECmd remains in use by
validators.go, so nothing is left dangling.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.

4 participants