You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by nc...@apache.org on 2016/09/19 15:31:59 UTC

[08/11] ambari git commit: AMBARI-18349. Specify role command order to make Microsoft-R service check run after YARN is started. (Attila Doroszlai via stoader)

AMBARI-18349. Specify role command order to make Microsoft-R service check run after YARN is started. (Attila Doroszlai via stoader)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/335ef6e9
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/335ef6e9
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/335ef6e9

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 335ef6e9a2c140f79e3ccc11dec703ef9e0afe50
Parents: 8ce129b
Author: Attila Doroszlai <ad...@hortonworks.com>
Authored: Mon Sep 19 15:02:13 2016 +0200
Committer: Toader, Sebastian <st...@hortonworks.com>
Committed: Mon Sep 19 15:02:13 2016 +0200

----------------------------------------------------------------------
 .../before-START/scripts/shared_initialization.py   | 16 ++++++++++++++++
 .../8.0.0/package/scripts/service_check.py          |  1 +
 .../MICROSOFT_R/8.0.0/role_command_order.json       |  6 ++++++
 3 files changed, 23 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/335ef6e9/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/shared_initialization.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/shared_initialization.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/shared_initialization.py
index ff52b31..8f845d2 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/shared_initialization.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/shared_initialization.py
@@ -107,6 +107,8 @@ def setup_hadoop():
     if params.dfs_type == 'HCFS' and params.has_core_site and 'ECS_CLIENT' in params.component_list:
        create_dirs()
 
+    create_microsoft_r_dir()
+
 
 def setup_configs():
   """
@@ -173,3 +175,17 @@ def create_dirs():
                       action="execute"
    )
 
+def create_microsoft_r_dir():
+  import params
+  if 'MICROSOFT_R_CLIENT' in params.component_list and params.default_fs:
+    directory = '/user/RevoShare'
+    try:
+      params.HdfsResource(directory,
+                          type="directory",
+                          action="create_on_execute",
+                          owner=params.hdfs_user,
+                          mode=0777)
+      params.HdfsResource(None, action="execute")
+    except Exception as exception:
+      Logger.warning("Could not check the existence of {0} on DFS while starting {1}, exception: {2}".format(directory, params.current_service, str(exception)))
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/335ef6e9/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/package/scripts/service_check.py
----------------------------------------------------------------------
diff --git a/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/package/scripts/service_check.py b/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/package/scripts/service_check.py
index 547476b..5368e94 100644
--- a/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/package/scripts/service_check.py
+++ b/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/package/scripts/service_check.py
@@ -45,6 +45,7 @@ class MicrosoftRServiceCheckLinux(MicrosoftRServiceCheck):
                           action="create_on_execute",
                           owner=params.hdfs_user,
                           mode=0777)
+      params.HdfsResource(None, action="execute")
     except Exception as exception:
         Logger.warning("Could not check the existence of /user/RevoShare on HDFS, exception: {0}".format(str(exception)))
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/335ef6e9/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/role_command_order.json
----------------------------------------------------------------------
diff --git a/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/role_command_order.json b/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/role_command_order.json
new file mode 100755
index 0000000..6edbc2c
--- /dev/null
+++ b/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/role_command_order.json
@@ -0,0 +1,6 @@
+{
+  "general_deps" : {
+    "_comment" : "dependencies for Microsoft R",
+    "MICROSOFT_R_SERVICE_CHECK-SERVICE_CHECK": ["NODEMANAGER-START"]
+  }
+}