Skip to content

feat: add MIG profile layout configuration - #9081

Open
karenychen wants to merge 5 commits into
mainfrom
codex/mig-profile-layout-contract
Open

feat: add MIG profile layout configuration#9081
karenychen wants to merge 5 commits into
mainfrom
codex/mig-profile-layout-contract

Conversation

@karenychen

@karenychen karenychen commented Jul 30, 2026

Copy link
Copy Markdown

What this PR does

Adds the inert AgentBaker contract plumbing for an ordered MIG execution plan:

  • NodeBootstrappingConfiguration.MIGProfileLayout []string
  • GpuConfig.mig_profile_layout (field 9)
  • NVIDIA_MIG_PROFILE_LAYOUT in classic CSE and aks-node-controller
  • focused tests proving order and duplicates are preserved

Deliberate split boundary

This PR does not change mig-partition.sh, activate partitioning for layout-only input, or add GPU e2e scenarios. MIG_NODE remains driven by the legacy GPUInstanceProfile until the follow-up runtime PR lands. This prevents the existing script from being started with an empty legacy scalar while RP begins populating the new field.

After this merges, a second PR will atomically:

  • treat either MIGProfileLayout or legacy GPUInstanceProfile as a MIG node
  • make a non-empty layout authoritative in mig-partition.sh
  • retain legacy uniform expansion
  • propagate both NVIDIA command failures
  • add ShellSpec and GPU e2e coverage

Supersedes #8869.

Validation

  • go test ./pkg/agent/... -count=1
  • go test ./parser/... -count=1 (aks-node-controller)
  • go test -run '^$' ./... (e2e compile)
  • buf lint
  • buf breaking against Azure/AgentBaker/main
  • focused ShellCheck for changed shell files
  • cse_config_spec.sh: 145 examples, 0 failures

make generate regenerated Go test data successfully, then the repository-wide POSIX ShellCheck phase hit the existing SC3014 baseline in unrelated scripts.

@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

The latest Buf updates on your PR. Results from workflow Buf CI / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedJul 30, 2026, 9:17 PM

@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Windows Unit Test Results

  3 files   11 suites   52s ⏱️
381 tests 381 ✅ 0 💤 0 ❌
384 runs  384 ✅ 0 💤 0 ❌

Results for commit 479c574.

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

Pull request overview

Adds “layout-only” contract plumbing for an ordered NVIDIA MIG partition execution plan across the classic AgentBaker path and the aks-node-controller path, without changing runtime partitioning behavior yet (keeps MIG_NODE driven by legacy GPUInstanceProfile).

Changes:

  • Adds NodeBootstrappingConfiguration.MIGProfileLayout []string and exposes it to templates as NVIDIA_MIG_PROFILE_LAYOUT (comma-joined, order/duplicates preserved).
  • Extends aks-node-controller GPU proto contract with repeated string mig_profile_layout = 9 and propagates it into the generated CSE env.
  • Adds focused unit tests validating order + duplicates are preserved and that layout-only input does not flip MIG_NODE yet.

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pkg/agent/variables.go Adds a MIG layout variable to the CSE variables map (currently unused by templates).
pkg/agent/datamodel/types.go Adds MIGProfileLayout []string to NodeBootstrappingConfiguration.
pkg/agent/baker.go Adds GetMIGProfileLayout template func (comma-joins layout).
pkg/agent/baker_test.go Adds test ensuring layout is propagated but MIG_NODE remains false.
parts/linux/cloud-init/artifacts/cse_config.sh Writes NVIDIA_MIG_PROFILE_LAYOUT into mig-partition systemd drop-in.
parts/linux/cloud-init/artifacts/cse_cmd.sh Exports NVIDIA_MIG_PROFILE_LAYOUT in classic CSE env vars.
aks-node-controller/proto/README.md Documents the new env var in GPUConfig field mapping table.
aks-node-controller/proto/aksnodeconfig/v1/gpu_config.proto Adds mig_profile_layout (field 9) to GPUConfig proto.
aks-node-controller/pkg/gen/aksnodeconfig/v1/gpu_config.pb.go Updates generated Go bindings for the new proto field.
aks-node-controller/parser/parser.go Populates NVIDIA_MIG_PROFILE_LAYOUT from proto into CSE env.
aks-node-controller/parser/parser_test.go Adds test verifying layout env propagation and MIG_NODE remains false.
Files not reviewed (1)
  • aks-node-controller/pkg/gen/aksnodeconfig/v1/gpu_config.pb.go: Generated file

Comment thread parts/linux/cloud-init/artifacts/cse_config.sh
Comment thread pkg/agent/variables.go
Copilot AI review requested due to automatic review settings July 30, 2026 21:16

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 10 out of 11 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • aks-node-controller/pkg/gen/aksnodeconfig/v1/gpu_config.pb.go: Generated file
Comments suppressed due to low confidence (2)

parts/linux/cloud-init/artifacts/cse_config.sh:919

  • This change introduces new behavior in ensureMigPartition() (writing NVIDIA_MIG_PROFILE_LAYOUT into the systemd drop-in), but there is no ShellSpec coverage for ensureMigPartition in spec/parts/linux/cloud-init/artifacts/cse_config_spec.sh. Given the repo’s convention of adding ShellSpec coverage for shell script changes in parts/linux/, please add a focused test that asserts the generated drop-in includes the new environment line (and that order/format is preserved).
    tee /etc/systemd/system/mig-partition.service.d/10-mig-profile.conf > /dev/null <<EOF
[Service]
Environment="GPU_INSTANCE_PROFILE=${GPU_INSTANCE_PROFILE}"
Environment="NVIDIA_MIG_PROFILE_LAYOUT=${NVIDIA_MIG_PROFILE_LAYOUT}"
EOF

pkg/agent/variables.go:129

  • migProfileLayout is added to the CSE command variables map, but there are no template references to migProfileLayout (only GetMIGProfileLayout is used in cse_cmd.sh). Keeping an unused variable key increases contract surface area and can mislead future readers into thinking it is consumed somewhere. Consider removing it until there is an actual template consumer.
		"configGPUDriverIfNeeded":                config.ConfigGPUDriverIfNeeded,
		"enableGPUDevicePluginIfNeeded":          config.EnableGPUDevicePluginIfNeeded,
		"migNode":                                strconv.FormatBool(datamodel.IsMIGNode(config.GPUInstanceProfile)),
		"gpuInstanceProfile":                     config.GPUInstanceProfile,
		"migProfileLayout":                       strings.Join(config.MIGProfileLayout, ","),

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.

2 participants