Skip to content

Conversation

@benyoka
Copy link
Contributor

@benyoka benyoka commented Mar 20, 2018

What changes were proposed in this pull request?

Improvements for blueprint installation and export.

  • mpack information is exported
  • fixed the NPE during blueprint export

How was this patch tested?

Fixes were tested manually.

Unit test run results (updated):

Tests run: 4890, Failures: 27, Errors: 64, Skipped: 43 (this branch)
(the extra failing test: CredentialStoreTest.testInMemoryCredentialStoreService_CredentialExpired was successfully re-run)

vs

Tests run: 4890, Failures: 28, Errors: 63, Skipped: 43 (feature branch)

@adoroszlai adoroszlai changed the title Ambari 23032 branch feature ambari 14714 [AMBARI-23032] Support for Blueprint exports for MPack-based clusters Mar 20, 2018
@asfgit
Copy link

asfgit commented Mar 20, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/Ambari-Github-PullRequest-Builder/1249/
Test FAILed.
Test FAILured.

@asfgit
Copy link

asfgit commented Mar 20, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/Ambari-Github-PullRequest-Builder/1250/
Test FAILed.
Test FAILured.

Copy link

@rnettleton rnettleton left a comment

Choose a reason for hiding this comment

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

Overall, this patch looks fine to me, just a minor issue in the javadocs that needs clarification.

One question: Is there a unit test that reproduces the NullPointerException that was occurring during Blueprint exports? If not, could you please add a unit test to this patch to verify that fix.

Thanks.


/**
* @return the mpack associated with this component (can be {@code null} if component -> mpack mapping is unambiguous)
* @return the mpack associated with this component as {@link String} (can be {@code null} if component -> mpack mapping is unambiguous)

Choose a reason for hiding this comment

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

Minor issue in the javadocs:

Wouldn't this method return null if the mpack mapping was ambiguous, rather than unambiguous?

@benyoka
Copy link
Contributor Author

benyoka commented Mar 20, 2018

Hey @rnettleton, re unit test: actually it's a bit difficult. The cause of the issue was that the internals of AmbariContext changed. AmbariContext is normally created by Guice with its dependencies injected but ClusterBlueprintRenderer simply instantiated it (this was a wrong approach, but hadn't cause an error until the internals had changed and the code path was hitting an uninitialized dependency). I changed the implementation so that ClusterBlueprintRenderer uses a properly injected instance. Unfortunately writing a unit test for this would require setting up mocks for AmbariContext and the test would only prove whether mocks were properly set up.

Copy link
Contributor

@adoroszlai adoroszlai left a comment

Choose a reason for hiding this comment

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

The change works fine, except that the "Blueprints" key is not present in the result. This causes problem when trying to create a new cluster using the exported blueprint:

Creating security configuration from properties: null
NullPointerException
        at org.apache.ambari.server.topology.SecurityConfigurationFactory.createSecurityConfigurationFromRequest(SecurityConfigurationFactory.java:76)
        at org.apache.ambari.server.controller.internal.BlueprintResourceProvider$7.invoke(BlueprintResourceProvider.java:531)

@asfgit
Copy link

asfgit commented Mar 22, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/Ambari-Github-PullRequest-Builder/1306/
Test FAILed.
Test FAILured.

@benyoka
Copy link
Contributor Author

benyoka commented Mar 23, 2018

@adoroszlai please check out the latest commit re exported "Blueprints" key.

@asfgit
Copy link

asfgit commented Mar 24, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/Ambari-Github-PullRequest-Builder/1355/
Test FAILed.
Test FAILured.

@benyoka benyoka merged commit 17e3a1d into apache:branch-feature-AMBARI-14714 Mar 26, 2018
@asfgit
Copy link

asfgit commented Mar 26, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/Ambari-Github-PullRequest-Builder/1389/
Test FAILed.
Test FAILured.

@asfgit
Copy link

asfgit commented Mar 27, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/Ambari-Github-PullRequest-Builder/1399/
Test FAILed.
Test FAILured.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants