-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
[Compute] az image builder
: Add subgroups and parameters to manage trigger, output versioning options
#26261
Conversation
️✔️AzureCLI-FullTest
|
Compute |
…r to 'az image builder output add' command
az image builder
: Add subgroups to manage optimizeraz image builder
: Add subgroups to manage optimizer, output versioning options
az image builder
: Add subgroups to manage optimizer, output versioning optionsaz image builder
: Add subgroups and parameters to manage trigger, optimizer, output versioning options
@@ -360,6 +368,16 @@ def load_arguments(self, _): | |||
with self.argument_context('image builder validator add', min_api='2022-02-14') as c: | |||
c.argument('dis_on_failure', options_list=['--continue-distribute-on-failure', '--dis-on-failure'], arg_type=get_three_state_flag(), help="If validation fails and this parameter is set to false, output image(s) will not be distributed.") | |||
c.argument('source_validation_only', arg_type=get_three_state_flag(), help="If this parameter is set to true, the image specified in the 'source' section will directly be validated. No separate build will be run to generate and then validate a customized image.") | |||
|
|||
with self.argument_context('image builder optimizer add', min_api='2022-07-01') as c: | |||
c.argument('optimizer_type', get_enum_type(['vmBoot']), options_list=['--type', '--optimizer-type'], help='The type of optimizer added.') |
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.
Is this enumeration only has one value? Will there be more types of --optimizer-type
in the future?
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.
Currently there is only one type of --optimizer-type
.
#25853 (comment)
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.
In fact, in the Swagger, the vmBoot
property is bool type, I personally think that our parameter design should be consistent with Swagger. code link
And if a parameter can only support passing in one value, making it a Boolean type would be more concise.
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.
@zdelacerda-microsoft May I ask what is the reason for designing vmBoot
as a --type {vmBoot} --state {enabled:disabled}
parameters? Will the --type
parameter expand to more values in the future? Why not use a more concise and clear name, such as --enable-vm-boot
?
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.
@zdelacerda-microsoft I have a question to confirm. If --type
expands to other values in the future, can these values be used simultaneously or can only one of them be used?
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.
Prefetch (3 new commands, also a new "optimize" sub category similar to customizer functionality)
- az image builder optimizer add --optimizer-name --type {vmBoot} --state {enabled:disabled} add optimizer to an image template
- az image builder optimizer clear removes all optimizers
- az image builder optimizer remove --optimizer-name removes an optimizer
@zdelacerda-microsoft
since the usual practice in CLI is using update
command to change the status of a resource property and remove
command to remove the entile resource, it is suggested to change the format of this group to the following format.
Could you please help to check if it could meet your expectation?
az image builder optimizer add --resource-group-name MyResourceGroup --image-template-name MyTemplate --enable-vm-boot {true:false}
add optimizer to an image templateaz image builder optimizer update --resource-group-name MyResourceGroup --image-template-name MyTemplate --enable-vm-boot {true:false}
update optimizer of an image templateaz image builder optimizer remove --resource-group-name MyResourceGroup --image-template-name MyTemplate
remove optimizers from an image template
BTW, this format has not been determined yet and there is a code freeze this Friday, the change of this group has to be postponed to next sprint (7-4), --validator
parameter in az image builder create
as well (#25853 (comment)).
The rest part of this feature request could be released in this sprint.
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.
@yanzhudd, examples you mentioned are fine, we want to go with --enable-vm-boot, but state you mentioned is boolean, can it be {enabled:disabled} or {true:false} will will mapped to it? any way will be fine.
Also the update and remove cmd you mentioned will work.
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.
@zhoxing-ms, --type may not be expand in future, but if so it will be used simultaneously not one at a time
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.
This looks good to me. Thank you @yanzhudd and @zhoxing-ms
|
||
helps['image builder optimizer remove'] = """ | ||
type: command | ||
short-summary: Remove optimizer from an existing image builder template. |
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.
short-summary: Remove optimizer from an existing image builder template. | |
short-summary: Remove an optimizer from an existing image builder template. |
short-summary: Remove all optimizers from an existing image builder template. | ||
long-summary: Must be used with --defer | ||
examples: | ||
- name: Remove all optimizers from an existing image builder template. |
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.
short-summary: Remove all optimizers from an existing image builder template. | |
long-summary: Must be used with --defer | |
examples: | |
- name: Remove all optimizers from an existing image builder template. | |
short-summary: Clear all optimizers from an existing image builder template. | |
long-summary: Must be used with --defer | |
examples: | |
- name: Clear all optimizers from an existing image builder template. |
Just a small suggestion. The help message of clear
should be distinguished from remove
, so as to avoid confusion for customers
az image builder
: Add subgroups and parameters to manage trigger, optimizer, output versioning optionsaz image builder
: Add subgroups and parameters to manage trigger, output versioning options
…trigger, output versioning options (Azure#26261)
Related command
az image builder trigger create/show/list/delete
az image builder output add --versioning (latest,source)
az image builder output add --is-vhd --vhd-uri <string>
Description
In
az image builder
group:trigger
to manage image builder template trigger.output versioning
to manage image builder template output versioner.--versioning
foraz image builder output add
command to describe how to generate new x.y.z version number for distribution.--vhd-uri
foraz image builder output add
command to specify storage uri for the distributed VHD blob.Close: #25853
Testing Guide
History Notes
[Compute]
az image builder trigger
: Add subgroup to manage image builder template trigger[Compute]
az image builder output versioning
: Add subgroup to manage image builder template output versioning[Compute]
az image builder output add
: Add parameter--versioning
to support describing how to generate new x.y.z version number for distribution[Compute]
az image builder output add
: Add parameter--vhd-uri
to support specifying storage uri for the distributed VHD blobThis 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.