Add NodeVersionStrategy support to ContainerOperationProviderEnhanced#5532
Open
rishabhmalikMS wants to merge 8 commits intomasterfrom
Open
Add NodeVersionStrategy support to ContainerOperationProviderEnhanced#5532rishabhmalikMS wants to merge 8 commits intomasterfrom
rishabhmalikMS wants to merge 8 commits intomasterfrom
Conversation
Replicate the UseNodeVersionStrategy knob-gated code path from ContainerOperationProvider into ContainerOperationProviderEnhanced: - Read UseNodeVersionStrategy knob alongside existing node knobs - Gate container command: use sleep infinity/ping when enabled, legacy node-based startup in else branch - Add orchestrator branch after container start verification to select optimal node version via NodeVersionOrchestrator - Add GetJobContainerHandlerData and SetContainerNodePathWithOrchestrator private methods (verbatim copy from ContainerOperationProvider) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Contributor
Author
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Contributor
Author
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Update ContainerOperationProviderEnhancedL0 tests to cover both legacy and UseNodeVersionStrategy code paths. Legacy tests verify node-based keepalive commands, while new tests verify OS-specific keepalive (sleep infinity for Linux, timeout for Windows) when the knob is enabled. Add useNodeVersionStrategy parameter to CreateExecutionContextMock in ContainerOperationProviderL0Base to control the AGENT_USE_NODE_STRATEGY knob via specific Moq matcher overrides, ensuring correct knob evaluation in test contexts.
…ttps://github.com/microsoft/azure-pipelines-agent into users/rishabhmalik/enhancedContainerProviderUpdate
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Contributor
Author
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
raujaiswal
reviewed
Apr 22, 2026
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Contributor
Author
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Contributor
Author
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
tarunramsinghani
approved these changes
Apr 22, 2026
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.
Context
Replicate the UseNodeVersionStrategy knob-gated code path from ContainerOperationProvider into ContainerOperationProviderEnhanced:
Read UseNodeVersionStrategy knob alongside existing node knobs
Gate container command: use sleep infinity/ping when enabled, legacy node-based startup in else branch
Add orchestrator branch after container start verification to select optimal node version via NodeVersionOrchestrator
Add GetJobContainerHandlerData and SetContainerNodePathWithOrchestrator private methods (verbatim copy from ContainerOperationProvider)
AB#2380695
Description
This PR adds UseNodeVersionStrategy support to ContainerOperationProviderEnhanced, bringing it to parity with
ContainerOperationProvider. When the UseNodeVersionStrategy knob is enabled:
- Linux containers: sleep infinity
- Windows containers: cmd.exe /c timeout /t -1 /nobreak > nul
fallback to the legacy node path on failure.
fallback chain remain intact.
Files changed:
private methods
Windows+Linux container, Windows+Windows container, Linux native)
activation via Moq-specific matcher overrides
Risk Assessment (Low)
code paths are affected.
knob.
Unit Tests Added or Updated (Yes / No)
StartContainer_UseNodeVersionStrategy_WithDockerLabel_UsesSleepOrTimeout— verifies keepalive when container provides custom nodevia Docker label
StartContainer_UseNodeVersionStrategy_OnWindows_LinuxContainer_UsesSleepInfinity— Windows host + Linux container → sleep infinityStartContainer_UseNodeVersionStrategy_OnWindows_WindowsContainer_UsesTimeout— Windows host + Windows container → timeoutStartContainer_UseNodeVersionStrategy_OnLinux_UsesSleepInfinity— Linux host + Linux container → sleep infinityactivate the knob via specific Moq setup overrides on
GetVariableValueOrDefault("AGENT_USE_NODE_STRATEGY")Additional Testing Performed
List manual or automated tests performed beyond unit tests (e.g., integration, scenario, regression).
Change Behind Feature Flag (Yes / No)
Yes
Tech Design / Approach
ContainerOperationProviderfor consistency and maintainability.Documentation Changes Required (Yes/No)
Indicate whether related documentation needs to be updated.
Logging Added/Updated (Yes/No)
Telemetry Added/Updated (Yes/No)
Rollback Scenario and Process (Yes/No)
Dependency Impact Assessed and Regression Tested (Yes/No)