Skip to content

hcsoci: wire Windows CPU affinity to HCS container processor schema#2693

Open
wenyang wants to merge 1 commit intomicrosoft:mainfrom
wenyang:feature/windows-cpu-affinity-hcs-containers
Open

hcsoci: wire Windows CPU affinity to HCS container processor schema#2693
wenyang wants to merge 1 commit intomicrosoft:mainfrom
wenyang:feature/windows-cpu-affinity-hcs-containers

Conversation

@wenyang
Copy link
Copy Markdown
Contributor

@wenyang wenyang commented Apr 17, 2026

Summary

  • Add Affinity field to hcsschema.Processor struct.
  • Add ConvertCPUAffinity function to validate and extract CPU affinity from OCI spec.
  • Wire CPU affinity into HCS silo container creation via createWindowsContainerDocument.
  • Add affinity support to updateWCOWContainerCPU for container updates.
  • Add unit tests for ConvertCPUAffinity validation.

Motivation

This is Phase 2 of Windows CPU affinity support, enabling HCS silo containers (non-JobObject path) to use CPU affinity specified in the OCI spec.

Limitations (intentional for Phase 2)

  • Multiple affinity entries are rejected.
  • Non-zero processor groups are rejected.

Summary

- Add Affinity field to hcsschema.Processor struct.
- Add ConvertCPUAffinity function to validate and extract CPU affinity
  from OCI spec.
- Wire CPU affinity into HCS silo container creation via
  createWindowsContainerDocument.
- Add affinity support to updateWCOWContainerCPU for container updates.
- Add unit tests for ConvertCPUAffinity validation.

Motivation

This is Phase 2 of Windows CPU affinity support, enabling HCS silo
containers (non-JobObject path) to use CPU affinity specified in the
OCI spec.

Limitations (intentional for Phase 2)

- Multiple affinity entries are rejected.
- Non-zero processor groups are rejected.
@wenyang wenyang requested a review from a team as a code owner April 17, 2026 22:28
@wenyang
Copy link
Copy Markdown
Contributor Author

wenyang commented Apr 17, 2026

Phase 1 PR: #2603

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.

1 participant