Skip to content

ADL Updates for Jan release #3363

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

Merged
merged 23 commits into from
Jan 12, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/Common/Commands.Common/GeneralUtilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ public static class GeneralUtilities

private static List<string> AuthorizationHeaderNames = new List<string>() { "Authorization" };

// this is only used to determine cutoff for streams (not xml or json).
private const int StreamCutOffSize = 10 * 1024; //10KB

private static bool TryFindCertificatesInStore(string thumbprint,
System.Security.Cryptography.X509Certificates.StoreLocation location, out X509Certificate2Collection certificates)
{
Expand Down Expand Up @@ -318,7 +321,9 @@ public static string FormatString(string content)
}
else
{
return content;
return content.Length <= GeneralUtilities.StreamCutOffSize ?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a quick, elegant solution, I like it.

content :
content.Substring(0, StreamCutOffSize) + "\r\nDATA TRUNCATED DUE TO SIZE\r\n";
}
}

Expand Down
5 changes: 5 additions & 0 deletions src/ResourceManager/DataLakeAnalytics/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
- Additional information about change #1
-->
## Current Release
* Update Get-AdlJob to support Top parameter
* Update Get-AdlJob to return the list of jobs in order by most recently submitted
* Updated help for all cmdlets to include output as well as more descriptions of parameters and the inclusion of aliases.
* Update New-AdlAnalyticsAccount and Set-AdlAnalyticsAccount to support commitment tier options for the service.
* Added OutputType mismatch warnings to all cmdlets with incorrect OutputType attributes. These will be fixed in a future breaking change release.

## Version 2.4.0
* Removal of unsupported parameters in Add and Set-AzureRMDataLakeAnalyticsDataSource (default for data lake store)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,14 @@
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Authorization.2.0.0\lib\net40\Microsoft.Azure.Management.Authorization.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Azure.Management.DataLake.Analytics">
<HintPath>..\..\..\packages\Microsoft.Azure.Management.DataLake.Analytics.1.0.1-preview\lib\net45\Microsoft.Azure.Management.DataLake.Analytics.dll</HintPath>
<Reference Include="Microsoft.Azure.Management.DataLake.Analytics, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Microsoft.Azure.Management.DataLake.Analytics.2.0.0\lib\net45\Microsoft.Azure.Management.DataLake.Analytics.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Azure.Management.DataLake.Store, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Microsoft.Azure.Management.DataLake.Store.1.0.2-preview\lib\net45\Microsoft.Azure.Management.DataLake.Store.dll</HintPath>
<HintPath>..\..\..\packages\Microsoft.Azure.Management.DataLake.Store.1.0.3\lib\net45\Microsoft.Azure.Management.DataLake.Store.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Azure.Management.ResourceManager, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
Expand Down Expand Up @@ -115,9 +116,9 @@
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.Authentication.2.2.9-preview\lib\net45\Microsoft.Rest.ClientRuntime.Azure.Authentication.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Rest.ClientRuntime.Azure.TestFramework">
<Reference Include="Microsoft.Rest.ClientRuntime.Azure.TestFramework, Version=1.5.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.TestFramework.1.3.6-preview\lib\net45\Microsoft.Rest.ClientRuntime.Azure.TestFramework.dll</HintPath>
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.TestFramework.1.5.1-preview\lib\net45\Microsoft.Rest.ClientRuntime.Azure.TestFramework.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Threading.Tasks, Version=1.0.12.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
Expand Down Expand Up @@ -223,6 +224,9 @@
<None Include="SessionRecords\Microsoft.Azure.Commands.DataLakeAnalytics.Test.ScenarioTests.AdlaAliasTests\TestAdlaAccount.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.DataLakeAnalytics.Test.ScenarioTests.AdlaAliasTests\TestAdlaAccountTiers.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.DataLakeAnalytics.Test.ScenarioTests.AdlaAliasTests\TestAdlaCatalog.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
Expand All @@ -238,6 +242,9 @@
<None Include="SessionRecords\Microsoft.Azure.Commands.DataLakeAnalytics.Test.ScenarioTests.AdlaTests\TestAdlaAccount.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.DataLakeAnalytics.Test.ScenarioTests.AdlaTests\TestAdlaAccountTiers.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.DataLakeAnalytics.Test.ScenarioTests.AdlaTests\TestAdlaCatalog.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ public void TestAdlaAccount()
AdlaTestsBase.resourceGroupLocation));
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestAdlaAccountTiers()
{
AdlaTestsBase.NewInstance.RunPsTest(true,
string.Format(
"Test-DataLakeAnalyticsAccountTiers -location '{0}'",
AdlaTestsBase.resourceGroupLocation));
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestAdlaCatalog()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function Test-DataLakeAnalyticsAccount
for ($i = 0; $i -le 60; $i++)
{
[array]$accountGet = Get-AdlAnalyticsAccount -ResourceGroupName $resourceGroupName -Name $accountName
if ($accountGet[0].Properties.ProvisioningState -like "Succeeded")
if ($accountGet[0].ProvisioningState -like "Succeeded")
{
Assert-AreEqual $accountName $accountGet[0].Name
Assert-AreEqual $location $accountGet[0].Location
Expand All @@ -47,7 +47,7 @@ function Test-DataLakeAnalyticsAccount
break
}

Write-Host "account not yet provisioned. current state: $($accountGet[0].Properties.ProvisioningState)"
Write-Host "account not yet provisioned. current state: $($accountGet[0].ProvisioningState)"
[Microsoft.Rest.ClientRuntime.Azure.TestFramework.TestUtilities]::Wait(30000)
Assert-False {$i -eq 60} "dataLakeAnalytics account is not in succeeded state even after 30 min."
}
Expand Down Expand Up @@ -111,7 +111,7 @@ function Test-DataLakeAnalyticsAccount

# get the account and ensure that it contains two data lake stores
$testStoreAdd = Get-AdlAnalyticsAccount -Name $accountName
Assert-AreEqual 2 $testStoreAdd.Properties.DataLakeStoreAccounts.Count
Assert-AreEqual 2 $testStoreAdd.DataLakeStoreAccounts.Count

# get the specific data source added
$adlsAccountInfo = Get-AdlAnalyticsDataSource -Account $accountName -DataLakeStore $secondDataLakeAccountName
Expand All @@ -126,14 +126,14 @@ function Test-DataLakeAnalyticsAccount

# get the account and ensure that it contains one data lake store
$testStoreAdd = Get-AdlAnalyticsAccount -Name $accountName
Assert-AreEqual 1 $testStoreAdd.Properties.DataLakeStoreAccounts.Count
Assert-AreEqual 1 $testStoreAdd.DataLakeStoreAccounts.Count

# add a blob account to the analytics account
Add-AdlAnalyticsDataSource -Account $accountName -Blob $blobAccountName -AccessKey $blobAccountKey

# get the account and ensure that it contains one blob account
$testStoreAdd = Get-AdlAnalyticsAccount -Name $accountName
Assert-AreEqual 1 $testStoreAdd.Properties.StorageAccounts.Count
Assert-AreEqual 1 $testStoreAdd.StorageAccounts.Count

# get the specific data source added
$blobAccountInfo = Get-AdlAnalyticsDataSource -Account $accountName -Blob $blobAccountName
Expand All @@ -148,7 +148,7 @@ function Test-DataLakeAnalyticsAccount

# get the account and ensure that it contains no azure storage accounts
$testStoreAdd = Get-AdlAnalyticsAccount -Name $accountName
Assert-True {$testStoreAdd.Properties.StorageAccounts -eq $null -or $testStoreAdd.Properties.StorageAccounts.Count -eq 0} "Remove blob storage reported success but failed to remove the account."
Assert-True {$testStoreAdd.StorageAccounts -eq $null -or $testStoreAdd.StorageAccounts.Count -eq 0} "Remove blob storage reported success but failed to remove the account."

# Delete dataLakeAnalytics account
Assert-True {Remove-AdlAnalyticsAccount -ResourceGroupName $resourceGroupName -Name $accountName -Force -PassThru} "Remove Account failed."
Expand All @@ -167,6 +167,60 @@ function Test-DataLakeAnalyticsAccount
}


<#
.SYNOPSIS
Tests DataLakeAnalytics Account commitment tier (Create, Update, Get).
#>
function Test-DataLakeAnalyticsAccountTiers
{
param
(
$resourceGroupName = (Get-ResourceGroupName),
$accountName = (Get-DataLakeAnalyticsAccountName),
$dataLakeAccountName = (Get-DataLakeStoreAccountName),
$location = "West US"
)

try
{
# Creating Account and initial setup
New-AzureRmResourceGroup -Name $resourceGroupName -Location $location

# Test to make sure the account doesn't exist
Assert-False {Test-AdlAnalyticsAccount -ResourceGroupName $resourceGroupName -Name $accountName}
# Test it without specifying a resource group
Assert-False {Test-AdlAnalyticsAccount -Name $accountName}

New-AdlStore -ResourceGroupName $resourceGroupName -Name $dataLakeAccountName -Location $location

# Test 1: create account with no pricing tier and validate default
$accountCreated = New-AdlAnalyticsAccount -ResourceGroupName $resourceGroupName -Name $accountName -Location $location -DefaultDataLakeStore $dataLakeAccountName

Assert-AreEqual "Consumption" $accountCreated.CurrentTier
Assert-AreEqual "Consumption" $accountCreated.NewTier

# Test 2: update this account to have a new pricing tier
$accountUpdated = Set-AdlAnalyticsAccount -ResourceGroupName $resourceGroupName -Name $accountName -Tier Commitment100AUHours

Assert-AreEqual "Consumption" $accountUpdated.CurrentTier
Assert-AreEqual "Commitment100AUHours" $accountUpdated.NewTier

# Test 3: Create a new account with a tier specified
$secondAccountName = (Get-DataLakeAnalyticsAccountName)
$accountCreated = New-AdlAnalyticsAccount -ResourceGroupName $resourceGroupName -Name $secondAccountName -Location $location -DefaultDataLakeStore $dataLakeAccountName -Tier Commitment100AUHours
Assert-AreEqual "Commitment100AUHours" $accountCreated.CurrentTier
Assert-AreEqual "Commitment100AUHours" $accountCreated.NewTier
}
finally
{
# cleanup the resource group that was used in case it still exists. This is a best effort task, we ignore failures here.
Invoke-HandledCmdlet -Command {Remove-AdlAnalyticsAccount -ResourceGroupName $resourceGroupName -Name $accountName -Force -ErrorAction SilentlyContinue} -IgnoreFailures
Invoke-HandledCmdlet -Command {Remove-AdlAnalyticsAccount -ResourceGroupName $resourceGroupName -Name $secondAccountName -Force -ErrorAction SilentlyContinue} -IgnoreFailures
Invoke-HandledCmdlet -Command {Remove-AdlStore -ResourceGroupName $resourceGroupName -Name $dataLakeAccountName -Force -ErrorAction SilentlyContinue} -IgnoreFailures
Invoke-HandledCmdlet -Command {Remove-AzureRmResourceGroup -Name $resourceGroupName -Force -ErrorAction SilentlyContinue} -IgnoreFailures
}
}

<#
.SYNOPSIS
Tests DataLakeAnalytics Job Lifecycle (Submit, Get, List, Cancel and Get Debug data).
Expand All @@ -186,7 +240,7 @@ function Test-DataLakeAnalyticsJob
New-AzureRmResourceGroup -Name $resourceGroupName -Location $location
New-AdlStore -ResourceGroupName $resourceGroupName -Name $dataLakeAccountName -Location $location
$accountCreated = New-AdlAnalyticsAccount -ResourceGroupName $resourceGroupName -Name $accountName -Location $location -DefaultDataLakeStore $dataLakeAccountName
$nowTime = $accountCreated.Properties.CreationTime
$nowTime = $accountCreated.CreationTime
Assert-AreEqual $accountName $accountCreated.Name
Assert-AreEqual $location $accountCreated.Location
Assert-AreEqual "Microsoft.DataLakeAnalytics/accounts" $accountCreated.Type
Expand All @@ -196,7 +250,7 @@ function Test-DataLakeAnalyticsJob
for ($i = 0; $i -le 60; $i++)
{
[array]$accountGet = Get-AdlAnalyticsAccount -ResourceGroupName $resourceGroupName -Name $accountName
if ($accountGet[0].Properties.ProvisioningState -like "Succeeded")
if ($accountGet[0].ProvisioningState -like "Succeeded")
{
Assert-AreEqual $accountName $accountGet[0].Name
Assert-AreEqual $location $accountGet[0].Location
Expand All @@ -205,7 +259,7 @@ function Test-DataLakeAnalyticsJob
break
}

Write-Host "account not yet provisioned. current state: $($accountGet[0].Properties.ProvisioningState)"
Write-Host "account not yet provisioned. current state: $($accountGet[0].ProvisioningState)"
[Microsoft.Rest.ClientRuntime.Azure.TestFramework.TestUtilities]::Wait(30000)
Assert-False {$i -eq 60} "dataLakeAnalytics accounts not in succeeded state even after 30 min."
}
Expand Down Expand Up @@ -288,7 +342,7 @@ function Test-NegativeDataLakeAnalyticsAccount
for ($i = 0; $i -le 60; $i++)
{
[array]$accountGet = Get-AdlAnalyticsAccount -ResourceGroupName $resourceGroupName -Name $accountName
if ($accountGet[0].Properties.ProvisioningState -like "Succeeded")
if ($accountGet[0].ProvisioningState -like "Succeeded")
{
Assert-AreEqual $accountName $accountGet[0].Name
Assert-AreEqual $location $accountGet[0].Location
Expand All @@ -297,7 +351,7 @@ function Test-NegativeDataLakeAnalyticsAccount
break
}

Write-Host "account not yet provisioned. current state: $($accountGet[0].Properties.ProvisioningState)"
Write-Host "account not yet provisioned. current state: $($accountGet[0].ProvisioningState)"
[Microsoft.Rest.ClientRuntime.Azure.TestFramework.TestUtilities]::Wait(30000)
Assert-False {$i -eq 60} "dataLakeAnalytics accounts not in succeeded state even after 30 min."
}
Expand Down Expand Up @@ -351,7 +405,7 @@ function Test-NegativeDataLakeAnalyticsJob
New-AzureRmResourceGroup -Name $resourceGroupName -Location $location
New-AdlStore -ResourceGroupName $resourceGroupName -Name $dataLakeAccountName -Location $location
$accountCreated = New-AdlAnalyticsAccount -ResourceGroupName $resourceGroupName -Name $accountName -Location $location -DefaultDataLakeStore $dataLakeAccountName
$nowTime = $accountCreated.Properties.CreationTime
$nowTime = $accountCreated.CreationTime
Assert-AreEqual $accountName $accountCreated.Name
Assert-AreEqual $location $accountCreated.Location
Assert-AreEqual "Microsoft.DataLakeAnalytics/accounts" $accountCreated.Type
Expand All @@ -361,7 +415,7 @@ function Test-NegativeDataLakeAnalyticsJob
for ($i = 0; $i -le 60; $i++)
{
[array]$accountGet = Get-AdlAnalyticsAccount -ResourceGroupName $resourceGroupName -Name $accountName
if ($accountGet[0].Properties.ProvisioningState -like "Succeeded")
if ($accountGet[0].ProvisioningState -like "Succeeded")
{
Assert-AreEqual $accountName $accountGet[0].Name
Assert-AreEqual $location $accountGet[0].Location
Expand All @@ -370,7 +424,7 @@ function Test-NegativeDataLakeAnalyticsJob
break
}

Write-Host "account not yet provisioned. current state: $($accountGet[0].Properties.ProvisioningState)"
Write-Host "account not yet provisioned. current state: $($accountGet[0].ProvisioningState)"
[Microsoft.Rest.ClientRuntime.Azure.TestFramework.TestUtilities]::Wait(30000)
Assert-False {$i -eq 60} "dataLakeAnalytics accounts not in succeeded state even after 30 min."
}
Expand Down Expand Up @@ -441,7 +495,7 @@ function Test-DataLakeAnalyticsCatalog
for ($i = 0; $i -le 60; $i++)
{
[array]$accountGet = Get-AdlAnalyticsAccount -ResourceGroupName $resourceGroupName -Name $accountName
if ($accountGet[0].Properties.ProvisioningState -like "Succeeded")
if ($accountGet[0].ProvisioningState -like "Succeeded")
{
Assert-AreEqual $accountName $accountGet[0].Name
Assert-AreEqual $location $accountGet[0].Location
Expand All @@ -450,7 +504,7 @@ function Test-DataLakeAnalyticsCatalog
break
}

Write-Host "account not yet provisioned. current state: $($accountGet[0].Properties.ProvisioningState)"
Write-Host "account not yet provisioned. current state: $($accountGet[0].ProvisioningState)"
[Microsoft.Rest.ClientRuntime.Azure.TestFramework.TestUtilities]::Wait(30000)
Assert-False {$i -eq 60} "dataLakeAnalytics accounts not in succeeded state even after 30 min."
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ public void TestAdlaAccount()
AdlaTestsBase.resourceGroupLocation));
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestAdlaAccountTiers()
{
AdlaTestsBase.NewInstance.RunPsTest(true,
string.Format(
"Test-DataLakeAnalyticsAccountTiers -location '{0}'",
AdlaTestsBase.resourceGroupLocation));
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestAdlaCatalog()
Expand Down
Loading