Return-Path: X-Original-To: apmail-ambari-commits-archive@www.apache.org Delivered-To: apmail-ambari-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2E51A1787D for ; Thu, 5 Feb 2015 23:20:27 +0000 (UTC) Received: (qmail 61790 invoked by uid 500); 5 Feb 2015 23:20:27 -0000 Delivered-To: apmail-ambari-commits-archive@ambari.apache.org Received: (qmail 61753 invoked by uid 500); 5 Feb 2015 23:20:27 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 61675 invoked by uid 99); 5 Feb 2015 23:20:27 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Feb 2015 23:20:27 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id D07BDE040E; Thu, 5 Feb 2015 23:20:26 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: abaranchuk@apache.org To: commits@ambari.apache.org Date: Thu, 05 Feb 2015 23:20:27 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [2/2] ambari git commit: AMBARI-35 - Monarch: preupload oozie files not executed (Ivan Kozlov via abaranchuk) AMBARI-35 - Monarch: preupload oozie files not executed (Ivan Kozlov via abaranchuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/50ee8e02 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/50ee8e02 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/50ee8e02 Branch: refs/heads/trunk Commit: 50ee8e02993e3d34ea46dc81dffbbf2c02348332 Parents: de026eb Author: Artem Baranchuk Authored: Fri Feb 6 01:19:20 2015 +0200 Committer: Artem Baranchuk Committed: Fri Feb 6 01:19:20 2015 +0200 ---------------------------------------------------------------------- .../src/main/resources/scripts/Ambaripreupload.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/50ee8e02/ambari-server/src/main/resources/scripts/Ambaripreupload.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/scripts/Ambaripreupload.py b/ambari-server/src/main/resources/scripts/Ambaripreupload.py index 7a6bf67..89e0742 100644 --- a/ambari-server/src/main/resources/scripts/Ambaripreupload.py +++ b/ambari-server/src/main/resources/scripts/Ambaripreupload.py @@ -63,6 +63,8 @@ class params(): hadoop_conf_dir = "/etc/hadoop/conf" user_group = "hadoop" security_enabled = False + oozie_user = "oozie" + execute_path = "/usr/hdp/current/hadoop-client/bin" params = params() @@ -255,8 +257,17 @@ with Environment() as env: oozie_cmd = format("{put_shared_lib_to_hdfs_cmd} ; hadoop --config {hadoop_conf_dir} dfs -chmod -R 755 {oozie_hdfs_user_dir}/share") not_if_command = format("{kinit_if_needed} hadoop --config {hadoop_conf_dir} dfs -ls /user/oozie/share | awk 'BEGIN {{count=0;}} /share/ {{count++}} END {{if (count > 0) {{exit 0}} else {{exit 1}}}}'") - - #Execute(format("hadoop --config {hadoop_conf_dir} dfs -mkdir { + HdfsDirectory(format("{oozie_hdfs_user_dir}/share"), + action="create", + owner=oozie_user, + mode=0555, + conf_dir=params.hadoop_conf_dir, + hdfs_user=params.hdfs_user, + ) + + Execute( oozie_cmd, user = params.oozie_user, not_if = not_if_command, + path = params.execute_path ) + copy_tarballs_to_hdfs("/usr/hdp/current/hadoop-client/mapreduce.tar.gz", "wasb:///hdp/apps/{{ hdp_stack_version }}/mapreduce/", 'hadoop-mapreduce-historyserver', params.mapred_user, params.hdfs_user, params.user_group) copy_tarballs_to_hdfs("/usr/hdp/current/tez-client/lib/tez.tar.gz", "wasb:///hdp/apps/{{ hdp_stack_version }}/tez/", 'hadoop-mapreduce-historyserver', params.mapred_user, params.hdfs_user, params.user_group) copy_tarballs_to_hdfs("/usr/hdp/current/hive-client/hive.tar.gz", "wasb:///hdp/apps/{{ hdp_stack_version }}/hive/", 'hadoop-mapreduce-historyserver', params.mapred_user, params.hdfs_user, params.user_group)