Skip to content

test(e2e): add CVM E2Es to AgentBaker E2Es - #9752

Open
Zachary (zachary-bailey) wants to merge 46 commits into
mainfrom
zb/CVMABE2E
Open

Zachary (zachary-bailey) wants to merge 46 commits into
mainfrom
zb/CVMABE2E

Conversation

@zachary-bailey

@zachary-bailey Zachary (zachary-bailey) commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

This PR adds AgentBaker-side implementation for adding CVM E2Es

Which issue(s) this PR fixes:

Currently no CVM E2Es

Fixes #

Copilot AI balanced review requested due to automatic review settings October 12, 2026 21:11
@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Windows Unit Test Results

  3 files   18 suites   1m 11s ⏱️
563 tests 563 ✅ 0 💤 0 ❌
585 runs  585 ✅ 0 💤 0 ❌

Results for commit e0fd2a2.

♻️ 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

The TDX scenario uses an NVMe-only SKU with a gallery definition that lacks NVMe support.

2 open findings
What changed in this PR

Adds AgentBaker E2E coverage for confidential VM images across Ubuntu and Azure Linux.

Changes:

  • Registers SEV-SNP and TDX CVM scenarios.
  • Configures VMSS confidential-computing security settings.
  • Adds CVM image definitions, filtering, and unit tests.
File Description
e2e/​scenario/​types.go Adds the CVM scenario tag.
e2e/​scenario/​scenario_cvm.go Defines CVM scenarios and VMSS configuration.
e2e/​scenario/​scenario_cvm_test.go Tests CVM definitions and security settings.
e2e/​runner/​filter_test.go Verifies CVM tag filtering.
e2e/​config/​vhd.go Registers CVM gallery images.

🧠 Review effort: Balanced


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

Comment thread e2e/scenario/scenario_cvm.go
Comment thread e2e/scenario/scenario_cvm_test.go
Copilot AI balanced review requested due to automatic review settings October 13, 2026 15:20

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.

🟢 Approval recommended

The CVM scenarios consistently configure their image, VM size, security profile, region, and required NVMe placement.

2 open findings

🧠 Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 13, 2026 18:13

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

The live Azure CVM SKU, security-profile, regional-capacity, and release-pipeline integration requires final human validation.

2 open findings

🧠 Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 13, 2026 19:24
@aks-node-assistant

Copy link
Copy Markdown
Contributor

AgentBaker Linux gate detective

Run: 185565566
Failed job/stage/task: e2e / Run AgentBaker E2E / Ubuntu2204_ScriptlessCSECmd_Hotfix LocalDNS NOTRACK validation

Detective summary: One E2E scenario failed during LocalDNS conntrack validation. The raw-table validation had the expected rule counts (request=8 response=4 prerouting_response=0) but failed an exact matcher for an OUTPUT 169.254.10.11 TCP source-port 53 NOTRACK rule. This is another occurrence of the existing repair-linked LocalDNS NOTRACK signature.

Likely cause / signature: e2e-localdns-notrack-rule-regex-missing - recurring LocalDNS NOTRACK exact-rule validator sensitivity.

Confidence: High: failed test record, E2E task log, timeline, and prior repair-linked row all isolate the same LocalDNS validation family.

Recommended owner/action: Repair #40133693 tracks LocalDNS/E2E owner follow-up; PR owner likely does not need a CVM change for this failure.

Strongest alternative: CVM E2E PR change caused node validation fallout, but the fatal assertion is LocalDNS-specific and recurs across unrelated PRs.

Evidence: build run, failed test run 689181656, E2E task log 624, failed timeline, PR metadata, repair #40133693, and wiki tracker.

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

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

Specialized CVM artifacts are routed into a VMSS flow that supplies an unsupported OS profile, causing the new E2Es to fail before provisioning.

3 open findings

🧠 Review effort: Balanced

Comment thread .pipelines/.vsts-vhd-builder-release.yaml Outdated
Copilot AI balanced review requested due to automatic review settings October 13, 2026 20:38

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

CVM VMSS creation and specialized-image selection contain provisioning blockers.

5 open findings
Previously missed (1)

In code that hasn't changed since last review

Medium severity Confidential SKUs incorrectly enable host encryption

e2e/​scenario/​scenario_cvm.go:107

🔴 High Risk — 🏗️ Architecture: Standard_DC2ads_v5 and Standard_DC2eds_v6 are confidential-compute SKUs that do not support host encryption; CVM configurations use the confidential disk security profile instead. Sending EncryptionAtHost=true makes VMSS creation fail before node validation. Omit this field (or set it to false) and update the assertion accordingly.

🧠 Review effort: Balanced

Comment thread e2e/config/vhd.go Outdated
Comment thread e2e/config/vhd.go Outdated
Comment on lines +380 to +382
builderImage := i
builderImage.Name = i.vhdBuilderGalleryImageName()
vhd, err := Azure.LatestSIGImageVersionByTag(ctx, &builderImage, Config.SIGVersionTagName, Config.SIGVersionTagValue, location)
Copilot AI balanced review requested due to automatic review settings October 13, 2026 21:08

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

The E2E metadata resolves specialized CVM images that cannot accept the VMSS OS profile and custom data required for provisioning.

4 open findings
1 resolved since last review

🧠 Review effort: Balanced

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.

Copilot AI balanced review requested due to automatic review settings October 19, 2026 16: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.

🔵 Needs a closer look

Gallery publication fails when the source region is outside westus because replication targets omit that region.

21 open issues

And 1 more that still need to be addressed.

1 previously missed issue

In code that hasn't changed since last review

Medium severity Include source region in Azure image target regions

vhdbuilder/​packer/​publish-generalized-cvm-if-required.sh:92

🟡 Medium Risk — 🔧 Script Logic: When source_location is outside westus, Azure rejects image-version creation because the source region must be included in the target regions. Here --location uses source_location, but --target-regions contains only westus, so generalized CVM publication fails for those builds. Include both regions, deduplicating when the source is already westus.

2 resolved since last review

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 19, 2026 19:55

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

Missing publication on non-prefetch paths and inconsistent VM-size capability checks can fail builds and CVM provisioning.

22 open issues

And 2 more that still need to be addressed.

1 previously missed issue

In code that hasn't changed since last review

Medium severity CVM VM size mismatch causes incorrect NVMe capability detection

e2e/​scenario/​scenario_cvm.go:96

🟡 Medium Risk — 🏗️ Architecture: This changes the bootstrap VM size but leaves Runtime.VMSize at the global default. prepareAKSNode uses that default for capability checks and can set UseNVMe=true before applying the CVM VMSS override (provision.go:362–381). With an NVMe-capable global SKU, the SNP scenarios therefore request NvmeDisk placement for their SCSI-based Standard_DC2ads_v5 instances (vmss.go:596–603), preventing VM creation. Resolve the scenario's CVM size before capability detection and use it consistently for runtime, bootstrap, and VMSS settings.

Review effort: Balanced

Comment thread .pipelines/scripts/create-e2e-vhd-metadata.sh Outdated

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.

Comment on lines +87 to +92
az sig image-version create "${version_args[@]}" \
--location "${source_location}" \
--os-vhd-uri "${SOURCE_VHD_URI}" \
--os-vhd-storage-account "${source_storage_id}" \
--target-regions westus \
--tags "${version_tags[@]}" >/dev/null
Comment on lines +85 to +86
wait "${gallery_pid}" || echo "##vso[task.logissue type=warning]Generalized CVM gallery publication failed (exit $?)"
return "${storage_status}"

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

Unresolved SKU selection and shell-validation issues can prevent CVM provisioning and fail validation.

22 open issues

And 2 more that still need to be addressed.

2 previously missed issues

In code that hasn't changed since last review

Medium severity Propagate scenario VM size into runtime capability checks

e2e/​scenario/​scenario_cvm.go:96

🟡 Medium Risk — 🏗️ Architecture: This sets the bootstrap configuration's VM size, but Runtime.VMSize still holds the global --vm-sku value (provision.go:262). Capability checks at provision.go:362-381 therefore inspect a different SKU. With an NVMe-capable global SKU, they overwrite UseNVMe=false for the SNP scenarios, and vmss.go:596-603 requests NVMe ephemeral-disk placement on the selected SCSI Standard_DC2ads_v5 VM, preventing provisioning. Propagate the scenario's selected VM size into the runtime before capability checks, keeping the runtime, bootstrap configuration, and VMSS SKU consistent.

Medium severity Suppress SC3010 for Bash-only spec

spec/​vhdbuilder/​packer/​publish_generalized_cvm_spec.sh:2

🟡 Medium Risk — 🔧 Script Logic: The new [[ ... ]] checks at lines 22, 39, and 40 fail the POSIX validation pass. .pipelines/scripts/verify_shell.sh:101-104 includes this spec and explicitly runs ShellCheck with --shell=sh and SC3010 enabled, overriding shell=bash. Suppress SC3010 for this intentionally Bash-only spec so make validate-shell passes; the repository already uses this suppression in spec/vhdbuilder/packer/ensure_sig_vhd_exists_spec.sh:112.

1 resolved since last review

Review effort: Balanced

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

Publication excludes required source-region replicas, and the new prefetch conditional conflicts with mandatory shell validation.

23 open issues

And 3 more that still need to be addressed.

1 previously missed issue

In code that hasn't changed since last review

Medium severity Include source region in image replication targets

vhdbuilder/​packer/​publish-generalized-cvm-if-required.sh:92

🟡 Medium Risk — 🔧 Script Logic: When the Image Builder output is outside westus, this creates the image version in ${source_location} but excludes that region from its replication targets. Azure Compute Gallery requires the source region in --target-regions, so publication fails, generalized metadata is omitted, and prefetch resources remain allocated for retry. Include both ${source_location} and westus, deduplicating when they match.

Review effort: Balanced

Comment thread vhdbuilder/prefetch/scripts/optimize.sh Outdated

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.

Comment thread spec/vhdbuilder/packer/publish_generalized_cvm_spec.sh Outdated

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.

--location "${source_location}" \
--os-vhd-uri "${SOURCE_VHD_URI}" \
--os-vhd-storage-account "${source_storage_id}" \
--target-regions "${PACKER_BUILD_LOCATION}" \

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.

Comment on lines +95 to +99
BootstrapConfigMutator: func(_ *Cluster, nbc *datamodel.NodeBootstrappingConfiguration) {
nbc.AgentPoolProfile.VMSize = vmSize
},
VMConfigMutator: func(vmss *armcompute.VirtualMachineScaleSet) {
configureConfidentialVM(vmss, vmSize, securityEncryptionType)

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.


copy_optimized_vhd "${artifact_uri}" &
storage_pid=$!
copy_optimized_vhd_to_packer_gallery "${artifact_uri}" &
@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 73% ➖
Summary 38% (1652 / 6834) ❌

@github-actions

Copy link
Copy Markdown
Contributor

Code Coverage

Package Line Rate Health
shellspec spec 28% ❌
Summary 28% (4507 / 16005) ❌

@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 77% ➖
github.com/Azure/agentbaker/pkg/agent/datamodel 78% ➖
github.com/Azure/agentbaker/pkg/agent/toggles 0% ❌
github.com/Azure/agentbaker/pkg/vhdbuilder/datamodel 87% ✔
Summary 74% (5660 / 7595) ➖

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

The publication and readiness flow lacks required ShellSpec coverage, while failures can cause E2Es to skip rather than detect regressions.

25 open issues

And 5 more that still need to be addressed.

1 previously missed issue

In code that hasn't changed since last review

Medium severity Add ShellSpec coverage for publication and readiness retries

vhdbuilder/​packer/​publish-generalized-cvm-if-required.sh:97

🟡 Medium Risk — 🧪 Test Coverage: The new publication/readiness flow has no ShellSpec coverage. Add mocked cases for CLI exit code 3 followed by a successful retry, other CLI errors, successful replication, failed replication, and timeout. Assert both retry behavior and exit status, with controlled polling so tests do not wait in real time. Publication failures become warnings in optimize.sh, and metadata can omit the image, so E2Es may skip instead of detecting regressions here. Follow the mocking pattern in spec/vhdbuilder/packer/ensure_sig_vhd_exists_spec.sh; AGENTS.md:62–65 requires ShellSpec testing.

Review effort: Balanced

This branch has not been deployed

No deployments
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