You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@slider.apache.org by sm...@apache.org on 2014/07/01 21:57:37 UTC

[1/2] git commit: SLIDER-190. Add projects to create command logger package as well as Slider app package

Repository: incubator-slider
Updated Branches:
  refs/heads/develop f53db8725 -> be94df3b4


SLIDER-190. Add projects to create command logger package as well as Slider app package


Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/be94df3b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/be94df3b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/be94df3b

Branch: refs/heads/develop
Commit: be94df3b49051dd929dd6dbb2736f9a0daac73b4
Parents: e879109
Author: Sumit Mohanty <sm...@hortonworks.com>
Authored: Tue Jul 1 11:25:30 2014 -0700
Committer: Sumit Mohanty <sm...@hortonworks.com>
Committed: Tue Jul 1 12:56:33 2014 -0700

----------------------------------------------------------------------
 .../command-logger/application-pkg/README.txt   |  24 +++++
 .../command-logger/slider-pkg/metainfo.xml      |   2 +-
 app-packages/command-logger/slider-pkg/pom.xml  |  17 +++-
 .../test_command_log/appConfig.json             |   6 +-
 .../test_command_log/appConfig_fast_no_reg.json |   6 +-
 .../test_command_log/appConfig_no_hb.json       |   6 +-
 .../test_command_log/configuration/cl-site.xml  |  34 -------
 .../app_packages/test_command_log/metainfo.xml  |  52 -----------
 .../package/files/command_log_10.tar            | Bin 2560 -> 0 bytes
 .../test_command_log/package/scripts/cl.py      |  89 -------------------
 .../test_command_log/package/scripts/params.py  |  31 -------
 .../package/templates/operations.log.j2         |  22 -----
 slider-funtest/pom.xml                          |  52 ++++++++++-
 .../lifecycle/AgentCommandTestBase.groovy       |  21 ++---
 14 files changed, 107 insertions(+), 255 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/be94df3b/app-packages/command-logger/application-pkg/README.txt
----------------------------------------------------------------------
diff --git a/app-packages/command-logger/application-pkg/README.txt b/app-packages/command-logger/application-pkg/README.txt
new file mode 100644
index 0000000..5596f30
--- /dev/null
+++ b/app-packages/command-logger/application-pkg/README.txt
@@ -0,0 +1,24 @@
+<!---
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+Command logger is a simple application that does not have any moving parts yet.
+Its sole purpose is to get packaged as a tarball that includes some static files
+suggesting how commands may be logged.
+
+TODO:
+* Add a daemon that gets activated when application is STARTED
+* Provide hooks to validate that daemon is behaving as expected
+* Provide hooks to inject failures

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/be94df3b/app-packages/command-logger/slider-pkg/metainfo.xml
----------------------------------------------------------------------
diff --git a/app-packages/command-logger/slider-pkg/metainfo.xml b/app-packages/command-logger/slider-pkg/metainfo.xml
index 845ad93..e17413d 100644
--- a/app-packages/command-logger/slider-pkg/metainfo.xml
+++ b/app-packages/command-logger/slider-pkg/metainfo.xml
@@ -42,7 +42,7 @@
         <packages>
           <package>
             <type>tarball</type>
-            <name>files/command_log.tar.gz</name>
+            <name>files/command_log.tar</name>
           </package>
         </packages>
       </osSpecific>

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/be94df3b/app-packages/command-logger/slider-pkg/pom.xml
----------------------------------------------------------------------
diff --git a/app-packages/command-logger/slider-pkg/pom.xml b/app-packages/command-logger/slider-pkg/pom.xml
index 72af03e..42ec8da 100644
--- a/app-packages/command-logger/slider-pkg/pom.xml
+++ b/app-packages/command-logger/slider-pkg/pom.xml
@@ -24,7 +24,7 @@
     <relativePath>../../../pom.xml</relativePath>
   </parent>
   <modelVersion>4.0.0</modelVersion>
-  <artifactId>command-logger-app-package</artifactId>
+  <artifactId>apache-slider-command-logger</artifactId>
   <packaging>pom</packaging>
   <name>Slider Command Logger App Package</name>
   <description>Slider Command Logger App Package</description>
@@ -92,6 +92,21 @@
           </execution>
         </executions>
       </plugin>
+
+      <plugin>
+        <groupId>org.apache.rat</groupId>
+        <artifactId>apache-rat-plugin</artifactId>
+        <version>${apache-rat-plugin.version}</version>
+        <executions>
+          <execution>
+            <id>check-licenses</id>
+            <goals>
+              <goal>check</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+
     </plugins>
   </build>
 

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/be94df3b/slider-core/src/test/app_packages/test_command_log/appConfig.json
----------------------------------------------------------------------
diff --git a/slider-core/src/test/app_packages/test_command_log/appConfig.json b/slider-core/src/test/app_packages/test_command_log/appConfig.json
index bd76c05..e7f9700 100644
--- a/slider-core/src/test/app_packages/test_command_log/appConfig.json
+++ b/slider-core/src/test/app_packages/test_command_log/appConfig.json
@@ -4,15 +4,15 @@
     },
     "global": {
         "agent.conf": "agent.ini",
-        "application.def": "cmd_log_app_pkg.zip",
+        "application.def": "apache-slider-command-logger.zip",
         "config_types": "cl-site",
         "java_home": "/usr/jdk64/jdk1.7.0_45",
-        "package_list": "files/command_log_10.tar",
+        "package_list": "files/command-logger.tar",
         "site.global.app_user": "yarn",
         "site.global.application_id": "CommandLogger",
         "site.global.app_log_dir": "${AGENT_LOG_ROOT}/app/log",
         "site.global.app_pid_dir": "${AGENT_WORK_ROOT}/app/run",
-        "site.global.app_root": "${AGENT_WORK_ROOT}/app/install/hbase-0.96.1-hadoop2",
+        "site.global.app_root": "${AGENT_WORK_ROOT}/app/install/command-logger",
         "site.global.app_install_dir": "${AGENT_WORK_ROOT}/app/install",
         "site.cl-site.logfile.location": "${AGENT_LOG_ROOT}/app/log/operations.log",
         "site.cl-site.datetime.format": "%A, %d. %B %Y %I:%M%p"

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/be94df3b/slider-core/src/test/app_packages/test_command_log/appConfig_fast_no_reg.json
----------------------------------------------------------------------
diff --git a/slider-core/src/test/app_packages/test_command_log/appConfig_fast_no_reg.json b/slider-core/src/test/app_packages/test_command_log/appConfig_fast_no_reg.json
index 1f495c6..57c935c 100644
--- a/slider-core/src/test/app_packages/test_command_log/appConfig_fast_no_reg.json
+++ b/slider-core/src/test/app_packages/test_command_log/appConfig_fast_no_reg.json
@@ -6,15 +6,15 @@
         "heartbeat.monitor.interval": "20000",
         "agent.instance.debug.data": "ANY:DO_NOT_REGISTER:NONE",
         "agent.conf": "agent.ini",
-        "application.def": "cmd_log_app_pkg.zip",
+        "application.def": "apache-slider-command-logger.zip",
         "config_types": "cl-site",
         "java_home": "/usr/jdk64/jdk1.7.0_45",
-        "package_list": "files/command_log_10.tar",
+        "package_list": "files/command-logger.tar",
         "site.global.app_user": "yarn",
         "site.global.application_id": "CommandLogger",
         "site.global.app_log_dir": "${AGENT_LOG_ROOT}/app/log",
         "site.global.app_pid_dir": "${AGENT_WORK_ROOT}/app/run",
-        "site.global.app_root": "${AGENT_WORK_ROOT}/app/install/hbase-0.96.1-hadoop2",
+        "site.global.app_root": "${AGENT_WORK_ROOT}/app/install/command-logger",
         "site.global.app_install_dir": "${AGENT_WORK_ROOT}/app/install",
         "site.cl-site.logfile.location": "${AGENT_LOG_ROOT}/app/log/operations.log",
         "site.cl-site.datetime.format": "%A, %d. %B %Y %I:%M%p"

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/be94df3b/slider-core/src/test/app_packages/test_command_log/appConfig_no_hb.json
----------------------------------------------------------------------
diff --git a/slider-core/src/test/app_packages/test_command_log/appConfig_no_hb.json b/slider-core/src/test/app_packages/test_command_log/appConfig_no_hb.json
index c824e03..e028140 100644
--- a/slider-core/src/test/app_packages/test_command_log/appConfig_no_hb.json
+++ b/slider-core/src/test/app_packages/test_command_log/appConfig_no_hb.json
@@ -6,15 +6,15 @@
         "heartbeat.monitor.interval": "20000",
         "agent.instance.debug.data": "ANY:DO_NOT_HEARTBEAT:DO_NOT_HEARTBEAT:NONE",
         "agent.conf": "agent.ini",
-        "application.def": "cmd_log_app_pkg.zip",
+        "application.def": "apache-slider-command-logger.zip",
         "config_types": "cl-site",
         "java_home": "/usr/jdk64/jdk1.7.0_45",
-        "package_list": "files/command_log_10.tar",
+        "package_list": "files/command-logger.tar",
         "site.global.app_user": "yarn",
         "site.global.application_id": "CommandLogger",
         "site.global.app_log_dir": "${AGENT_LOG_ROOT}/app/log",
         "site.global.app_pid_dir": "${AGENT_WORK_ROOT}/app/run",
-        "site.global.app_root": "${AGENT_WORK_ROOT}/app/install/hbase-0.96.1-hadoop2",
+        "site.global.app_root": "${AGENT_WORK_ROOT}/app/install/command-logger",
         "site.global.app_install_dir": "${AGENT_WORK_ROOT}/app/install",
         "site.cl-site.logfile.location": "${AGENT_LOG_ROOT}/app/log/operations.log",
         "site.cl-site.datetime.format": "%A, %d. %B %Y %I:%M%p"

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/be94df3b/slider-core/src/test/app_packages/test_command_log/configuration/cl-site.xml
----------------------------------------------------------------------
diff --git a/slider-core/src/test/app_packages/test_command_log/configuration/cl-site.xml b/slider-core/src/test/app_packages/test_command_log/configuration/cl-site.xml
deleted file mode 100644
index 977c8bc..0000000
--- a/slider-core/src/test/app_packages/test_command_log/configuration/cl-site.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
-<!--
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
--->
-<configuration>
-  <property>
-    <name>logfile.location</name>
-    <value>/tmp/logfiles/operations.log</value>
-    <description>The location where the log file is stored.</description>
-  </property>
-  <property>
-    <name>datetime.format</name>
-    <value>%A, %d. %B %Y %I:%M%p</value>
-    <description>The format to use.
-    </description>
-  </property>
-</configuration>

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/be94df3b/slider-core/src/test/app_packages/test_command_log/metainfo.xml
----------------------------------------------------------------------
diff --git a/slider-core/src/test/app_packages/test_command_log/metainfo.xml b/slider-core/src/test/app_packages/test_command_log/metainfo.xml
deleted file mode 100644
index 845ad93..0000000
--- a/slider-core/src/test/app_packages/test_command_log/metainfo.xml
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0"?>
-<!--
-   Licensed to the Apache Software Foundation (ASF) under one or more
-   contributor license agreements.  See the NOTICE file distributed with
-   this work for additional information regarding copyright ownership.
-   The ASF licenses this file to You under the Apache License, Version 2.0
-   (the "License"); you may not use this file except in compliance with
-   the License.  You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
--->
-<metainfo>
-  <schemaVersion>2.0</schemaVersion>
-  <application>
-    <name>TEST_COMMAND_LOG</name>
-    <comment>
-      When started it creates a new log file and stores all commands in the
-      log file. When stopped it renames the file.
-    </comment>
-    <version>0.1.0</version>
-    <components>
-      <component>
-        <name>COMMAND_LOGGER</name>
-        <category>MASTER</category>
-        <commandScript>
-          <script>scripts/cl.py</script>
-          <scriptType>PYTHON</scriptType>
-          <timeout>600</timeout>
-        </commandScript>
-      </component>
-    </components>
-
-    <osSpecifics>
-      <osSpecific>
-        <osType>any</osType>
-        <packages>
-          <package>
-            <type>tarball</type>
-            <name>files/command_log.tar.gz</name>
-          </package>
-        </packages>
-      </osSpecific>
-    </osSpecifics>
-
-  </application>
-</metainfo>

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/be94df3b/slider-core/src/test/app_packages/test_command_log/package/files/command_log_10.tar
----------------------------------------------------------------------
diff --git a/slider-core/src/test/app_packages/test_command_log/package/files/command_log_10.tar b/slider-core/src/test/app_packages/test_command_log/package/files/command_log_10.tar
deleted file mode 100644
index b8231d1..0000000
Binary files a/slider-core/src/test/app_packages/test_command_log/package/files/command_log_10.tar and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/be94df3b/slider-core/src/test/app_packages/test_command_log/package/scripts/cl.py
----------------------------------------------------------------------
diff --git a/slider-core/src/test/app_packages/test_command_log/package/scripts/cl.py b/slider-core/src/test/app_packages/test_command_log/package/scripts/cl.py
deleted file mode 100644
index 6b18faa..0000000
--- a/slider-core/src/test/app_packages/test_command_log/package/scripts/cl.py
+++ /dev/null
@@ -1,89 +0,0 @@
-#!/usr/bin/env python
-"""
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
-"""
-
-import sys
-import os
-from datetime import datetime
-from resource_management import *
-from resource_management.core.base import Fail
-
-
-class CommandLogger(Script):
-  def install(self, env):
-    self.install_packages(env)
-
-  def configure(self, env):
-    import params
-
-    env.set_params(params)
-
-  def start(self, env):
-    import params
-
-    env.set_params(params)
-    self.configure(env)
-    self.rename_file(env)
-    self.ensure_file(env)
-    self.check_and_log(env, "Starting instance.")
-
-  def stop(self, env):
-    import params
-
-    env.set_params(params)
-    self.check_and_log(env, "Stopping instance.")
-    self.rename_file(env)
-
-  def status(self, env):
-    Logger.info("Returning status as live.")
-
-  def check_and_log(self, env, message):
-    import params
-
-    file_location = params.file_location
-    datetime_format = params.datetime_format
-    if not os.path.isfile(file_location) or not os.access(file_location,
-                                                          os.W_OK):
-      raise Fail("File does not exist or not writable. %s" % file_location)
-    with open(file_location, "a") as logfile:
-      logfile.write("Time: " + datetime.utcnow().strftime(datetime_format) + "\n")
-      logfile.write("Log: " + message + "\n")
-      logfile.write("---------------\n")
-
-  def rename_file(self, env):
-    import params
-
-    file_location = params.file_location
-    if os.path.isfile(file_location) and \
-      os.access(file_location, os.W_OK):
-      new_file_name = \
-        file_location + "." + datetime.utcnow().strftime("%d_%m_%y_%I_%M_%S")
-      os.rename(file_location, new_file_name)
-
-  def ensure_file(self, env):
-    import params
-
-    file_location = params.file_location
-    TemplateConfig( file_location,
-                    owner = params.app_user,
-                    template_tag = None
-    )
-
-if __name__ == "__main__":
-  CommandLogger().execute()

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/be94df3b/slider-core/src/test/app_packages/test_command_log/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/slider-core/src/test/app_packages/test_command_log/package/scripts/params.py b/slider-core/src/test/app_packages/test_command_log/package/scripts/params.py
deleted file mode 100644
index 3d388ae..0000000
--- a/slider-core/src/test/app_packages/test_command_log/package/scripts/params.py
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/usr/bin/env python
-"""
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
-"""
-
-from resource_management import *
-
-# server configurations
-config = Script.get_config()
-
-container_id = config['hostLevelParams']['container_id']
-application_id = config['configurations']['global']['application_id']
-app_user = config['configurations']['global']['app_user']
-
-datetime_format = config['configurations']['cl-site']['datetime.format']
-file_location = config['configurations']['cl-site']['logfile.location']

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/be94df3b/slider-core/src/test/app_packages/test_command_log/package/templates/operations.log.j2
----------------------------------------------------------------------
diff --git a/slider-core/src/test/app_packages/test_command_log/package/templates/operations.log.j2 b/slider-core/src/test/app_packages/test_command_log/package/templates/operations.log.j2
deleted file mode 100644
index 8d6e879..0000000
--- a/slider-core/src/test/app_packages/test_command_log/package/templates/operations.log.j2
+++ /dev/null
@@ -1,22 +0,0 @@
-{#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#}
-
-This is a log for all operations on a Yarn container.
-Container Id: {{container_id}}
-Application id: {{application_id}}
----------------

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/be94df3b/slider-funtest/pom.xml
----------------------------------------------------------------------
diff --git a/slider-funtest/pom.xml b/slider-funtest/pom.xml
index 51b5cec..76785a0 100644
--- a/slider-funtest/pom.xml
+++ b/slider-funtest/pom.xml
@@ -27,6 +27,9 @@
     <artifactId>slider</artifactId>
     <version>0.31.0-incubating-SNAPSHOT</version>
   </parent>
+  <properties>
+    <work.dir>package-tmp</work.dir>
+  </properties>
 
   <build>
 
@@ -113,6 +116,7 @@
             <!-- this property must be supplied-->
             <slider.conf.dir>${slider.conf.dir}</slider.conf.dir>
             <slider.bin.dir>../slider-assembly/target/slider-${project.version}-all/slider-${project.version}</slider.bin.dir>
+            <test.app.pkg>target/package-tmp/apache-slider-command-logger.zip</test.app.pkg>
           </systemPropertyVariables>
           <includes>
             <include>**/Test*.java</include>
@@ -143,6 +147,45 @@
           </excludes>
         </configuration>
       </plugin>
+
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-dependency-plugin</artifactId>
+        <version>${maven-dependency-plugin.version}</version>
+        <executions>
+          <execution>
+            <id>copy-dependencies</id>
+            <phase>process-resources</phase>
+            <goals>
+              <goal>copy-dependencies</goal>
+            </goals>
+            <configuration>
+              <includeArtifactIds>apache-slider-command-logger</includeArtifactIds>
+              <includeTypes>zip</includeTypes>
+              <outputDirectory>${project.build.directory}/${work.dir}</outputDirectory>
+            </configuration>
+          </execution>
+          <execution>
+            <id>copy</id>
+            <phase>test</phase>
+            <goals>
+              <goal>copy</goal>
+            </goals>
+            <configuration>
+              <artifactItems>
+                <artifactItem>
+                  <groupId>org.apache.slider</groupId>
+                  <artifactId>apache-slider-command-logger</artifactId>
+                  <type>zip</type>
+                  <overWrite>false</overWrite>
+                  <outputDirectory>${project.build.directory}/${work.dir}</outputDirectory>
+                  <destFileName>apache-slider-command-logger.zip</destFileName>
+                </artifactItem>
+              </artifactItems>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
  
     </plugins>
   </build>
@@ -198,7 +241,14 @@
       <artifactId>hadoop-minicluster</artifactId>
       <scope>test</scope>
     </dependency>
-    
+
+    <dependency>
+      <groupId>org.apache.slider</groupId>
+      <artifactId>apache-slider-command-logger</artifactId>
+      <version>${project.version}</version>
+      <type>zip</type>
+    </dependency>
+
     <dependency>
       <groupId>org.apache.hbase</groupId>
       <artifactId>hbase-server</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/be94df3b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentCommandTestBase.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentCommandTestBase.groovy b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentCommandTestBase.groovy
index 33c0b81..daf102a 100644
--- a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentCommandTestBase.groovy
+++ b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentCommandTestBase.groovy
@@ -39,13 +39,15 @@ class AgentCommandTestBase extends CommandTestBase
 implements FuntestProperties, Arguments, SliderExitCodes, SliderActions {
 
   public static final boolean AGENTTESTS_ENABLED
+  private static String TEST_APP_PKG_PROP = "test.app.pkg"
+
 
   protected static String APP_RESOURCE = "../slider-core/src/test/app_packages/test_command_log/resources.json"
   protected static String APP_TEMPLATE = "../slider-core/src/test/app_packages/test_command_log/appConfig.json"
-  protected static String APP_PKG_DIR = "../slider-core/src/test/app_packages/test_command_log/"
   protected static String AGENT_CONF = "../slider-agent/conf/agent.ini"
-  protected static final File LOCAL_SLIDER_AGENT_TARGZ
   protected static final File LOCAL_AGENT_CONF
+  public static final String TEST_APP_PKG = sysprop(TEST_APP_PKG_PROP)
+
 
   protected static Path agentTarballPath;
   protected static Path appPkgPath;
@@ -83,24 +85,13 @@ implements FuntestProperties, Arguments, SliderExitCodes, SliderActions {
     AgentUploads agentUploads = new AgentUploads(SLIDER_CONFIG)
     agentUploads.uploader.mkHomeDir()
 
-    appPkgPath = new Path(clusterFS.homeDirectory, "cmd_log_app_pkg.zip")
+    appPkgPath = new Path(clusterFS.homeDirectory, "apache-slider-command-logger.zip")
     if (!clusterFS.exists(appPkgPath)) {
       clusterFS.delete(appPkgPath, false)
     }
 
-    def pkgPath = folder.newFolder("testpkg")
-    File zipFileName = new File(pkgPath, "cmd_log_app_pkg.zip").canonicalFile
-
-    def localZipDirectory = new File(APP_PKG_DIR)
-    assume(localZipDirectory.exists(), "App pkg dir not found at $APP_PKG_DIR")
-
-    zipDir(zipFileName.canonicalPath, APP_PKG_DIR)
-
-    // Verify and upload the app pkg
-    assume(zipFileName.exists(), "App pkg not found at $zipFileName")
-    Path localAppPkg = new Path(zipFileName.toURI());
+    File zipFileName = new File(TEST_APP_PKG).canonicalFile
     agentUploads.uploader.copyIfOutOfDate(zipFileName, appPkgPath, false)
-    
   }
 
   public static void logShell(SliderShell shell) {


[2/2] git commit: SLIDER-190. Add projects to create command logger package as well as Slider app package

Posted by sm...@apache.org.
SLIDER-190. Add projects to create command logger package as well as Slider app package


Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/e879109a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/e879109a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/e879109a

Branch: refs/heads/develop
Commit: e879109a45f255d63e3d32d5f8bb6d40a26e38e9
Parents: f53db87
Author: Sumit Mohanty <sm...@hortonworks.com>
Authored: Mon Jun 30 19:47:04 2014 -0700
Committer: Sumit Mohanty <sm...@hortonworks.com>
Committed: Tue Jul 1 12:56:33 2014 -0700

----------------------------------------------------------------------
 app-packages/command-logger/README.txt          |  22 ++++
 .../command-logger/application-pkg/pom.xml      |  83 ++++++++++++++
 .../src/command_logger/README.txt               |  18 ++++
 .../src/command_logger/operations.log           |  24 +++++
 .../src/packages/tarball/all.xml                |  35 ++++++
 .../command-logger/slider-pkg/appConfig.json    |  27 +++++
 .../slider-pkg/configuration/cl-site.xml        |  34 ++++++
 .../command-logger/slider-pkg/metainfo.xml      |  52 +++++++++
 .../slider-pkg/package/scripts/cl.py            |  89 +++++++++++++++
 .../slider-pkg/package/scripts/params.py        |  31 ++++++
 .../package/templates/operations.log.j2         |  22 ++++
 app-packages/command-logger/slider-pkg/pom.xml  | 107 +++++++++++++++++++
 .../command-logger/slider-pkg/resources.json    |  15 +++
 .../slider-pkg/src/assembly/command-logger.xml  |  78 ++++++++++++++
 app-packages/hbase/appConfig.json               |   4 +-
 pom.xml                                         |   2 +
 16 files changed, 641 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e879109a/app-packages/command-logger/README.txt
----------------------------------------------------------------------
diff --git a/app-packages/command-logger/README.txt b/app-packages/command-logger/README.txt
new file mode 100644
index 0000000..56a8a33
--- /dev/null
+++ b/app-packages/command-logger/README.txt
@@ -0,0 +1,22 @@
+<!---
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+Command logger is a test application used by Slider for functional tests.
+
+Like any typical Slider Application, there is a native application package
+in the form of a tarball that is created by project under application_pkg and
+there is a project under slider_pkg to create the Slider Application Package
+that is consumed by Slider.

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e879109a/app-packages/command-logger/application-pkg/pom.xml
----------------------------------------------------------------------
diff --git a/app-packages/command-logger/application-pkg/pom.xml b/app-packages/command-logger/application-pkg/pom.xml
new file mode 100644
index 0000000..7da7259
--- /dev/null
+++ b/app-packages/command-logger/application-pkg/pom.xml
@@ -0,0 +1,83 @@
+<?xml version="1.0"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+  <parent>
+    <groupId>org.apache.slider</groupId>
+    <artifactId>slider</artifactId>
+    <version>0.31.0-incubating-SNAPSHOT</version>
+    <relativePath>../../../pom.xml</relativePath>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>command-logger</artifactId>
+  <packaging>pom</packaging>
+  <name>Command Logger</name>
+  <description>Command Logger</description>
+  <properties>
+    <app.package.name>command-logger</app.package.name>
+  </properties>
+
+  <build>
+    <plugins>
+
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-assembly-plugin</artifactId>
+        <configuration>
+          <tarLongFileMode>gnu</tarLongFileMode>
+          <descriptor>src/packages/tarball/all.xml</descriptor>
+          <appendAssemblyId>false</appendAssemblyId>
+          <finalName>${app.package.name}</finalName>
+        </configuration>
+        <executions>
+          <execution>
+            <id>build-tarball</id>
+            <phase>package</phase>
+            <goals>
+              <goal>single</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+
+      <plugin>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>3.0</version>
+      </plugin>
+
+      <plugin>
+        <groupId>org.apache.rat</groupId>
+        <artifactId>apache-rat-plugin</artifactId>
+        <version>${apache-rat-plugin.version}</version>
+        <executions>
+          <execution>
+            <id>check-licenses</id>
+            <goals>
+              <goal>check</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+    <extensions>
+      <extension>
+        <groupId>org.apache.maven.wagon</groupId>
+        <artifactId>wagon-ssh-external</artifactId>
+      </extension>
+    </extensions>
+  </build>
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e879109a/app-packages/command-logger/application-pkg/src/command_logger/README.txt
----------------------------------------------------------------------
diff --git a/app-packages/command-logger/application-pkg/src/command_logger/README.txt b/app-packages/command-logger/application-pkg/src/command_logger/README.txt
new file mode 100644
index 0000000..19d2e26
--- /dev/null
+++ b/app-packages/command-logger/application-pkg/src/command_logger/README.txt
@@ -0,0 +1,18 @@
+<!---
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+
+All this project contains is a tarball that has a sample log file.

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e879109a/app-packages/command-logger/application-pkg/src/command_logger/operations.log
----------------------------------------------------------------------
diff --git a/app-packages/command-logger/application-pkg/src/command_logger/operations.log b/app-packages/command-logger/application-pkg/src/command_logger/operations.log
new file mode 100644
index 0000000..4604cdd
--- /dev/null
+++ b/app-packages/command-logger/application-pkg/src/command_logger/operations.log
@@ -0,0 +1,24 @@
+<!---
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+
+This is a log for all operations on a Yarn container.
+Container Id: Container001
+Application id: Application001
+---------------
+Time:
+Log:
+---------------

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e879109a/app-packages/command-logger/application-pkg/src/packages/tarball/all.xml
----------------------------------------------------------------------
diff --git a/app-packages/command-logger/application-pkg/src/packages/tarball/all.xml b/app-packages/command-logger/application-pkg/src/packages/tarball/all.xml
new file mode 100644
index 0000000..5c6080b
--- /dev/null
+++ b/app-packages/command-logger/application-pkg/src/packages/tarball/all.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.1"
+          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+          xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.1 http://maven.apache.org/xsd/assembly-1.1.1.xsd">
+  <!--This 'agent-all' id is not appended to the produced bundle because we do this:
+    http://maven.apache.org/plugins/maven-assembly-plugin/faq.html#required-classifiers
+  -->
+  <id>command-logger</id>
+  <formats>
+    <format>tar</format>
+  </formats>
+  <includeBaseDirectory>false</includeBaseDirectory>
+  <fileSets>
+    <fileSet>
+      <directory>src/command_logger</directory>
+      <outputDirectory>command-logger-app</outputDirectory>
+    </fileSet>
+  </fileSets>
+</assembly>

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e879109a/app-packages/command-logger/slider-pkg/appConfig.json
----------------------------------------------------------------------
diff --git a/app-packages/command-logger/slider-pkg/appConfig.json b/app-packages/command-logger/slider-pkg/appConfig.json
new file mode 100644
index 0000000..e7f9700
--- /dev/null
+++ b/app-packages/command-logger/slider-pkg/appConfig.json
@@ -0,0 +1,27 @@
+{
+    "schema": "http://example.org/specification/v2.0.0",
+    "metadata": {
+    },
+    "global": {
+        "agent.conf": "agent.ini",
+        "application.def": "apache-slider-command-logger.zip",
+        "config_types": "cl-site",
+        "java_home": "/usr/jdk64/jdk1.7.0_45",
+        "package_list": "files/command-logger.tar",
+        "site.global.app_user": "yarn",
+        "site.global.application_id": "CommandLogger",
+        "site.global.app_log_dir": "${AGENT_LOG_ROOT}/app/log",
+        "site.global.app_pid_dir": "${AGENT_WORK_ROOT}/app/run",
+        "site.global.app_root": "${AGENT_WORK_ROOT}/app/install/command-logger",
+        "site.global.app_install_dir": "${AGENT_WORK_ROOT}/app/install",
+        "site.cl-site.logfile.location": "${AGENT_LOG_ROOT}/app/log/operations.log",
+        "site.cl-site.datetime.format": "%A, %d. %B %Y %I:%M%p"
+    },
+    "components": {
+        "COMMAND_LOGGER": {
+        },
+        "slider-appmaster": {
+            "jvm.heapsize": "256M"
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e879109a/app-packages/command-logger/slider-pkg/configuration/cl-site.xml
----------------------------------------------------------------------
diff --git a/app-packages/command-logger/slider-pkg/configuration/cl-site.xml b/app-packages/command-logger/slider-pkg/configuration/cl-site.xml
new file mode 100644
index 0000000..977c8bc
--- /dev/null
+++ b/app-packages/command-logger/slider-pkg/configuration/cl-site.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+<!--
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+-->
+<configuration>
+  <property>
+    <name>logfile.location</name>
+    <value>/tmp/logfiles/operations.log</value>
+    <description>The location where the log file is stored.</description>
+  </property>
+  <property>
+    <name>datetime.format</name>
+    <value>%A, %d. %B %Y %I:%M%p</value>
+    <description>The format to use.
+    </description>
+  </property>
+</configuration>

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e879109a/app-packages/command-logger/slider-pkg/metainfo.xml
----------------------------------------------------------------------
diff --git a/app-packages/command-logger/slider-pkg/metainfo.xml b/app-packages/command-logger/slider-pkg/metainfo.xml
new file mode 100644
index 0000000..845ad93
--- /dev/null
+++ b/app-packages/command-logger/slider-pkg/metainfo.xml
@@ -0,0 +1,52 @@
+<?xml version="1.0"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+<metainfo>
+  <schemaVersion>2.0</schemaVersion>
+  <application>
+    <name>TEST_COMMAND_LOG</name>
+    <comment>
+      When started it creates a new log file and stores all commands in the
+      log file. When stopped it renames the file.
+    </comment>
+    <version>0.1.0</version>
+    <components>
+      <component>
+        <name>COMMAND_LOGGER</name>
+        <category>MASTER</category>
+        <commandScript>
+          <script>scripts/cl.py</script>
+          <scriptType>PYTHON</scriptType>
+          <timeout>600</timeout>
+        </commandScript>
+      </component>
+    </components>
+
+    <osSpecifics>
+      <osSpecific>
+        <osType>any</osType>
+        <packages>
+          <package>
+            <type>tarball</type>
+            <name>files/command_log.tar.gz</name>
+          </package>
+        </packages>
+      </osSpecific>
+    </osSpecifics>
+
+  </application>
+</metainfo>

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e879109a/app-packages/command-logger/slider-pkg/package/scripts/cl.py
----------------------------------------------------------------------
diff --git a/app-packages/command-logger/slider-pkg/package/scripts/cl.py b/app-packages/command-logger/slider-pkg/package/scripts/cl.py
new file mode 100644
index 0000000..6b18faa
--- /dev/null
+++ b/app-packages/command-logger/slider-pkg/package/scripts/cl.py
@@ -0,0 +1,89 @@
+#!/usr/bin/env python
+"""
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+"""
+
+import sys
+import os
+from datetime import datetime
+from resource_management import *
+from resource_management.core.base import Fail
+
+
+class CommandLogger(Script):
+  def install(self, env):
+    self.install_packages(env)
+
+  def configure(self, env):
+    import params
+
+    env.set_params(params)
+
+  def start(self, env):
+    import params
+
+    env.set_params(params)
+    self.configure(env)
+    self.rename_file(env)
+    self.ensure_file(env)
+    self.check_and_log(env, "Starting instance.")
+
+  def stop(self, env):
+    import params
+
+    env.set_params(params)
+    self.check_and_log(env, "Stopping instance.")
+    self.rename_file(env)
+
+  def status(self, env):
+    Logger.info("Returning status as live.")
+
+  def check_and_log(self, env, message):
+    import params
+
+    file_location = params.file_location
+    datetime_format = params.datetime_format
+    if not os.path.isfile(file_location) or not os.access(file_location,
+                                                          os.W_OK):
+      raise Fail("File does not exist or not writable. %s" % file_location)
+    with open(file_location, "a") as logfile:
+      logfile.write("Time: " + datetime.utcnow().strftime(datetime_format) + "\n")
+      logfile.write("Log: " + message + "\n")
+      logfile.write("---------------\n")
+
+  def rename_file(self, env):
+    import params
+
+    file_location = params.file_location
+    if os.path.isfile(file_location) and \
+      os.access(file_location, os.W_OK):
+      new_file_name = \
+        file_location + "." + datetime.utcnow().strftime("%d_%m_%y_%I_%M_%S")
+      os.rename(file_location, new_file_name)
+
+  def ensure_file(self, env):
+    import params
+
+    file_location = params.file_location
+    TemplateConfig( file_location,
+                    owner = params.app_user,
+                    template_tag = None
+    )
+
+if __name__ == "__main__":
+  CommandLogger().execute()

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e879109a/app-packages/command-logger/slider-pkg/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/app-packages/command-logger/slider-pkg/package/scripts/params.py b/app-packages/command-logger/slider-pkg/package/scripts/params.py
new file mode 100644
index 0000000..3d388ae
--- /dev/null
+++ b/app-packages/command-logger/slider-pkg/package/scripts/params.py
@@ -0,0 +1,31 @@
+#!/usr/bin/env python
+"""
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+"""
+
+from resource_management import *
+
+# server configurations
+config = Script.get_config()
+
+container_id = config['hostLevelParams']['container_id']
+application_id = config['configurations']['global']['application_id']
+app_user = config['configurations']['global']['app_user']
+
+datetime_format = config['configurations']['cl-site']['datetime.format']
+file_location = config['configurations']['cl-site']['logfile.location']

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e879109a/app-packages/command-logger/slider-pkg/package/templates/operations.log.j2
----------------------------------------------------------------------
diff --git a/app-packages/command-logger/slider-pkg/package/templates/operations.log.j2 b/app-packages/command-logger/slider-pkg/package/templates/operations.log.j2
new file mode 100644
index 0000000..8d6e879
--- /dev/null
+++ b/app-packages/command-logger/slider-pkg/package/templates/operations.log.j2
@@ -0,0 +1,22 @@
+{#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#}
+
+This is a log for all operations on a Yarn container.
+Container Id: {{container_id}}
+Application id: {{application_id}}
+---------------

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e879109a/app-packages/command-logger/slider-pkg/pom.xml
----------------------------------------------------------------------
diff --git a/app-packages/command-logger/slider-pkg/pom.xml b/app-packages/command-logger/slider-pkg/pom.xml
new file mode 100644
index 0000000..72af03e
--- /dev/null
+++ b/app-packages/command-logger/slider-pkg/pom.xml
@@ -0,0 +1,107 @@
+<?xml version="1.0"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+  <parent>
+    <groupId>org.apache.slider</groupId>
+    <artifactId>slider</artifactId>
+    <version>0.31.0-incubating-SNAPSHOT</version>
+    <relativePath>../../../pom.xml</relativePath>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>command-logger-app-package</artifactId>
+  <packaging>pom</packaging>
+  <name>Slider Command Logger App Package</name>
+  <description>Slider Command Logger App Package</description>
+  <properties>
+    <work.dir>package-tmp</work.dir>
+    <app.package.name>apache-slider-command-logger</app.package.name>
+  </properties>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-assembly-plugin</artifactId>
+        <configuration>
+          <descriptor>src/assembly/command-logger.xml</descriptor>
+          <appendAssemblyId>false</appendAssemblyId>
+          <finalName>${app.package.name}</finalName>
+        </configuration>
+        <executions>
+          <execution>
+            <id>build-app-package</id>
+            <phase>package</phase>
+            <goals>
+              <goal>single</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-dependency-plugin</artifactId>
+        <version>${maven-dependency-plugin.version}</version>
+        <executions>
+          <execution>
+            <id>copy-dependencies</id>
+            <phase>process-resources</phase>
+            <goals>
+              <goal>copy-dependencies</goal>
+            </goals>
+            <configuration>
+              <includeArtifactIds>command-logger</includeArtifactIds>
+              <includeTypes>tar</includeTypes>
+              <outputDirectory>${project.build.directory}/${work.dir}</outputDirectory>
+            </configuration>
+          </execution>
+          <execution>
+            <id>copy</id>
+            <phase>test</phase>
+            <goals>
+              <goal>copy</goal>
+            </goals>
+            <configuration>
+              <artifactItems>
+                <artifactItem>
+                  <groupId>org.apache.slider</groupId>
+                  <artifactId>command-logger</artifactId>
+                  <type>tar</type>
+                  <overWrite>false</overWrite>
+                  <outputDirectory>${project.build.directory}/${work.dir}</outputDirectory>
+                  <destFileName>command-logger.tar</destFileName>
+                </artifactItem>
+              </artifactItems>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.slider</groupId>
+      <artifactId>command-logger</artifactId>
+      <version>${project.version}</version>
+      <type>tar</type>
+    </dependency>
+  </dependencies>
+
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e879109a/app-packages/command-logger/slider-pkg/resources.json
----------------------------------------------------------------------
diff --git a/app-packages/command-logger/slider-pkg/resources.json b/app-packages/command-logger/slider-pkg/resources.json
new file mode 100644
index 0000000..8345661
--- /dev/null
+++ b/app-packages/command-logger/slider-pkg/resources.json
@@ -0,0 +1,15 @@
+{
+    "schema": "http://example.org/specification/v2.0.0",
+    "metadata": {
+    },
+    "global": {
+    },
+    "components": {
+        "COMMAND_LOGGER": {
+            "yarn.role.priority": "1",
+            "yarn.component.instances": "1"
+        },
+        "slider-appmaster": {
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e879109a/app-packages/command-logger/slider-pkg/src/assembly/command-logger.xml
----------------------------------------------------------------------
diff --git a/app-packages/command-logger/slider-pkg/src/assembly/command-logger.xml b/app-packages/command-logger/slider-pkg/src/assembly/command-logger.xml
new file mode 100644
index 0000000..cad468a
--- /dev/null
+++ b/app-packages/command-logger/slider-pkg/src/assembly/command-logger.xml
@@ -0,0 +1,78 @@
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~  or more contributor license agreements.  See the NOTICE file
+  ~  distributed with this work for additional information
+  ~  regarding copyright ownership.  The ASF licenses this file
+  ~  to you under the Apache License, Version 2.0 (the
+  ~  "License"); you may not use this file except in compliance
+  ~  with the License.  You may obtain a copy of the License at
+  ~
+  ~       http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~  Unless required by applicable law or agreed to in writing, software
+  ~  distributed under the License is distributed on an "AS IS" BASIS,
+  ~  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~  See the License for the specific language governing permissions and
+  ~  limitations under the License.
+  -->
+
+
+<assembly
+  xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
+  <id>command_logger_app_pkg</id>
+  <formats>
+    <format>zip</format>
+  </formats>
+  <includeBaseDirectory>false</includeBaseDirectory>
+
+  <files>
+    <file>
+      <source>appConfig.json</source>
+      <outputDirectory>/</outputDirectory>
+      <filtered>true</filtered>
+      <fileMode>0755</fileMode>
+    </file>
+    <file>
+      <source>resources.json</source>
+      <outputDirectory>/</outputDirectory>
+      <filtered>true</filtered>
+      <fileMode>0755</fileMode>
+    </file>
+    <file>
+      <source>metainfo.xml</source>
+      <outputDirectory>/</outputDirectory>
+      <filtered>true</filtered>
+      <fileMode>0755</fileMode>
+    </file>
+  </files>
+
+  <fileSets>
+    <fileSet>
+      <directory>${project.build.directory}/${work.dir}</directory>
+      <outputDirectory>package/files</outputDirectory>
+      <includes>
+        <include>command-logger.tar</include>
+      </includes>
+      <fileMode>0755</fileMode>
+      <directoryMode>0755</directoryMode>
+    </fileSet>
+
+    <fileSet>
+      <directory>${project.basedir}</directory>
+      <outputDirectory>/</outputDirectory>
+      <excludes>
+        <exclude>pom.xml</exclude>
+        <exclude>src/**</exclude>
+        <exclude>target/**</exclude>
+        <exclude>appConfig.json</exclude>
+        <exclude>resources.json</exclude>
+        <exclude>metainfo.xml</exclude>
+      </excludes>
+      <fileMode>0755</fileMode>
+      <directoryMode>0755</directoryMode>
+    </fileSet>
+
+  </fileSets>
+</assembly>

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e879109a/app-packages/hbase/appConfig.json
----------------------------------------------------------------------
diff --git a/app-packages/hbase/appConfig.json b/app-packages/hbase/appConfig.json
index 6225129..9a43863 100644
--- a/app-packages/hbase/appConfig.json
+++ b/app-packages/hbase/appConfig.json
@@ -7,11 +7,11 @@
     "application.def": "/slider/${app.package.name}.zip",
     "config_types": "core-site,hdfs-site,hbase-site",
     "java_home": "/usr/jdk64/jdk1.7.0_45",
-    "package_list": "files/hbase-${hbase.version}-hadoop2-bin.tar.gz",
+    "package_list": "files/hbase-${hbase.version}-bin.tar.gz",
     "site.global.app_user": "yarn",
     "site.global.app_log_dir": "app/log",
     "site.global.app_pid_dir": "${AGENT_WORK_ROOT}/app/run",
-    "site.global.app_root": "${AGENT_WORK_ROOT}/app/install/hbase-${hbase.version}-hadoop2",
+    "site.global.app_root": "${AGENT_WORK_ROOT}/app/install/hbase-${hbase.version}",
     "site.global.app_install_dir": "${AGENT_WORK_ROOT}/app/install",
     "site.global.hbase_master_heapsize": "1024m",
     "site.global.hbase_regionserver_heapsize": "1024m",

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e879109a/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index e517063..e1f772b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -34,6 +34,8 @@
   </organization>
 
   <modules>
+    <module>app-packages/command-logger/application-pkg</module>
+    <module>app-packages/command-logger/slider-pkg</module>
     <module>slider-core</module>
     <module>slider-agent</module>
     <module>app-packages/accumulo</module>