Skip to content
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

AMBARI-23206 - Use Agent Command Response To Update Mpack Install State #668

Merged
merged 3 commits into from Mar 15, 2018
Merged

Conversation

jonathan-hurley
Copy link
Member

What changes were proposed in this pull request?

A continuation of AMBARI-23205, this will allow commands (like INSTALL and install_packages) to update the management pack installation state. They currently are stuck at NOT_INSTALLED.

How was this patch tested?

Manual testing of installation states.

@jonathan-hurley jonathan-hurley self-assigned this Mar 15, 2018
@jonathan-hurley jonathan-hurley requested review from ncole, a user and hapylestat March 15, 2018 14:35
@asfgit
Copy link

asfgit commented Mar 15, 2018

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

Logger.info("Reporting installation state for {0}".format(command_repository))

self.put_structured_out({"mpackId": command_repository.mpack_id})
self.put_structured_out({"mpackName":command_repository.mpack_id})
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this for the future? The id is the mpackName?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, this is a bug - nice catch. Turns out we're not actually using the mpack name in the structured output, but I'll update it to be correct.

… structured output of the mpack associated with the command
*/
private static class InstallCommandStructuredOutput {
/**
* Either SUCCESS or FAIL
Copy link

Choose a reason for hiding this comment

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

can it be IN_PROGRESS or something like that? Would agent send FAIL after sudden agent restart?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, actually - I don't even think this field is going to be used. The CommandReportReceivedEvent is only sent when the command is in a completed state:

      if (HostRoleStatus.valueOf(report.getStatus()).isCompletedState()) {
        CommandReportReceivedEvent event = new CommandReportReceivedEvent(
            clusterId, hostname, report);

        commandReportEventPublisher.publish(event);
      }

@asfgit
Copy link

asfgit commented Mar 15, 2018

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

@jonathan-hurley jonathan-hurley merged commit 239d782 into apache:branch-feature-AMBARI-14714 Mar 15, 2018
@jonathan-hurley jonathan-hurley deleted the AMBARI-23206 branch March 15, 2018 20:33
@asfgit
Copy link

asfgit commented Mar 16, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants