Skip to content

Adding support for creating HDInsight clusters with Datalake storage as default filesystem #3224

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 10 commits into from
Dec 8, 2016
Merged

Conversation

srsiva
Copy link
Contributor

@srsiva srsiva commented Nov 24, 2016

Description

Adding support for creating HDInsight clusters with Datalake storage as default filesystem


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

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.
  • The pull request does not introduce breaking changes (unless a major version change occurs in the assembly and module).

Testing Guidelines

  • Pull request includes test coverage for the included changes.
  • PowerShell scripts used in tests should do any necessary setup as part of the test or suite setup, and should not use hard-coded values for locations or existing resources.

Cmdlet Signature Guidelines

  • New cmdlets that make changes or have side effects should implement ShouldProcess and have SupportShouldProcess=true specified in the cmdlet attribute. You can find more information on ShouldProcess here.
  • Cmdlet specifies OutputType attribute if any output is produced - if the cmdlet produces no output, it should implement a PassThrough parameter.

Cmdlet Parameter Guidelines

  • Parameter types should not expose types from the management library - complex parameter types should be defined in the module.
  • Complex parameter types are discouraged - a parameter type should be simple types as often as possible. If complex types are used, they should be shallow and easily creatable from a constructor or another cmdlet.
  • Cmdlet parameter sets should be mutually exclusive - each parameter set must have at least one mandatory parameter not in other parameter sets.

@azurecla
Copy link

Hi @srsiva, I'm your friendly neighborhood Azure Pull Request Bot (You can call me AZPRBOT). Thanks for your contribution!


It looks like you're working at Microsoft (sisankar). If you're full-time, we DON'T require a contribution license agreement.



If you are a vendor, DO please sign the electronic contribution license agreement. It will take 2 minutes and there's no faxing! https://cla.azure.com.

TTYL, AZPRBOT;

@azuresdkci
Copy link

Can one of the admins verify this patch?

@shahabhijeet
Copy link
Contributor

@srsiva add to whitelist

@@ -10,11 +10,18 @@ public DataLakeStoreScenarioTests(Xunit.Abstractions.ITestOutputHelper output)
ServiceManagemenet.Common.Models.XunitTracingInterceptor.AddToContext(new ServiceManagemenet.Common.Models.XunitTracingInterceptor(output));
}

[Fact]
[Fact (Skip = "Test requires fixing GraphAPI by upgrading to latest test framework")]
Copy link
Contributor

Choose a reason for hiding this comment

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

@srsiva could clarify why this test is being skipped. Is it test framework issue or GraphApi issue.
Also make sure you put comment on the test itself as to why is this being skipped and what is the plan to enable it back again.
But at this time, it is not clear why is this being skipped.

Copy link
Member

Choose a reason for hiding this comment

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

@srsiva This is not a sufficient reason to skip this test. Please enable and re-record as necessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@markcowl , @shahabhijeet .

I had merged from Azure:dev.
The test framework has been upgraded to Microsoft.Azure.Test.Framework.1.0.6052.28118-prerelease and Graph SDK has been updated to Microsoft.Azure.Graph.RBAC.3.2.0-preview.

However, I am having trouble with getting these upgrades to work with the code.
When I remove the "skip", the NewAzureRmHDInsightCluster cmdlet calls GetApplicationId, which in turn eventually calls MockClientFactory.CreateCustomArmClient.
This function tries to find a management client that it can use (TClient client = ManagementClients.FirstOrDefault(o => o is TClient) as TClient;), fails and then tries to create a real-client by reflecting and calling the constructor.
The problem is that it is not able to create a GraphRbacManagementClient because GraphRbacManagementClient does not have the expected constructor.

I then tried to setup the management client such that MockClientFactory.CreateCustomArmClient will find a client object that it can use directly (and avoid trying to create a real-client via reflection).

I added the code below to HDInsightScenarioTestsBase.cs and expected this to work.
However TestBase.GetGraphServiceClient is throwing a null reference exception...I am not sure why. I am not able to find the code for the TestBase class.
protected void SetupManagementClients()
{
var hdinsightManagementClient = GetHdInsightManagementClient();
var graphRbacManagementClient = TestBase.GetGraphServiceClient(this.csmTestFactory);

        helper.SetupSomeOfManagementClients(hdinsightManagementClient, graphRbacManagementClient);
    }

Can you help me out with getting this to work ?

Thanks
Siva

Copy link
Member

Choose a reason for hiding this comment

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

The solution is to update the version of graph rbac manageemnt client you are using. You cna find examples of constructiung the new client here: http://azuresdkci.cloudapp.net/view/1-AzurePowerShell/job/powershell-demand/1313/

You should also be calling SetupManagementClients instead of SetupSomeOfManagementClients, this will make the test fail fast before runtime if client conbstruction fails.
Please ping us, or att

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@markcowl I had upgraded the graph rbac management client to 3.2.0-preview. It still didn't work.
I dug around a bit more and I figured that the new Graph Rbac mgmt client is auto-rest based...and HDInsight was trying to instantiate it using TestBase class from Microsoft.Azure.Test as opposed to Microsoft.Rest.ClientRuntime.Azure.TestFramework.

I tried to make the changes to instantiate HDInsightManagementClient by using Microsoft.Azure.Test ; and GraphRbacManagementClient by Microsoft.Rest.ClientRuntime.Azure.TestFramework....but I ran into some issues.

The call create a graphrbacmgmtclient -- context.GetGraphServiceClient(environment); requires an argument of type TestEnvironment.
The call to create an instance of TestEnvironment -- TestEnvironmentFactory.GetTestEnvironment(); -- fails with an exception "System.InvalidOperationException -- The current SynchronizationContext may not be used as a TaskScheduler".

I am not yet sure why I am running into this issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

On second thought, I think I can just remove the tests that are being skipped currently.

The New-AzureRmHDInsightCluster cmdlet follows the same code path for WASB and ADLS. The only difference between the tests is that the ADL-tests are converting ObjectId into ApplicationId by using GraphAPI.

After converting ObjectId into ApplicationId, the value is included in ClusterCreateParameters and then the SDK takes over by using the clusterCreateParameters to create the cluster.
The functionality that uses ClusterCreateParameters to create the cluster, is already being tested in SDK.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@markcowl, @shahabhijeet. I have removed the datalake scenario tests, based on the comments above.

[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestDataLakeStoreClusterCreate()
{
NewInstance.RunPsTest("Test-DataLakeStoreClusterCreate");
}

[Fact (Skip = "Test requires fixing GraphAPI by upgrading to latest test framework")]
Copy link
Contributor

Choose a reason for hiding this comment

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

@srsiva please be specific the reasons to skip any tests.

Copy link
Member

Choose a reason for hiding this comment

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

Same comment. Please fix the test and submit

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have removed the datalake scenario tests

<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.3.0\lib\net40\Microsoft.Azure.Management.HDInsight.dll</HintPath>
<Reference Include="Microsoft.Azure.Management.HDInsight">
Copy link
Contributor

Choose a reason for hiding this comment

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

how come the public key token and all are gone?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@shahabhijeet
Copy link
Contributor

@shefaliv seems you have approved changes. Could you confirm if you are fine with skipping tests? If yes, I am still not clear the reasons for skipping tests.

@markcowl
Copy link
Member

markcowl commented Dec 2, 2016

@srsiva @shefaliv If these tests are not useful, you should remove them. If they are useful, you should fix them. You should not skip them.

@markcowl
Copy link
Member

markcowl commented Dec 7, 2016

@shefaliv Are you ok with this test coverage being removed?

@markcowl
Copy link
Member

markcowl commented Dec 7, 2016

@shefaliv
Copy link
Contributor

shefaliv commented Dec 8, 2016

Approving the test removal as it is only testing the GraphAPI, which has its own tests by the owning team. Thanks!

@cormacpayne cormacpayne merged commit fc5f98c into Azure:dev Dec 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants