[shimV2] adds the container spec builder#2661
Open
rawahars wants to merge 1 commit intomicrosoft:mainfrom
Open
[shimV2] adds the container spec builder#2661rawahars wants to merge 1 commit intomicrosoft:mainfrom
rawahars wants to merge 1 commit intomicrosoft:mainfrom
Conversation
Adds the new `internal/builder/container` package for container resource planning and spec construction. - adds core container builder types and resource planning logic - adds LCOW-specific implementations for devices, layers, mounts, reserve, and specs - adds package documentation and generated mocks used by tests - adds comprehensive unit tests across core and LCOW components Signed-off-by: Harsh Rawat <harshrawat@microsoft.com>
3928c47 to
4bff823
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This pull request adds new functionality for resource reservation in the LCOW (Linux Containers on Windows) container builder, specifically for handling device and layer reservations, and introduces comprehensive documentation and tests for these features.
Resource reservation logic for LCOW containers:
reserveAndUpdateDevicestolcow/devices.goto reserve vPCI devices, update device IDs in the OCI spec to VMBus channel GUIDs, and return partial results on failure for proper cleanup.parseAndReserveLayersand helpers tolcow/layers.goto parse rootfs/layer folders, reserve SCSI slots for read-only and scratch layers, and return a layer plan with proper cleanup on partial failure.Testing and documentation:
lcow/devices_test.gocovering empty device lists, single/multiple devices, virtual function indices, unsupported types, and partial failure scenarios forreserveAndUpdateDevices.lcow/doc.go) explaining the two-phase resource reservation and spec generation process for LCOW containers, including usage and cleanup strategy.