-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[DO NOT MERGE] DT CLI changes #9378
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
* port 22 compute connect fix * add changelog
* pylint fix * revert unwanted change
|
Validation for Breaking Change Starting...
Thanks for your contribution! |
|
Hi @kshitij-microsoft, |
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR. Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
Release SuggestionsModule: machinelearningservices
Notes
|
There was a problem hiding this comment.
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 comprehensive deployment template management commands to the Azure Machine Learning CLI extension. Deployment templates provide a way to standardize and share deployment configurations across teams and projects in Azure ML registries.
- Introduces six new CLI commands for managing deployment templates: list, get, create, update, archive, and restore
- Implements registry-based operations with proper error handling and serialization support
- Adds comprehensive help documentation and parameter definitions
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
deployment_template.py |
Core implementation of six deployment template management functions with error handling and serialization logic |
commands.py |
Registers the new ml deployment-template command group with appropriate command bindings |
_deployment_template_params.py |
Defines CLI parameters for all deployment template commands with registry-name requirements |
_deployment_template_help.py |
Provides comprehensive help text and usage examples for all deployment template commands |
__init__.py files |
Import statements to expose new functionality |
CHANGELOG.rst |
Documents the new commands in the changelog |
|
|
||
| module_logger = logging.getLogger(__name__) | ||
| module_logger.propagate = 0 | ||
| logger = logging.getLogger(__name__) |
Copilot
AI
Nov 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two logger instances are created for the same module, but only module_logger is used in the code. The unused logger variable on line 22 should be removed.
| logger = logging.getLogger(__name__) |
| command_type=custom_deployment_template) | ||
| g.generic_update_command( | ||
| "update", | ||
| getter_name="ml_deployment_template_get", |
Copilot
AI
Nov 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The getter function name should be _ml_deployment_template_show to match the generic_update_command pattern used elsewhere in this file. The function _ml_deployment_template_show is defined in deployment_template.py (line 162) but ml_deployment_template_get is referenced here as the getter, which will cause the update command to fail.
| getter_name="ml_deployment_template_get", | |
| getter_name="_ml_deployment_template_show", |
| def ml_deployment_template_archive( | ||
| cmd, | ||
| name, | ||
| version=None, | ||
| registry_name=None, | ||
| no_wait=False, | ||
| **kwargs, # pylint: disable=unused-argument | ||
| ): | ||
| """Archive a deployment template.""" | ||
| ml_client, debug = get_ml_client( | ||
| cli_ctx=cmd.cli_ctx, registry_name=registry_name | ||
| ) | ||
|
|
||
| try: | ||
| ml_client.deployment_templates.archive(name=name, version=version) | ||
| except Exception as err: # pylint: disable=broad-except | ||
| log_and_raise_error(err, debug) |
Copilot
AI
Nov 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The no_wait parameter is accepted but never used in the function implementation. Either implement no-wait functionality (similar to the pattern in ml_deployment_template_create lines 115-123) or remove the parameter from the function signature.
| def ml_deployment_template_restore( | ||
| cmd, | ||
| name, | ||
| version=None, | ||
| registry_name=None, | ||
| no_wait=False, | ||
| **kwargs, # pylint: disable=unused-argument | ||
| ): | ||
| """Restore an archived deployment template.""" | ||
| ml_client, debug = get_ml_client( | ||
| cli_ctx=cmd.cli_ctx, registry_name=registry_name | ||
| ) | ||
|
|
||
| try: | ||
| ml_client.deployment_templates.restore(name=name, version=version) | ||
| except Exception as err: # pylint: disable=broad-except | ||
| log_and_raise_error(err, debug) |
Copilot
AI
Nov 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The no_wait parameter is accepted but never used in the function implementation. Either implement no-wait functionality (similar to the pattern in ml_deployment_template_create lines 115-123) or remove the parameter from the function signature.
This checklist is used to make sure that common guidelines for a pull request are followed.
Related command
General Guidelines
azdev style <YOUR_EXT>locally? (pip install azdevrequired)python scripts/ci/test_index.py -qlocally? (pip install wheel==0.30.0required)For new extensions:
About Extension Publish
There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update
src/index.jsonautomatically.You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify
src/index.json.