Repository navigation
{Cognitive Services} Resolve Docker executable paths for hosted agent builds - #34304
Merged
mansoor sarfraz (msarfraz) merged 2 commits intoNov 9, 2026
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Returning the Docker symlink target breaks executable-name dispatch for Snap installations, causing daemon checks to misidentify working Docker installations as unavailable and build/push operations to invoke the wrong command.
1 open issue
What changed in this PR
This PR updates Docker discovery for Cognitive Services hosted-agent source builds, using absolute executable paths for local Docker operations.
Changes:
- Adds executable resolution with checks rejecting Docker entries or symlink targets in the current directory.
- Uses resolved paths for Docker availability checks, builds, and pushes.
- Replaces environment-dependent testing with mocked subprocess and resolution tests.
| File | Description |
|---|---|
src/azure-cli/azure/cli/command_modules/cognitiveservices/tests/latest/test_agent.py |
Adds focused tests for executable resolution and Docker subprocess calls. |
src/azure-cli/azure/cli/command_modules/cognitiveservices/custom.py |
Adds Docker path resolution and applies it to availability, build, and push operations. |
Review effort: Balanced
Member
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
Member
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
Collaborator
|
Adding mansoor sarfraz (@msarfraz) to help review |
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.

🤖 PR Validation — ️✔️ All clear
Related command
az cognitiveservices agent create --sourceDescription
Align Docker command discovery with the established ACR module pattern.
This change resolves Docker to an absolute executable path before availability checks and local build/push operations. It ensures that the same resolved executable is used consistently throughout the source-build workflow.
Adds focused unit coverage for executable resolution and Docker subprocess invocation.
Testing Guide
Run the hosted-agent helper unit tests:
python -m pytest src/azure-cli/azure/cli/command_modules/cognitiveservices/tests/latest/test_agent.py::CognitiveServicesAgentHelperTests -qHistory Notes
None. Internal implementation change only.
This checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.