-
Notifications
You must be signed in to change notification settings - Fork 4k
Adding Machine Learning Compute cmdlets #4681
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
Conversation
Looks like @cormacpayne and @markcowl are OOF until the end of the week. Is someone stepping in for them? |
Can one of the admins verify this patch? |
@azuresdkci add to whitelist |
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.
@shutchings a few minor comments.
Unsigned packing job to ensure your module has been included in AzureRM
and that your cmdlets appear: http://azuresdkci.cloudapp.net/job/posh-pack/5/
ChangeLog.md
Outdated
@@ -1,4 +1,13 @@ | |||
## 2017.09.25 - Version 4.4.0 |
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.
@shutchings please revert the changes made to this file, we will handle updating the ChangeLog in the root of the repository during the release
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.
Sounds good!
@@ -0,0 +1,11 @@ | |||
<?xml version="1.0" encoding="utf-8"?> |
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.
@shutchings there should be no app.config
file for the Commands
folder
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 think I had it because of some dependency issues but it looks like those got cleaned up in past revisions. Probably from the changes you made.
<Link>AzureRM.MachineLearningCompute.psd1</Link> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
</None> | ||
<None Include="app.config" /> |
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.
@shutchings please remove the reference to app.config
@cormacpayne I installed the package and tested the cmdlets and things look good. |
@cormacpayne @markcowl Looks like today is when it's supposed to be code complete. Any additional 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.
@shutchings a few minor comments that need looking at. Code complete has been moved to Friday, so you have a little bit of time to get these changes in.
<Reference Include="Microsoft.Azure.Management.MachineLearningCompute, Version=0.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> | ||
<HintPath>..\..\..\packages\Microsoft.Azure.Management.MachineLearningCompute.0.1.0\lib\net452\Microsoft.Azure.Management.MachineLearningCompute.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Microsoft.Rest.ClientRuntime, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" /> |
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.
@shutchings Microsoft.Rest.ClientRuntime.*
and Newtonsoft.Json
are already being imported from Common.Dependencies.targets
, so these references are not needed in your csproj.
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.
namespace Microsoft.Azure.Commands.MachineLearningCompute.Cmdlets | ||
{ | ||
[Cmdlet(VerbsCommon.Get, CmdletSuffix + "Key")] | ||
[OutputType(typeof(OperationalizationClusterCredentials))] |
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.
@shutchings can we create a new class that is PSOperationalizationClusterCredentials
and return that instead? This will prevent issues with potential breaking changes 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.
Done.
|
||
try | ||
{ | ||
WriteObject(MachineLearningComputeManagementClient.OperationalizationClusters.ListKeys(ResourceGroupName, Name)); |
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.
@shutchings if this is returning more than one object, make sure to use the WriteObject
overload with enumerateCollection: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.
This method only ever returns one object that wraps up multiple keys.
{ | ||
var exceptionDetails = e.Message + "."; | ||
|
||
foreach (var err in e.Body.Details) |
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.
@shutchings is the body ever null for an error? I want to make sure we avoid the scenario where e.Body.Details
throws an error because e.Body
is null.
Also, would we need to do any null-checking for e.Body.Details
?
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.
Good points! I have to do this extra handling for the different types of errors that the SDK returns so that the error message to the user isn't just "Bad Request" or "Not Found". I've settled on trying to unwrap the errors as best as I can but I'll throw the original error if I have issues doing that. That way the user will always still get the original error, or a more descriptive one, and not an error due to the unwrapping.
In my experimentation the body isn't null but the details can be at times. I've added the additional checks.
namespace Microsoft.Azure.Commands.MachineLearningCompute.Cmdlets | ||
{ | ||
[Cmdlet(VerbsDiagnostic.Test, CmdletSuffix + "SystemServicesUpdateAvailability")] | ||
[OutputType(typeof(CheckSystemServicesUpdatesAvailableResponse))] |
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.
@shutchings same comment about wrapping this in a PS class
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.
{ | ||
|
||
[Cmdlet(VerbsData.Update, CmdletSuffix + "SystemService", SupportsShouldProcess = true)] | ||
[OutputType(typeof(UpdateSystemServicesResponse))] |
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.
@shutchings same comment about wrapping this in a PS class
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.
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="Microsoft.Azure.Management.MachineLearningCompute" version="0.1.0" targetFramework="net452" /> | ||
<package id="Microsoft.Rest.ClientRuntime" version="2.3.10" targetFramework="net452" /> |
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.
@shutchings remove same packages outlined in csproj
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.
On-demand: http://azuresdkci.cloudapp.net/job/powershell-demand/1899 |
@cormac The cmdlets in the package job look good. |
Description
This is an approved PR for the 4.5.0 release. These cmdlet's were supposed to make it in to the 4.4.0 release but didn't quite make it. I've been working closely with @markcowl and @cormacpayne for my reviews and feedback. This was the original PR. A lot of feedback was incorporated into it but @cormacpayne closed it in favor of this PR where he continued to merge some of the recent changes from preview.
The .NET SDK was merged to the public repo in this PR. The nuget package has been published and these cmdlets are not using a local package.
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