-
Notifications
You must be signed in to change notification settings - Fork 4k
Update Batch commandlets to support latest APIs #4762
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
Update Batch commandlets to support latest APIs #4762
Conversation
f7179d9
to
7438ea7
Compare
@markcowl @cormacpayne The CI is failing because of this: But we made breaking changes on purpose... so I think we should ignore this failure? |
@matthchr Hey Matt, you can ignore that failure since this is a breaking change release and you are making the changes that customers have been previously notified of. You can go ahead and suppress these changes so they don't fail the build - to do so, you will open the Let me know if you have any questions. |
31d8a45
to
0bebb1f
Compare
@@ -40,13 +42,30 @@ public class NewBatchAccountCommand : BatchCmdletBase | |||
[Parameter(Position = 3, Mandatory = false, ValueFromPipelineByPropertyName = true)] | |||
public string AutoStorageAccountId { get; set; } | |||
|
|||
[Parameter(Position = 4, Mandatory = false, ValueFromPipelineByPropertyName = true)] |
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.
If we don't set position, will it reduce the breaking change for 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.
I am not sure -- I followed the existing pattern in this cmdlet. @cormacpayne @markcowl can you comment on this?
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.
Think of this like unnamed parameters in a method signature - any positional parameter beyiond 3 tends to be not useful. We suggest that you not have positional parameter with position > 3
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.
Got it. I will fix this
@@ -233,11 +272,19 @@ public PSCloudServiceConfiguration CloudServiceConfiguration | |||
} | |||
} | |||
|
|||
public System.Int32? CurrentDedicated | |||
public System.Int32? CurrentDedicatedComputeNodes |
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.
Add mapping to CurrentDedicated and obsolete it.
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.
My intent is to just leave this as is (no obsolete) since this is a breaking change, unless otherwise suggested by one of the powershell maintainers.
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.
As long as this is documented in the upcoming breaking changes document, this is ok.
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.
Added docs
@@ -445,15 +501,27 @@ public PSPoolStatistics Statistics | |||
} | |||
} | |||
|
|||
public System.Int32? TargetDedicated | |||
public System.Int32? TargetDedicatedComputeNodes |
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.
Same here.
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.
My intent is to just leave this as is (no obsolete) since this is a breaking change, unless otherwise suggested by one of the powershell maintainers.
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 is ok, but it needs to be documented in the upcoming breaking changes document,a s noted.
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.
Added documentation there
@@ -151,28 +153,53 @@ public IList<PSExitCodeMapping> ExitCodes | |||
} | |||
} | |||
|
|||
public PSExitOptions SchedulingError | |||
public PSExitOptions FileUploadError |
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.
mapping and obsolete?
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.
My intent is to just leave this as is (no obsolete) since this is a breaking change, unless otherwise suggested by one of the powershell maintainers.
@@ -45,7 +45,7 @@ internal PSJobSchedulingError(Microsoft.Azure.Batch.JobSchedulingError omObject) | |||
this.omObject = omObject; | |||
} | |||
|
|||
public Microsoft.Azure.Batch.Common.SchedulingErrorCategory Category | |||
public Microsoft.Azure.Batch.Common.ErrorCategory Category |
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.
Does it count "breaking change"?
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.
I am not sure -- one of the Powershell team members can comment maybe?
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.
If it has a superset of the properties of the previous type, then it is not a breaking change. Otherwise, it is a breakign change.
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.
Yes, it has a superset.
@@ -53,11 +53,11 @@ internal PSNodeFile(Microsoft.Azure.Batch.NodeFile omObject) | |||
} | |||
} | |||
|
|||
public string Name | |||
public string Path |
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.
same here.
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.
My intent is to just leave this as is (no obsolete) since this is a breaking change, unless otherwise suggested by one of the powershell maintainers.
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 needs to be specifically documented (with an example) in the upcoming-breaking changes
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.
Done
@@ -328,15 +367,27 @@ public PSStartTask StartTask | |||
} | |||
} | |||
|
|||
public System.Int32? TargetDedicated | |||
public System.Int32? TargetDedicatedComputeNodes |
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.
same here
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.
My intent is to just leave this as is (no obsolete) since this is a breaking change, unless otherwise suggested by one of the powershell maintainers.
private PSWindowsConfiguration windowsConfiguration; | ||
|
||
public PSVirtualMachineConfiguration(PSImageReference imageReference, string nodeAgentSkuId, PSWindowsConfiguration windowsConfiguration = default(PSWindowsConfiguration)) | ||
public PSVirtualMachineConfiguration(PSImageReference imageReference, string nodeAgentSkuId) |
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.
since the original constructor isn't obsoleted, should we keep it?
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 this case I don't think so since this is a breaking change release, we should feel free to make this sort of change (even though I missed obsoleting it previously).
/// </summary> | ||
public string NodeFileName { get; set; } | ||
public string Path { get; set; } |
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.
should we keep the original property since it isn't obsoleted?
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.
My intent is to just leave this as is (no obsolete) since this is a breaking change, unless otherwise suggested by one of the powershell maintainers.
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 change in usage needs to be documented in upcoming-breaking-changes
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 is actually only a type used internally in the cmdlets, it's not part of a cmdlet or return type. It's just used to store information about what request is being performed so we can pass it off to the C# SDK, so I don't think there's anything to really say in upcoming-breaking-changes. It was already covered in the Name
-> Path
change for the GetNodeFile
cmdlet.
@@ -65,7 +65,12 @@ public NewPoolParameters(BatchAccountContext context, string poolId, IEnumerable | |||
/// <summary> | |||
/// The target number of compute nodes to allocate to the pool. | |||
/// </summary> | |||
public int? TargetDedicated { get; set; } | |||
public int? TargetDedicatedComputeNodes { get; set; } |
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.
same here
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.
My intent is to just leave this as is (no obsolete) since this is a breaking change, unless otherwise suggested by one of the powershell maintainers.
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 is actually only a type used internally in the cmdlets, it's not part of a cmdlet or return type. It's just used to store information about what request is being performed so we can pass it off to the C# SDK, so I don't think there's anything to really say in upcoming-breaking-changes.
/// </summary> | ||
public string NodeFileName { get; private set; } | ||
public string Path { get; private set; } |
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.
same here.
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.
My intent is to just leave this as is (no obsolete) since this is a breaking change, unless otherwise suggested by one of the powershell maintainers.
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.
Same comment, must document in upcoming-breaking changes
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 is actually only a type used internally in the cmdlets, it's not part of a cmdlet or return type. It's just used to store information about what request is being performed so we can pass it off to the C# SDK, so I don't think there's anything to really say in upcoming-breaking-changes. It was already covered in the Name
-> Path
change for the GetNodeFile
/RemoveBatchNodeFile
cmdlets, which was already documented.
847c5d3
to
2b49aed
Compare
@azuresdkci test this please |
666e8a6
to
e06645c
Compare
@markcowl - Done, commits should be much cleaner now |
no longer have a `SchedulingError` property, they instead have a `FailureInformation` property. `FailureInformation` is returned any time there is a task failure. | ||
This includes all previous scheduling error cases, as well as nonzero task exit codes, and file upload failures from the new output files feature. | ||
# Upcoming Breaking Changes | ||
|
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 changes in the output objects are not covered here. Please include a section on how the corresponding output object changes (*Nodes -> *ComputeNodes) would be handled by scripts that use the old proeprty values
@@ -445,15 +501,27 @@ public PSPoolStatistics Statistics | |||
} | |||
} | |||
|
|||
public System.Int32? TargetDedicated | |||
public System.Int32? TargetDedicatedComputeNodes |
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 is ok, but it needs to be documented in the upcoming breaking changes document,a s noted.
<package id="WindowsAzure.Storage" version="6.2.0" targetFramework="net452" /> | ||
<package id="Microsoft.Azure.Management.Batch" version="4.2.0" targetFramework="net452" /> | ||
<package id="Microsoft.Azure.Management.Resources" version="2.20.0-preview" targetFramework="net45" /> | ||
<package id="Microsoft.Bcl" version="1.1.9" targetFramework="net45" /> |
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 common packages are all being resrtored by the resource manager common package. We intentionally removed this to prevent different packages taking dependencies on different versions of common libraries. Please revart, other than the changes to batch sdk versions
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.
Ah, will fix -- I think I used nuget to update the package dependencies and it probably added them back.
- Renamed `ResizeError` to `ResizeErrors` on `PSCloudPool`, and it is now a collection. | ||
- Renamed the `Name` property on `PSNodeFile` to `Path`. | ||
- Renamed `PSTaskSchedulingError` to `PSTaskFailureInformation`. | ||
- Renamed the `SchedulingError` property on `PSJobPreparationTaskExecutionInformation`, `PSJobReleaseTaskExecutionInformation`, `PSStartTaskInformation`, `PSSubtaskInformation`, and `PSTaskExecutionInformation` to `FailureInformation`. |
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.
I don't see any of the changes to secure parameter types here. Please ensure that these are documented
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.
They're in the section below on per-cmdlet changes
- `PSMultiInstanceSettings` constructor no longer takes a required `numberOfInstances` parameter, instead it takes a required `coordinationCommandLine` parameter. | ||
|
||
The following cmdlets were affected this release: | ||
|
||
**New-AzureBatchCertificate** | ||
- Parameter "Password" being replaced in favor of a Secure string |
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.
Please add explnantions of the change form 'runelevated' to 'UserIdentity'
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.
Done -- I think I've covered this now both as a parameter to exisiting cmdlets as well as on the returned object from Get-AzureBatchTask
@@ -27,17 +27,16 @@ namespace Microsoft.Azure.Commands.Batch.Models | |||
using System.Collections; | |||
using System.Collections.Generic; | |||
using Microsoft.Azure.Batch; | |||
|
|||
|
|||
[Obsolete("SchedulingError will be removed in a future version and replaced with FailureInformation")] |
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.
Need an example of usage of the new type and how this has changed in the upcoming-breakign changes document
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 type itself is used the same way (it's structured the same, just renamed). I will clarify in upcoming-breaking-changes though.
/// </summary> | ||
public string NodeFileName { get; set; } | ||
public string Path { get; set; } |
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 change in usage needs to be documented in upcoming-breaking-changes
/// </summary> | ||
public string NodeFileName { get; private set; } | ||
public string Path { get; private set; } |
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.
Same comment, must document in upcoming-breaking changes
[ValidateNotNullOrEmpty] | ||
public int TargetDedicated { get; set; } |
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.
needs toi be documented for the migration guide
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.
Fixed
- Renamed `PSTaskSchedulingError` to `PSTaskFailureInformation`. | ||
- Renamed the `SchedulingError` property on `PSJobPreparationTaskExecutionInformation`, `PSJobReleaseTaskExecutionInformation`, `PSStartTaskInformation`, `PSSubtaskInformation`, and `PSTaskExecutionInformation` to `FailureInformation`. | ||
- `FailureInformation` is returned any time there is a task failure. This includes all previous scheduling error cases, as well as nonzero task exit codes, and file upload failures from the new output files feature. | ||
- Renamed the `SchedulingError` property on `PSExitConditions` to `PreProcessingError`. |
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.
Have noted some places where additional documentation appears to be necessary. Essentially any breaking change in parameter or output type properties need to be documented here with an example. This will be sued to create the migration guide.
8f8ea9f
to
5ea9226
Compare
@markcowl - Updated according to your feedback. Breaking change doc clarified, moved to all per-cmdlet style. Please let me know ASAP if there's anything else we need to do, or if we're good to merge. |
@matthchr the on-demand run is failing due to the plural parameter names - you will need to add suppressions to the SignatureIssues.xml file in toold\StaticAnalysis to match. |
@markcowl - There is no such file in Where should I add the suppressions, and how do I know what the format of the supressions is...? |
- Add support for Azure Batch SDK 8.0. - Includes one new cmdlet (Get-AzureBatchTaskCounts) and a number of cmdlet updates. - Re-record tests. - Regenerate help text. - Use secure string for password fields.
54cc3a9
to
64f67d8
Compare
Description
This checklist is used to make sure that common guidelines for a pull request are followed. You can find a more complete discussion of PowerShell cmdlet best practices here.
General Guidelines
Testing Guidelines
Cmdlet Signature Guidelines
ShouldProcess
and haveSupportShouldProcess=true
specified in the cmdlet attribute. You can find more information onShouldProcess
here.OutputType
attribute if any output is produced - if the cmdlet produces no output, it should implement aPassThru
parameter.Cmdlet Parameter Guidelines