Skip to content

feat: support mixed MIG profiles#8869

Draft
karenychen wants to merge 6 commits into
mainfrom
codex/mig-profiles-contract
Draft

feat: support mixed MIG profiles#8869
karenychen wants to merge 6 commits into
mainfrom
codex/mig-profiles-contract

Conversation

@karenychen

Copy link
Copy Markdown

What this PR does / why we need it:

Adds AgentBaker support for the new MigProfiles contract while preserving the legacy GPUInstanceProfile path. The parser resolves the mutually exclusive legacy scalar and new plural field into one MIG profile list for shared logic, and the Linux MIG partitioning script can now apply multiple GPU instance profiles.

This also updates the aks-node-controller proto/generated code and snapshots/spec coverage for the mixed-profile path.

Which issue(s) this PR fixes:

Fixes #

Testing:

  • make generate
  • make test
  • make test-shell
  • go test ./aks-node-controller/parser ./pkg/agent
  • git diff --check origin/main...HEAD

Copilot AI review requested due to automatic review settings July 8, 2026 23:16
@github-actions

github-actions Bot commented Jul 8, 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 17, 2026, 9:03 PM

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

This PR adds support for a new plural MigProfiles/mig_profiles contract while preserving the legacy scalar GPUInstanceProfile path by resolving both into a single “MIG profiles list” used across AgentBaker templating, aks-node-controller parsing, and the Linux MIG partitioning script.

Changes:

  • Resolve legacy GPUInstanceProfile and new MIGProfiles/mig_profiles into a single MIG profile list and propagate it via GPU_INSTANCE_PROFILE and new MIG_PROFILES env vars.
  • Extend mig-partition.sh to support mixed profile lists when NVIDIA_MIG_STRATEGY=Mixed, and update systemd env wiring.
  • Update aks-node-controller proto + generated code and add/extend unit + ShellSpec coverage for mixed MIG profiles.

Reviewed changes

Copilot reviewed 14 out of 15 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
spec/parts/linux/cloud-init/artifacts/mig_partition_spec.sh Adds ShellSpec coverage for single and mixed MIG profile partitioning behavior.
pkg/agent/variables.go Computes resolved MIG profiles list and emits MIG_NODE, GPU_INSTANCE_PROFILE, and migProfiles variables accordingly.
pkg/agent/datamodel/types.go Adds MIGProfiles to NodeBootstrappingConfiguration and a helper to resolve legacy vs new fields.
pkg/agent/datamodel/helper.go Updates IsMIGNode to operate on a resolved MIG profile list.
pkg/agent/baker.go Exposes GetMIGProfiles and updates MIG-related template funcs to use the resolved list.
pkg/agent/baker_test.go Adds a test covering mixed MIG profiles flowing into CSE vars.
parts/linux/cloud-init/artifacts/mig-partition.sh Implements mixed MIG layout generation and legacy-compatible parsing of env/args.
parts/linux/cloud-init/artifacts/cse_config.sh Passes MIG_PROFILES and NVIDIA_MIG_STRATEGY into the mig-partition systemd unit environment.
parts/linux/cloud-init/artifacts/cse_cmd.sh Adds MIG_PROFILES to the generated CSE env var set.
aks-node-controller/proto/README.md Documents new MIG_PROFILES mapping for GPUConfig.
aks-node-controller/proto/aksnodeconfig/v1/gpu_config.proto Adds repeated string mig_profiles = 9 and updates MIG strategy comment.
aks-node-controller/pkg/gen/aksnodeconfig/v1/gpu_config.pb.go Regenerates Go bindings for the new mig_profiles field.
aks-node-controller/parser/parser.go Emits MIG_NODE, GPU_INSTANCE_PROFILE, and MIG_PROFILES from a resolved profile list.
aks-node-controller/parser/parser_test.go Adds mixed MIG profile test case and asserts empty MIG_PROFILES when unset.
aks-node-controller/parser/helper.go Adds getMIGProfiles resolver and updates MIG detection to use the resolved list.
Files not reviewed (1)
  • aks-node-controller/pkg/gen/aksnodeconfig/v1/gpu_config.pb.go: Generated file

Comment on lines +54 to +66
trim_profile() {
local profile="$1"
profile="${profile#"${profile%%[![:space:]]*}"}"
profile="${profile%"${profile##*[![:space:]]}"}"
echo "$profile"
}

mixed_gpu_instance_profiles_layout() {
local profiles_csv="$1"
local layout=""
local profile
local profile_id

@karenychen
karenychen force-pushed the codex/mig-profiles-contract branch from 56354d3 to 98b6ee1 Compare July 17, 2026 15:11
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