Skip to content

fix(gpu): preserve customer-installed PIS drivers - #9702

Open
Ben Brady (benjamin-brady) wants to merge 3 commits into
mainfrom
bbrady/pis-preserve-customer-gpu-driver
Open

Ben Brady (benjamin-brady) wants to merge 3 commits into
mainfrom
bbrady/pis-preserve-customer-gpu-driver

Conversation

@benjamin-brady

@benjamin-brady Ben Brady (benjamin-brady) commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

What this PR does / why we need it:

PIS-derived nodes skip basePrep; their nodePrep previously deleted a customer-installed GPU driver. Remove AKS-owned GPU artifacts during the opted-out PIS bake, before customer customization, and skip destructive cleanup on derived nodes.

  • Bake the strict Ubuntu helper into all four Ubuntu source-image configurations rather than sending it in CustomData. Retain CUDA and Grace Blackwell ownership/BOM, residual-artifact, module, and retry checks. Incomplete cleanup fails the bake without writing base_prep.complete; Azure Linux retains distro-specific cleanup.
  • Gate final nodePrep cleanup on basePrep having run in the same execution. Ordinary-node behavior, including the legacy skip tag, remains. Six template-guard lines omit Azure Linux-only AMD code from known non-AzureLinux CustomData, preserving raw baked scripts and unknown/custom images.
  • Exercise customer driver installation after bake, capture, and preservation on a derived T4 node. Reuse the ordinary opt-out scenario to check both absent nvidia-smi and absent loaded NVIDIA modules. Focused GB tests exercise real package selection, exact template consistency, and rejection before teardown on ownership/version/inspection failures.

Contracts and scope: every opted-out Ubuntu PIS bake, including CPU-only pools, requires a new source image containing the helper; absence fails explicitly. Ordinary nodes and derived PIS nodes do not require the helper. Bake opt-out must be explicit in CustomData (EnableNvidia=false / GPU_NODE=false); a legacy tag alone does not request PIS bake cleanup. No new dependency on cached IMDS was added. Old CSEs/captures are not retroactively fixed. GRID mismatch validation is unchanged. This PR does not depend on #9753 or include general CustomData compression changes.

Review cleanup published: three GitHub-verified signed commits, dated 2026-10-28 NZDT, at head cea1cead071770d3d6bbcfbfabe7997d5b15ef88; base 8c4b6950c6601bd509ee8805a62aa6c8c7060ff5 (2026-10-27T14:27:06-07:00, #9919). Production, regression tests, and E2E changes remain separate. Effective diff: +1080/−10 across 25 files. All existing inline threads have individual replies and are resolved; the legacy-tag thread records the contract decision rather than claiming tag-driven bake cleanup was implemented. No new review has been requested.

CustomData: the final traditional Ubuntu 24.04 T4 fixture measures 64,772 gzip bytes / 86,364 Base64 characters, leaving 763 bytes / 1,016 characters under the 65,535/87,380 limits. Phase-1 bake measures 361/484. These synthetic fixtures do not guarantee every customer/custom-cloud configuration fits. The earlier Ubuntu 22.04 measurement was on the previous head, not rerun for this cleanup.

ID Exact validation command Result on the published candidate tree
L1 go test ./pkg/agent -count=1 Passed.
L2 cd e2e && go test ./scenario ./runner -count=1 Passed, including ordinary-node module inspection failure coverage.
L3 go test ./pkg/agent -run '^(TestPISGPU|TestGPUAMA)' -count=1 -v Passed; traditional payload 64,772/86,364, phase-1 361/484.
L4 git diff --check Passed before publication; final committed tree was verified byte-identical to the validated candidate.
L5 ShellSpec command below Passed: 242 examples, 0 failures.
L5: exact focused ShellSpec command
set -o pipefail
mkdir -p .scratch-review-9702-publish-shellspec
docker run --rm -e TMPDIR=/workspace/.scratch-review-9702-publish-shellspec \
  -v "$PWD:/workspace" -w /workspace shellspec-docker --shell bash --format d \
  spec/parts/linux/cloud-init/artifacts/cse_install_ubuntu_gpu_pis_spec.sh \
  spec/parts/linux/cloud-init/artifacts/cse_main_gpu_pis_spec.sh \
  spec/parts/linux/cloud-init/artifacts/cse_install_mariner_spec.sh \
  spec/parts/linux/cloud-init/artifacts/cse_main_disable_modules_spec.sh \
  spec/parts/linux/cloud-init/artifacts/cse_main_pis_reconcile_spec.sh \
  spec/parts/linux/cloud-init/artifacts/cse_config_gpu_spec.sh \
  spec/vhdbuilder/packer/pis_gpu_helper_spec.sh 2>&1 | tail -15
result=$?
rm -rf .scratch-review-9702-publish-shellspec
exit "$result"

Final-head cloud validation is in progress, not yet green. Automatic VHD gate 188061809, general E2E 188061815, Windows E2E 188061823, and default GPU E2E 188061829 were started for this head. A bounded watcher will verify the new 2404gen2containerd image's source, metadata and West US 3 replica, then queue GPU E2E with VHD_BUILD_ID=188061809 and:

scenarioFilter=Name=Ubuntu2404_GPUDriverOptOut_VHDCaching,Name=Ubuntu2404Gen2_GPUNoDriver,Name=Ubuntu2404_GPUA10,Name=Ubuntu2404_NvidiaDevicePluginRunning

This targets PIS opt-out, ordinary opt-out, managed GRID, and device-plugin/workload behavior on the same final PR-built source image. No targeted run result or live Grace Blackwell pass is claimed yet.

Previous-head evidence only: PIS E2E 188034547 passed first attempt on head b447e74197 (2026-10-28 NZDT), using fresh VHD build 188023103, image 1.1793138116.9440. Logs confirmed bake cleanup, customer installation, capture, derived basePrep skip, and installer/module/version/nvidia-smi validation. All 39 applicable checks passed on that head. Its ordinary GPU run used a main-gallery image, so it is not final-image non-PIS proof.

Which issue(s) this PR fixes:

Fixes AB#39923593 (Don't delete user installed GPU drivers); depends on AB#39198532.

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

github-actions Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Windows Unit Test Results

  3 files   18 suites   50s ⏱️
563 tests 563 ✅ 0 💤 0 ❌
585 runs  585 ✅ 0 💤 0 ❌

Results for commit cea1cea.

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

Copilot review overview

🟡 Changes recommended

The E2E sentinel can survive destructive cleanup and incorrectly report that customer drivers were preserved.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Preserves customer-installed GPU drivers on PIS-derived nodes by moving managed-driver cleanup to image preparation.

Changes:

  • Adds verified distro-specific bake cleanup and success-only completion markers.
  • Restricts destructive node cleanup to runs that execute basePrep.
  • Adds ShellSpec checks and a GPU VHD-caching scenario.
File Description
spec/​parts/​linux/​cloud-init/​artifacts/​cse_main_gpu_pis_spec.sh Tests cleanup across PIS phases.
spec/​parts/​linux/​cloud-init/​artifacts/​cse_install_ubuntu_spec.sh Tests Ubuntu cleanup verification.
spec/​parts/​linux/​cloud-init/​artifacts/​cse_install_mariner_spec.sh Tests cache cleanup verification.
parts/​linux/​cloud-init/​artifacts/​ubuntu/​cse_install_ubuntu.sh Verifies driver teardown before capture.
parts/​linux/​cloud-init/​artifacts/​mariner/​cse_install_mariner.sh Verifies bake-time cache removal.
parts/​linux/​cloud-init/​artifacts/​cse_start.sh Marks only successful image preparation.
parts/​linux/​cloud-init/​artifacts/​cse_main.sh Gates cleanup by provisioning phase.
e2e/​scenario/​types.go Adds a post-basePrep callback.
e2e/​scenario/​scenario.go Registers GPU driver-preservation scenario.
e2e/​scenario/​provision.go Runs callback and installs sentinel.

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

Comment thread e2e/scenario/provision.go Outdated
Copilot AI balanced review requested due to automatic review settings October 5, 2026 01:57

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 review overview

🔵 Needs a closer look

Cross-distro GPU cleanup and PIS compatibility need final human review while the latest integration gates are reported as pending.

Review effort: Balanced
Findings: None

Resolved since last review (1)

Copilot AI balanced review requested due to automatic review settings October 5, 2026 03:02

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 review overview

🟡 Changes recommended

Cleanup verification rejects opted-out Grace Blackwell PIS bakes because their package-installed drivers are not removed.

Review effort: Balanced
Findings: 1 High severity

Open (1)

Comment thread parts/linux/cloud-init/artifacts/ubuntu/cse_install_ubuntu.sh Outdated
@benjamin-brady
Ben Brady (benjamin-brady) force-pushed the bbrady/pis-preserve-customer-gpu-driver branch from 2cbf2cf to d9ddd90 Compare October 5, 2026 04:52
Copilot AI balanced review requested due to automatic review settings October 5, 2026 09:58

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 review overview

🔵 Needs a closer look

Cross-distro destructive GPU cleanup changes need human review while the reported CI gates remain failed or pending.

Review effort: Balanced
Findings: 1 High severity

Open (1)

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

Copilot review overview

🟡 Changes recommended

Successful legacy Grace Blackwell teardown leaves subsequent basePrep retries unable to complete after a later failure.

Review effort: Balanced
Findings: 1 High severity

Open (1)
Resolved since last review (1)

Comment thread parts/linux/cloud-init/artifacts/ubuntu/cse_install_ubuntu.sh Outdated
@aks-node-assistant

Copy link
Copy Markdown
Contributor

AgentBaker Linux gate detective

Run: 184124893
Failed job/stage/task: e2e / Run AgentBaker E2E / Run AgentBaker E2E

Detective summary: E2E finished with VHDCaching scenarios failing only in cleanup while deleting gallery image versions; ARM returned ScopeLocked for resource group abe2e-westus3 after validation had completed.

Likely cause / signature: e2e-vhdcaching-gallery-image-delete-scopelocked - VHDCaching scenario validation passed, but cleanup failed deleting SIG gallery image versions because resource group abe2e-westus3 was scope-locked.

Confidence: High for E2E cleanup/SIG resource-group lock infra flake.

Recommended owner/action: E2E/VHD infra owners should remove or avoid the abe2e-westus3 scope lock for VHDCaching cleanup, or make cleanup tolerate locked resources without failing completed validation.

Strongest alternative: PR 9702 changes E2E cleanup/provisioning code, so a cleanup regression is plausible; however, the same locked resource-group signature also appears on unrelated PR 9699.

Evidence: build run, failed timeline records, focused E2E task log, build metadata, PR changed files, and wiki tracker.

Wiki: e2e-vhdcaching-gallery-image-delete-scopelocked

Copilot AI balanced review requested due to automatic review settings October 5, 2026 11:14

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 review overview

🔵 Needs a closer look

Production driver teardown spans current and legacy images, while current-head CI and strengthened real-driver PIS validation remain pending.

Review effort: Balanced
Findings: 1 High severity

Open (1)

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

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 review overview

🔵 Needs a closer look

Boot-critical teardown across distributions and legacy images warrants human review, and the latest GPU CI gate is reported as pending.

Review effort: Balanced
Findings: 1 High severity

Open (1)

@benjamin-brady

Copy link
Copy Markdown
Member Author

The real-driver PIS scenario now passes in CI on the default westus3 gallery: GPU build 184188675, Ubuntu2404_GPUDriverOptOut_VHDCaching, attempt 1, 21m57s. Customer RunCommand installed NVIDIA 580.159.04 on the bake Tesla T4 with managed installation disabled. Image capture succeeded; the derived node matched driver version, binary/module hashes and passed GPU functionality validation. Cleanup callbacks completed without errors.

The overall GPU gate remains red solely because Ubuntu2404_GPU_RTXPro6000_GridV20 exhausted all three attempts with Azure AllocationFailed in southeastasia. No builds were cancelled or manually requeued.

Copilot AI balanced review requested due to automatic review settings October 7, 2026 23:14
@benjamin-brady
Ben Brady (benjamin-brady) requested a review from a team as a code owner October 7, 2026 23:14

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.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

6 open findings
1 resolved since last review

🧠 Review effort: Lite


Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.

Comment thread e2e/scenario/vmss.go Outdated
Comment thread parts/linux/cloud-init/artifacts/cse_start.sh
Comment thread parts/linux/cloud-init/artifacts/ubuntu/cse_install_ubuntu.sh Outdated
Comment thread parts/linux/cloud-init/artifacts/ubuntu/cse_install_ubuntu.sh Outdated
Comment thread spec/parts/linux/cloud-init/artifacts/cse_install_ubuntu_spec.sh Outdated
Comment thread spec/parts/linux/cloud-init/artifacts/cse_main_gpu_pis_spec.sh
@benjamin-brady

Copy link
Copy Markdown
Member Author

Tim Wright (@timmy-wright) Nishchay (@awesomenix) could you review this for today’s release cut? I’ve removed the general CustomData compression changes and slimmed the diff from 1,423 to 893 changed lines, keeping both CUDA and Grace Blackwell support.

The fix cleans AKS-owned drivers during the PIS bake, before customer scripts, and preserves customer drivers on derived nodes. Important compatibility point: opted-out Ubuntu PIS bakes, including CPU-only pools, require a new source image containing the cleanup helper.

Local regression/scenario tests pass. Fresh-image GPU PIS E2E is still pending, so this is a request to review in parallel—not a claim that it is ready to merge. The PR description has the exact validation and remaining gate.

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

Destructive GPU cleanup and the new source-image dependency need human sign-off, with fresh-image preservation E2E validation still pending.

No open issues 🎉

Review effort: Balanced

@timmy-wright

Copy link
Copy Markdown
Contributor

Review: Preserve customer-installed PIS GPU drivers

What is good

This PR fixes the ownership boundary, not just the deletion symptom. Cleaning AKS-owned artifacts before customer customization, then preserving the resulting driver on derived nodes, is the right lifecycle model.

  • Destructive operations are conservative. Grace Blackwell cleanup verifies package versions against the BOM and checks configuration ownership before removal. Unexpected state fails the bake rather than guessing what is safe to delete.
  • Recovery is considered. The pending marker preserves teardown provenance across an initramfs failure. base_prep.complete is written only after successful provisioning, so a failed bake is not marked complete.
  • Normal provisioning remains recognizable. The same-execution BASE_PREP_RAN guard retains ordinary-node cleanup while excluding PIS-derived nodes.
  • The E2E scenario models the customer journey. It installs a real driver after basePrep, captures the image, and validates the derived node. Checking the staged installer as well as the loaded module and nvidia-smi catches destructive cleanup that a working driver alone would not reveal.
  • The implementation respects operational constraints. The helper stays out of CustomData, distro-specific cleanup remains separate, and the PR explicitly documents compatibility requirements and outstanding validation.

Review outcome

Reviewed #9702 at 30226157252b762134fde7c712c06f40bfb46e9b on 2026-10-23, covering reliability, performance, readability, and software design.

No confirmed current reliability or performance defect was found. There is one blocking validation gate below. The design recommendations are non-blocking; the final readability comment is a nitpick.

The documented source-image requirement is an intentional compatibility change, not an additional finding: opted-out Ubuntu PIS bakes, including CPU-only pools, require a source VHD containing the new helper. Ordinary and derived nodes do not require it. Release sequencing must respect that requirement.

Comments, ordered by importance

1. Blocking: Verify the complete lifecycle with a fresh branch-built VHD

Where: PR validation evidence; Ubuntu2404_GPUDriverOptOut_VHDCaching in e2e/scenario/scenario.go:3109-3140.

The PR description still explicitly marks fresh-image E2E validation as pending. The local tests pass, but most destructive cleanup operations are stubbed. A green GPU pipeline check alone does not establish that the run exercised the new baked helper.

Before merge, attach a successful run using a branch-built 2404gen2containerd source image available in westus3. Confirm that the selected image resource ID matches the branch-build metadata, then verify the bake, customer installation, capture, derived-node driver checks, and cleanup in the run logs. A missing-image skip is not a pass.

Why blocking: This is the main changed lifecycle, and it combines destructive cleanup with two VM runs and an image capture. This is a verification gate, not a claim that the implementation is broken. Clear it when the evidence is available; it does not inherently require a code change.

2. Non-blocking design recommendation: Keep configuration ownership knowledge synchronized

Where: cse_install_ubuntu_gpu.sh:141-156.

The expected configuration, including comments, is copied from the authoritative files under parts/linux/cloud-init/artifacts/ubuntu/gb/. This duplicates ownership knowledge rather than merely repeating similar code.

Risk: A future template edit can leave the cleanup verifier stale. Even a comment-only edit to nvidia-peermem.conf would then make legitimate AKS configuration fail the exact comparison and block a PIS bake.

Recommendation: Keep exact ownership verification, but tie its expected content to the authoritative templates. A focused consistency test is the smallest interim safeguard. Build-time generation is an option if this duplication continues to grow.

Trade-off: A consistency test retains duplication but catches drift cheaply. Generation removes manual synchronization at the cost of additional build plumbing.

Evidence grade: Weak for the general DRY prescription, which is primarily practitioner consensus; the duplicated content is directly observable. This is not a demonstrated failure in the current revision.

3. Non-blocking design recommendation: Make the cleanup state and dependency contract explicit

Where: cse_install_ubuntu_gpu.sh:112-259.

Fresh cleanup, interrupted cleanup, and already-completed cleanup are represented through combinations of files, booleans, and missing configuration. Understanding the allowed transitions requires tracing both the orchestrator and the teardown function. The helper also relies on previously sourced distro cleanup functions and globals.

Risk: A later change can preserve one path while accidentally breaking retries or legacy-layout handling.

Recommendation: Add a concise contract describing the entry states, the pending marker's lifetime, required sourced functions/globals, and successful postconditions. Remove the unused bom parameter from cleanUpGraceBlackwellGPUDriver. Keep layout selection in the orchestrator; do not introduce a generic state-machine framework.

Trade-off: This makes the existing design easier to audit without multiplying abstractions. It does not remove the safety complexity, which is justified.

Evidence grade: Moderate for control-flow and naming guidance; its applicability to shell is indirect, not proof that a particular refactor would reduce defects.

4. Non-blocking design recommendation: Separate inspection failure from a positive result

Where: cse_install_ubuntu_gpu.sh:3-54.

The predicates return success both when artifacts remain and when inspection fails. The package predicate also accepts an allowlist, despite its name suggesting a general presence check, and writes inspection-error text to the same output channel as package names.

Risk: A future caller could interpret "could not inspect" as "found a package," or misunderstand what the allowlist excludes. The current callers remain conservative; this is an interface-design concern.

Recommendation: At minimum, document the return and output contracts. If changing the interface, distinguish found, absent, and inspection-failed outcomes, send diagnostics to stderr, and explicitly retain fail-closed behavior at every caller.

Trade-off: Distinct outcomes add some branching but make the safety policy explicit rather than hiding it inside a presence query.

Evidence grade: Moderate for aligning names and contracts with behavior. This does not justify weakening the existing failure handling.

5. Nitpick: Make the cleanup eligibility rules read like the lifecycle policy

Where: cse_main.sh:410-419, cse_main.sh:659-662, and cse_install_ubuntu_gpu.sh:5.

The compound shell conditions are valid, but nested command groups and mixed ||/&& chains take unnecessary effort to audit. The nodePrep comment also describes the old GPU conditions without explaining the new same-execution restriction.

Recommendation: Prefer explicit if blocks for these safety decisions. Initialize BASE_PREP_RAN=false beside the phase dispatcher and explain that the guard prevents deletion of customer drivers on PIS-derived nodes.

Trade-off: A few more lines in exchange for more direct control flow. No behavioral change or new helper abstraction is needed.

Evidence grade: Moderate for control-flow clarity. This is a readability preference, not a demonstrated bug, and should not delay merge.

Validation performed during review

Check Result
`go test ./pkg/agent -run '^(TestPISGPU TestGPUAMA)' -count=1 -v`
cd e2e && go test ./scenario -count=1 Passed
Focused ShellSpec: PIS phase dispatch, Ubuntu cleanup, Mariner installer, Packer helper 68 examples, 0 failures
shellcheck --shell=bash parts/linux/cloud-init/artifacts/ubuntu/cse_install_ubuntu_gpu.sh Passed
git diff --check Passed on the reviewed working tree

The selected ShellSpec suites contain 4 phase-dispatch examples, 3 Ubuntu-cleanup examples, 59 Mariner-installer examples, and 2 Packer-helper examples. These results establish local regression coverage, not a live fresh-image preservation pass or measured provisioning performance.

The inspected Linux E2E build, 187241126, reported an Azure Linux iptables validation failure rather than a GPU cleanup failure. That observation does not clear the fresh-image validation gate above.

@timmy-wright Tim Wright (timmy-wright) 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.

The lifecycle ownership boundary and conservative cleanup checks are good. Full review report: #9702 (comment)

The inline comments below are non-blocking design recommendations and one nitpick. The report separately identifies fresh branch-built VHD E2E evidence as the blocking validation gate; this review does not assert a current correctness defect.

Comment thread parts/linux/cloud-init/artifacts/ubuntu/cse_install_ubuntu_gpu.sh
Comment thread parts/linux/cloud-init/artifacts/ubuntu/cse_install_ubuntu_gpu.sh
Comment thread parts/linux/cloud-init/artifacts/ubuntu/cse_install_ubuntu_gpu.sh
Comment thread parts/linux/cloud-init/artifacts/cse_main.sh
Ben Brady (benjamin-brady) added a commit that referenced this pull request Oct 27, 2026
Move strict Ubuntu cleanup into a VHD-baked helper so traditional CustomData stays under its size limit. Fail closed before customer customization; do not clean customer drivers on PIS-derived nodes.

Refs #9702

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@benjamin-brady
Ben Brady (benjamin-brady) force-pushed the bbrady/pis-preserve-customer-gpu-driver branch from 3022615 to d285aa8 Compare October 27, 2026 19:42
Copilot AI balanced review requested due to automatic review settings October 27, 2026 19:42

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

Tag-based GPU opt-out bypasses cleanup in both PIS phases, leaving AKS-prebaked drivers and caches on derived nodes.

1 open issue

Review effort: Balanced

Comment thread parts/linux/cloud-init/artifacts/cse_main.sh
Ben Brady (benjamin-brady) added a commit that referenced this pull request Oct 27, 2026
Move strict Ubuntu cleanup into a VHD-baked helper so traditional CustomData stays under its size limit. Fail closed before customer customization; do not clean customer drivers on PIS-derived nodes.

Refs #9702

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@benjamin-brady
Ben Brady (benjamin-brady) force-pushed the bbrady/pis-preserve-customer-gpu-driver branch from d285aa8 to b447e74 Compare October 27, 2026 21:38
Copilot AI balanced review requested due to automatic review settings October 27, 2026 21: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.

🔵 Needs a closer look

The destructive cleanup lifecycle needs human review, and fresh-image GPU validation remains pending after the Packer rebase.

2 open issues

Review effort: Balanced

Comment thread parts/linux/cloud-init/artifacts/ubuntu/cse_install_ubuntu_gpu.sh
Move strict Ubuntu cleanup into a VHD-baked helper so traditional CustomData stays under its size limit. Fail closed before customer customization; do not clean customer drivers on PIS-derived nodes.

Refs #9702

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Exercise a customer T4 installation after basePrep using a branch-built image; validate the installed driver on the derived VM.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@benjamin-brady
Ben Brady (benjamin-brady) force-pushed the bbrady/pis-preserve-customer-gpu-driver branch from b447e74 to cea1cea Compare October 28, 2026 00:45
Copilot AI balanced review requested due to automatic review settings October 28, 2026 00:45
@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
github.com/Azure/agentbaker/aks-node-controller 73% ➖
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 89% ✔
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 35% ❌
github.com/Azure/agentbaker/pkg/agent 78% ➖
github.com/Azure/agentbaker/pkg/agent/datamodel 77% ➖
github.com/Azure/agentbaker/pkg/agent/toggles 0% ❌
github.com/Azure/agentbaker/pkg/vhdbuilder/datamodel 87% ✔
Summary 75% (6026 / 7992) ➖

@github-actions

Copy link
Copy Markdown
Contributor

Code Coverage

Package Line Rate Health
shellspec spec 29% ❌
Summary 29% (4744 / 16405) ❌

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

Grace Blackwell teardown needs ARM64 validation by a GPU/image owner because live E2E evidence covers only T4/CUDA, leaving GB package purging, service shutdown, and retry recovery tested only with mocks.

No open issues 🎉

2 resolved since last review

Review effort: Balanced

done
}

cleanUpGPUDriversForBasePrep() {

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.

I'm not sure I see the value of this method. All it seems to do is wrap the "cleanUpGPUDrivers" with additional logging and failure modes. Can't we just use the "cleanUpGPUDrivers" without any changes instead?

[ -n "${package}" ] && purge_packages+=("${package}")
done <<< "${packages}"

for service in nvidia-device-plugin nvidia-dcgm-exporter nvidia-dcgm nvidia-imex nvidia-persistenced; do

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 wasn't this code being run before? It seems like we're trying to do more of a cleanup than earlier instead of doing the same cleanup - but moving it from node prep into base prep.

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.

5 participants