Skip to content

HDInsight fixes #1437

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 2 commits into from
Dec 8, 2015
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
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@
</Reference>
<Reference Include="Microsoft.Azure.Management.HDInsight, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Microsoft.Azure.Management.HDInsight.1.0.8-preview\lib\net40\Microsoft.Azure.Management.HDInsight.dll</HintPath>
<HintPath>..\..\..\packages\Microsoft.Azure.Management.HDInsight.1.0.9-preview\lib\net40\Microsoft.Azure.Management.HDInsight.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Management.HDInsight.Job, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Microsoft.Azure.Management.HDInsight.Job.1.0.6-preview\lib\net40\Microsoft.Azure.Management.HDInsight.Job.dll</HintPath>
<HintPath>..\..\..\packages\Microsoft.Azure.Management.HDInsight.Job.1.0.7-preview\lib\net40\Microsoft.Azure.Management.HDInsight.Job.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Management.Storage">
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Storage.2.4.0-preview\lib\net40\Microsoft.Azure.Management.Storage.dll</HintPath>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<package id="Microsoft.Azure.Common.Dependencies" version="1.0.0" targetFramework="net45" />
<package id="Microsoft.Azure.Gallery" version="2.6.2-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Authorization" version="0.18.2-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Management.HDInsight" version="1.0.8-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Management.HDInsight.Job" version="1.0.6-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Management.HDInsight" version="1.0.9-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Management.HDInsight.Job" version="1.0.7-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Resources" version="2.18.0-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Storage" version="2.4.0-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Test.Framework" version="1.0.5774.40163-prerelease" targetFramework="net45" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,13 @@
<Reference Include="Microsoft.Azure.Graph.RBAC">
<HintPath>..\..\..\packages\Microsoft.Azure.Graph.RBAC.1.7.0-preview\lib\net40\Microsoft.Azure.Graph.RBAC.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Management.HDInsight">
<Reference Include="Microsoft.Azure.Management.HDInsight, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Microsoft.Azure.Management.HDInsight.1.0.8-preview\lib\net40\Microsoft.Azure.Management.HDInsight.dll</HintPath>
<HintPath>..\..\..\packages\Microsoft.Azure.Management.HDInsight.1.0.9-preview\lib\net40\Microsoft.Azure.Management.HDInsight.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Management.HDInsight.Job, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Microsoft.Azure.Management.HDInsight.Job.1.0.6-preview\lib\net40\Microsoft.Azure.Management.HDInsight.Job.dll</HintPath>
<HintPath>..\..\..\packages\Microsoft.Azure.Management.HDInsight.Job.1.0.7-preview\lib\net40\Microsoft.Azure.Management.HDInsight.Job.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.ResourceManager, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,83 @@ public string DefaultStorageAccountKey
set { parameters.DefaultStorageAccountKey = value; }
}

[Parameter(ValueFromPipeline = true,
HelpMessage = "The HDInsight cluster configuration to use when creating the new cluster.")]
public AzureHDInsightConfig Config
{
get
{
var result = new AzureHDInsightConfig
{
ClusterType = parameters.ClusterType,
DefaultStorageAccountName = parameters.DefaultStorageAccountName,
DefaultStorageAccountKey = parameters.DefaultStorageAccountKey,
WorkerNodeSize = parameters.WorkerNodeSize,
HeadNodeSize = parameters.HeadNodeSize,
ZookeeperNodeSize = parameters.ZookeeperNodeSize,
HiveMetastore = HiveMetastore,
OozieMetastore = OozieMetastore,
ObjectId = ObjectId,
AADTenantId = AadTenantId,
CertificateFilePath = CertificateFilePath,
CertificatePassword = CertificatePassword
};
foreach (
var storageAccount in
parameters.AdditionalStorageAccounts.Where(
storageAccount => !result.AdditionalStorageAccounts.ContainsKey(storageAccount.Key)))
{
result.AdditionalStorageAccounts.Add(storageAccount.Key, storageAccount.Value);
}
foreach (var val in parameters.Configurations.Where(val => !result.Configurations.ContainsKey(val.Key)))
{
result.Configurations.Add(val.Key, DictionaryToHashtable(val.Value));
}
foreach (var action in parameters.ScriptActions.Where(action => !result.ScriptActions.ContainsKey(action.Key)))
{
result.ScriptActions.Add(action.Key, action.Value.Select(a => new AzureHDInsightScriptAction(a)).ToList());
}
return result;
}
set
{
parameters.ClusterType = value.ClusterType;
if (parameters.DefaultStorageAccountName == null)
{
parameters.DefaultStorageAccountName = value.DefaultStorageAccountName;
}
if (parameters.DefaultStorageAccountKey == null)
{
parameters.DefaultStorageAccountKey = value.DefaultStorageAccountKey;
}
parameters.WorkerNodeSize = value.WorkerNodeSize;
parameters.HeadNodeSize = value.HeadNodeSize;
parameters.ZookeeperNodeSize = value.ZookeeperNodeSize;
HiveMetastore = value.HiveMetastore;
OozieMetastore = value.OozieMetastore;
CertificateFilePath = value.CertificateFilePath;
AadTenantId = value.AADTenantId;
ObjectId = value.ObjectId;
CertificatePassword = value.CertificatePassword;

foreach (
var storageAccount in
value.AdditionalStorageAccounts.Where(
storageAccount => !parameters.AdditionalStorageAccounts.ContainsKey(storageAccount.Key)))
{
parameters.AdditionalStorageAccounts.Add(storageAccount.Key, storageAccount.Value);
}
foreach (var val in value.Configurations.Where(val => !parameters.Configurations.ContainsKey(val.Key)))
{
parameters.Configurations.Add(val.Key, HashtableToDictionary(val.Value));
}
foreach (var action in value.ScriptActions.Where(action => !parameters.ScriptActions.ContainsKey(action.Key)))
{
parameters.ScriptActions.Add(action.Key, action.Value.Select(a => a.GetScriptActionFromPSModel()).ToList());
}
}
}

[Parameter(HelpMessage = "Gets or sets the database to store the metadata for Oozie.")]
public AzureHDInsightMetastore OozieMetastore { get; set; }

Expand Down Expand Up @@ -203,76 +280,6 @@ public DateTime RdpAccessExpiry
[Parameter(HelpMessage = "Gets or sets the Service Principal AAD Tenant Id for accessing Azure Data Lake.", ParameterSetName = "ServicePrincipal")]
public Guid AadTenantId { get; set; }

[Parameter(ValueFromPipeline = true,
HelpMessage = "The HDInsight cluster configuration to use when creating the new cluster.")]
public AzureHDInsightConfig Config {
get
{
var result = new AzureHDInsightConfig
{
ClusterType = parameters.ClusterType,
DefaultStorageAccountName = parameters.DefaultStorageAccountName,
DefaultStorageAccountKey = parameters.DefaultStorageAccountKey,
WorkerNodeSize = parameters.WorkerNodeSize,
HeadNodeSize = parameters.HeadNodeSize,
ZookeeperNodeSize = parameters.ZookeeperNodeSize,
HiveMetastore = HiveMetastore,
OozieMetastore = OozieMetastore,
ObjectId = ObjectId,
AADTenantId = AadTenantId,
CertificateFilePath = CertificateFilePath,
CertificatePassword = CertificatePassword
};
foreach (
var storageAccount in
parameters.AdditionalStorageAccounts.Where(
storageAccount => !result.AdditionalStorageAccounts.ContainsKey(storageAccount.Key)))
{
result.AdditionalStorageAccounts.Add(storageAccount.Key, storageAccount.Value);
}
foreach (var val in parameters.Configurations.Where(val => !result.Configurations.ContainsKey(val.Key)))
{
result.Configurations.Add(val.Key, DictionaryToHashtable(val.Value));
}
foreach (var action in parameters.ScriptActions.Where(action => !result.ScriptActions.ContainsKey(action.Key)))
{
result.ScriptActions.Add(action.Key, action.Value.Select(a => new AzureHDInsightScriptAction(a)).ToList());
}
return result;
}
set
{
parameters.ClusterType = value.ClusterType;
parameters.DefaultStorageAccountName = value.DefaultStorageAccountName;
parameters.DefaultStorageAccountKey = value.DefaultStorageAccountKey;
parameters.WorkerNodeSize = value.WorkerNodeSize;
parameters.HeadNodeSize = value.HeadNodeSize;
parameters.ZookeeperNodeSize = value.ZookeeperNodeSize;
HiveMetastore = value.HiveMetastore;
OozieMetastore = value.OozieMetastore;
CertificateFilePath = value.CertificateFilePath;
AadTenantId = value.AADTenantId;
ObjectId = value.ObjectId;
CertificatePassword = value.CertificatePassword;

foreach (
var storageAccount in
value.AdditionalStorageAccounts.Where(
storageAccount => !parameters.AdditionalStorageAccounts.ContainsKey(storageAccount.Key)))
{
parameters.AdditionalStorageAccounts.Add(storageAccount.Key, storageAccount.Value);
}
foreach (var val in value.Configurations.Where(val => !parameters.Configurations.ContainsKey(val.Key)))
{
parameters.Configurations.Add(val.Key, HashtableToDictionary(val.Value));
}
foreach (var action in value.ScriptActions.Where(action => !parameters.ScriptActions.ContainsKey(action.Key)))
{
parameters.ScriptActions.Add(action.Key, action.Value.Select(a => a.GetScriptActionFromPSModel()).ToList());
}
}
}

#endregion


Expand Down Expand Up @@ -336,9 +343,9 @@ var storageAccount in
}
if (CertificateFilePath != null && CertificatePassword != null)
{
Microsoft.Azure.Management.HDInsight.Models.ServicePrincipal servicePrincipal =
new Microsoft.Azure.Management.HDInsight.Models.ServicePrincipal(
GetApplicationId(), GetTenantId(AadTenantId), File.ReadAllBytes(CertificateFilePath), CertificatePassword);
var servicePrincipal = new Management.HDInsight.Models.ServicePrincipal(
GetApplicationId(), GetTenantId(AadTenantId), File.ReadAllBytes(CertificateFilePath),
CertificatePassword);
parameters.Principal = servicePrincipal;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<package id="Microsoft.Azure.Common.Authentication" version="1.4.0-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Dependencies" version="1.0.0" targetFramework="net45" />
<package id="Microsoft.Azure.Graph.RBAC" version="1.7.0-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Management.HDInsight" version="1.0.8-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Management.HDInsight.Job" version="1.0.6-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Management.HDInsight" version="1.0.9-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Management.HDInsight.Job" version="1.0.7-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Resources" version="2.18.7-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Test.HttpRecorder" version="1.0.5774.40163-prerelease" targetFramework="net45" />
<package id="Microsoft.Bcl" version="1.1.9" targetFramework="net45" />
Expand Down