SLIDER-180. Changes to allow auto-build of hbase win 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/a1086e04 Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/a1086e04 Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/a1086e04 Branch: refs/heads/feature/SLIDER-158_slider_diagnostic_option Commit: a1086e04589839f2e074f2aea3f34723090736a2 Parents: 00af5a2 Author: Sumit Mohanty <[email protected]> Authored: Sun Sep 21 23:34:12 2014 -0700 Committer: Sumit Mohanty <[email protected]> Committed: Sun Sep 21 23:34:12 2014 -0700 ---------------------------------------------------------------------- app-packages/hbase-win/README.txt | 29 +++--- app-packages/hbase-win/appConfig.json | 71 +++++++-------- app-packages/hbase-win/metainfo.xml | 4 +- ...se-0.98.0.2.1.5.0-2047-hadoop2.zip.REPLACEME | 17 ---- app-packages/hbase-win/pom.xml | 94 ++++++++++++++++++++ app-packages/hbase-win/src/assembly/hbase.xml | 68 ++++++++++++++ 6 files changed, 214 insertions(+), 69 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/a1086e04/app-packages/hbase-win/README.txt ---------------------------------------------------------------------- diff --git a/app-packages/hbase-win/README.txt b/app-packages/hbase-win/README.txt index 625bce6..6865168 100644 --- a/app-packages/hbase-win/README.txt +++ b/app-packages/hbase-win/README.txt @@ -17,18 +17,25 @@ Create Slider App Package for HBase on Windows -Download the tarball for HBase: - e.g. path to tarball ~/Downloads/hbase-0.98.0.2.1.5.0-2047-hadoop2.zip +While appConfig.json and resources.json are not required for the package they +work well as the default configuration for Slider apps. So it is advisable that +when you create an application package for Slider, include sample/default +resources.json and appConfig.json for a minimal Yarn cluster. -Copy the hbase tarball to package/files - cp ~/Downloads/hbase-0.98.0.2.1.5.0-2047-hadoop2.zip package/files - rm -rf package/files/hbase-0.98.0.2.1.5.0-2047-hadoop2.zip.REPLACEME +OPTION-I: Use a downloaded hbase tarball fro Windows -Edit appConfig.json/metainfo.xml and replace all occurances of -0.98.0.2.1.5.0-2047-hadoop2 with the correct value. +****** OPTION - I ** +To create the app package you will need the HBase tarball and invoke mvn command +with appropriate parameters. -Create a zip package at the root of the package (<slider enlistment>/app-packages/hbase-win/) - zip -r hbase-win-v098.zip . +Command: +mvn clean package -Phbase-app-package-win -Dpkg.version=<version> + -Dpkg.name=<file name of app tarball> -Dpkg.src=<folder location where the pkg is available> -Verify the content using - zip -Tv hbase-win-v098.zip +Example: +mvn clean package -Phbase-app-package -Dpkg.version=0.98.5-hadoop2 + -Dpkg.name=hbase-0.98.5-hadoop2-bin.zip + -Dpkg.src=/Users/user1/Downloads + +App package can be found in + app-packages/hbase/target/slider-hbase-app-win-package-${pkg.version}.zip http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/a1086e04/app-packages/hbase-win/appConfig.json ---------------------------------------------------------------------- diff --git a/app-packages/hbase-win/appConfig.json b/app-packages/hbase-win/appConfig.json index 94f1343..6f07d34 100644 --- a/app-packages/hbase-win/appConfig.json +++ b/app-packages/hbase-win/appConfig.json @@ -1,44 +1,37 @@ { - "schema": "http://example.org/specification/v2.0.0", - "metadata": { - }, - "global": { - "application.def": ".slider/package/HBASE/${app.package.name}.zip", - "create.default.zookeeper.node": "true", - "java_home": "/usr/jdk64/jdk1.7.0_45", + "schema": "http://example.org/specification/v2.0.0", + "metadata": { + }, + "global": { + "application.def": ".slider/package/HBASE/slider-hbase-app-win-package-${bld.version}.zip", + "create.default.zookeeper.node": "true", - "site.global.app_user": "hadoop", - "site.global.app_root": "${AGENT_WORK_ROOT}/app/install/hbase-${hbase.version}", + "site.global.app_user": "hadoop", + "site.global.app_root": "${AGENT_WORK_ROOT}/app/install/hbase-${pkg.version}", + "site.global.hbase_instance_name": "instancename", + "site.global.hbase_root_password": "secret", + "site.global.user_group": "hadoop", + "site.global.security_enabled": "false", + "site.global.monitor_protocol": "http", + "site.global.hbase_additional_cp": "c:\\java\\lib\\tools.jar;", + "site.global.java_library_path": "c:\\hdp\\hadoop-2.4.0.2.1.3.0-1990\\bin", - "site.global.hbase_instance_name": "instancename", - "site.global.hbase_root_password": "secret", - "site.global.user_group": "hadoop", - "site.global.security_enabled": "false", - "site.global.monitor_protocol": "http", - "site.global.ganglia_server_host": "${NN_HOST}", - "site.global.ganglia_server_port": "8667", - "site.global.ganglia_server_id": "Application1", - "site.global.hbase_thrift_port": "${HBASE_THRIFT.ALLOCATED_PORT}", - "site.global.hbase_thrift2_port": "${HBASE_THRIFT2.ALLOCATED_PORT}", - "site.global.hbase_rest_port": "${HBASE_REST.ALLOCATED_PORT}", - "site.global.hbase_additional_cp": "c:\\java\\lib\\tools.jar;", - "site.global.java_library_path": "c:\\hdp\\hadoop-2.4.0.2.1.3.0-1990\\bin", - - "site.hbase-env.hbase_master_heapsize": "1024m", - "site.hbase-env.hbase_regionserver_heapsize": "1024m", - - "site.hbase-site.hbase.rootdir": "${DEFAULT_DATA_DIR}", - "site.hbase-site.hbase.superuser": "yarn", - "site.hbase-site.hbase.tmp.dir": "${AGENT_WORK_ROOT}/work/app/tmp", - "site.hbase-site.hbase.zookeeper.quorum": "${ZK_HOST}", - "site.hbase-site.zookeeper.znode.parent": "${DEF_ZK_PATH}", - "site.hbase-site.hbase.regionserver.info.port": "0", - "site.hbase-site.hbase.master.info.port": "${HBASE_MASTER.ALLOCATED_PORT}", - "site.hbase-site.hbase.regionserver.port": "0" - }, - "components": { - "slider-appmaster": { - "jvm.heapsize": "256M" + "site.hbase-env.hbase_master_heapsize": "1024m", + "site.hbase-env.hbase_regionserver_heapsize": "1024m", + "site.hbase-site.hbase.rootdir": "${DEFAULT_DATA_DIR}", + "site.hbase-site.hbase.superuser": "yarn", + "site.hbase-site.hbase.tmp.dir": "${AGENT_WORK_ROOT}/work/app/tmp", + "site.hbase-site.hbase.local.dir": "${hbase.tmp.dir}/local", + "site.hbase-site.hbase.zookeeper.quorum": "${ZK_HOST}", + "site.hbase-site.zookeeper.znode.parent": "${DEF_ZK_PATH}", + "site.hbase-site.hbase.regionserver.info.port": "0", + "site.hbase-site.hbase.master.info.port": "${HBASE_MASTER.ALLOCATED_PORT}", + "site.hbase-site.hbase.regionserver.port": "0", + "site.hbase-site.hbase.master.port": "0" + }, + "components": { + "slider-appmaster": { + "jvm.heapsize": "256M" + } } - } } http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/a1086e04/app-packages/hbase-win/metainfo.xml ---------------------------------------------------------------------- diff --git a/app-packages/hbase-win/metainfo.xml b/app-packages/hbase-win/metainfo.xml index 315d279..c585720 100644 --- a/app-packages/hbase-win/metainfo.xml +++ b/app-packages/hbase-win/metainfo.xml @@ -25,7 +25,7 @@ 1. Ensure parent dir for path (hbase-site/hbase.rootdir) is accessible to the App owner. 2. Ensure ZK root (hbase-site/zookeeper.znode.parent) is unique for the App instance. </comment> - <version>${hbase.version}</version> + <version>${pkg.version}</version> <type>YARN-APP</type> <minHadoopVersion>2.1.0</minHadoopVersion> <exportedConfigs>hbase-site</exportedConfigs> @@ -96,7 +96,7 @@ <packages> <package> <type>zip</type> - <name>files/hbase-0.98.0.2.1.5.0-2047-hadoop2.zip</name> + <name>files/${pkg.name}</name> </package> </packages> </osSpecific> http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/a1086e04/app-packages/hbase-win/package/files/hbase-0.98.0.2.1.5.0-2047-hadoop2.zip.REPLACEME ---------------------------------------------------------------------- diff --git a/app-packages/hbase-win/package/files/hbase-0.98.0.2.1.5.0-2047-hadoop2.zip.REPLACEME b/app-packages/hbase-win/package/files/hbase-0.98.0.2.1.5.0-2047-hadoop2.zip.REPLACEME deleted file mode 100644 index 96ed9f1..0000000 --- a/app-packages/hbase-win/package/files/hbase-0.98.0.2.1.5.0-2047-hadoop2.zip.REPLACEME +++ /dev/null @@ -1,17 +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. - -Replace with the actual HBase package for Windows. - http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/a1086e04/app-packages/hbase-win/pom.xml ---------------------------------------------------------------------- diff --git a/app-packages/hbase-win/pom.xml b/app-packages/hbase-win/pom.xml new file mode 100644 index 0000000..ad5855e --- /dev/null +++ b/app-packages/hbase-win/pom.xml @@ -0,0 +1,94 @@ +<?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.51.0-incubating-SNAPSHOT</version> + <relativePath>../../pom.xml</relativePath> + </parent> + <modelVersion>4.0.0</modelVersion> + <artifactId>slider-hbase-app-win-package</artifactId> + <packaging>pom</packaging> + <name>Slider HBase App Package for Windows</name> + <description>Slider HBase App Package for Windows</description> + <version>${bld.version}</version> + <properties> + <work.dir>package-tmp</work.dir> + <app.package.name>${project.artifactId}-${project.version}</app.package.name> + </properties> + + <profiles> + <profile> + <id>hbase-app-package-win</id> + <properties> + <bld.version>${pkg.version}</bld.version> + </properties> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-antrun-plugin</artifactId> + <version>1.7</version> + <executions> + <execution> + <id>copy</id> + <phase>validate</phase> + <configuration> + <target name="copy and rename file"> + <copy file="${pkg.src}/${pkg.name}" tofile="${project.build.directory}/${pkg.name}"/> + </target> + </configuration> + <goals> + <goal>run</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-assembly-plugin</artifactId> + <configuration> + <tarLongFileMode>gnu</tarLongFileMode> + <descriptor>src/assembly/hbase.xml</descriptor> + <appendAssemblyId>false</appendAssemblyId> + </configuration> + <executions> + <execution> + <id>build-tarball</id> + <phase>package</phase> + <goals> + <goal>single</goal> + </goals> + </execution> + </executions> + </plugin> + + </plugins> + </build> + </profile> + </profiles> + + <build> + </build> + + <dependencies> + </dependencies> + +</project> http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/a1086e04/app-packages/hbase-win/src/assembly/hbase.xml ---------------------------------------------------------------------- diff --git a/app-packages/hbase-win/src/assembly/hbase.xml b/app-packages/hbase-win/src/assembly/hbase.xml new file mode 100644 index 0000000..e62da84 --- /dev/null +++ b/app-packages/hbase-win/src/assembly/hbase.xml @@ -0,0 +1,68 @@ +<!-- + ~ 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>hbase_v${hbase.version}</id> + <formats> + <format>zip</format> + <format>dir</format> + </formats> + <includeBaseDirectory>false</includeBaseDirectory> + + <files> + <file> + <source>appConfig.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> + <file> + <source>${pkg.src}/${pkg.name}</source> + <outputDirectory>package/files</outputDirectory> + <filtered>false</filtered> + <fileMode>0755</fileMode> + </file> + </files> + + <fileSets> + <fileSet> + <directory>${project.basedir}</directory> + <outputDirectory>/</outputDirectory> + <excludes> + <exclude>pom.xml</exclude> + <exclude>src/**</exclude> + <exclude>target/**</exclude> + <exclude>appConfig.json</exclude> + <exclude>metainfo.xml</exclude> + </excludes> + <fileMode>0755</fileMode> + <directoryMode>0755</directoryMode> + </fileSet> + + </fileSets> +</assembly>
