Repository: bigtop Updated Branches: refs/heads/master 8766429f8 -> 70c8dec59
BIGTOP-1490. Adding GridGain to BigTop Project: http://git-wip-us.apache.org/repos/asf/bigtop/repo Commit: http://git-wip-us.apache.org/repos/asf/bigtop/commit/70c8dec5 Tree: http://git-wip-us.apache.org/repos/asf/bigtop/tree/70c8dec5 Diff: http://git-wip-us.apache.org/repos/asf/bigtop/diff/70c8dec5 Branch: refs/heads/master Commit: 70c8dec59d251d9344b0af17c6e702faa7e77326 Parents: 8766429 Author: Ilya Tikhonov <[email protected]> Authored: Wed Oct 22 20:05:05 2014 +0400 Committer: Konstantin Boudnik <[email protected]> Committed: Fri Nov 7 11:32:07 2014 -0800 ---------------------------------------------------------------------- .../modules/gridgain-hadoop/manifests/init.pp | 36 +++ .../gridgain-hadoop/templates/gridgain-hadoop | 21 ++ .../modules/gridgain-hadoop/tests/init.pp | 16 ++ .../puppet/modules/hadoop-hive/tests/init.pp | 2 +- .../common/gridgain-hadoop/do-component-build | 22 ++ .../common/gridgain-hadoop/gridgain-hadoop.1 | 59 +++++ .../gridgain-hadoop/gridgain-hadoop.default | 22 ++ .../common/gridgain-hadoop/gridgain-hadoop.svc | 63 ++++++ .../common/gridgain-hadoop/install_gridgain.sh | 139 ++++++++++++ bigtop-packages/src/deb/gridgain-hadoop/compat | 1 + bigtop-packages/src/deb/gridgain-hadoop/control | 34 +++ .../src/deb/gridgain-hadoop/copyright | 15 ++ bigtop-packages/src/deb/gridgain-hadoop/format | 1 + .../gridgain-hadoop/gridgain-hadoop-doc.dirs | 1 + .../gridgain-hadoop/gridgain-hadoop-doc.install | 1 + .../deb/gridgain-hadoop/gridgain-hadoop.dirs | 4 + .../deb/gridgain-hadoop/gridgain-hadoop.install | 3 + .../gridgain-hadoop/gridgain-hadoop.manpages | 1 + .../gridgain-hadoop/gridgain-hadoop.postinst | 47 ++++ .../deb/gridgain-hadoop/gridgain-hadoop.preinst | 61 +++++ .../deb/gridgain-hadoop/gridgain-hadoop.prerm | 55 +++++ .../deb/gridgain-hadoop/install_init_scripts.sh | 30 +++ bigtop-packages/src/deb/gridgain-hadoop/rules | 46 ++++ .../deb/gridgain-hadoop/service-postinst.tpl | 51 +++++ .../src/deb/gridgain-hadoop/service-postrm.tpl | 51 +++++ .../src/deb/gridgain-hadoop/source/format | 1 + .../gridgain-hadoop/SPECS/gridgain-hadoop.spec | 223 +++++++++++++++++++ .../gridgain-hadoop/TestGridGainHadoop.groovy | 72 ++++++ .../smoke-tests/gridgain-hadoop/build.gradle | 53 +++++ .../gridgain-hadoop/conf/core-site.xml | 65 ++++++ .../gridgain-hadoop/conf/log4j.properties | 24 ++ .../gridgain-hadoop/conf/mapred-site.xml | 62 ++++++ .../smoke-tests/gridgain-hadoop/test.data | 11 + .../package/src/main/resources/package_data.xml | 43 +++- bigtop.mk | 15 ++ 35 files changed, 1349 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/bigtop/blob/70c8dec5/bigtop-deploy/puppet/modules/gridgain-hadoop/manifests/init.pp ---------------------------------------------------------------------- diff --git a/bigtop-deploy/puppet/modules/gridgain-hadoop/manifests/init.pp b/bigtop-deploy/puppet/modules/gridgain-hadoop/manifests/init.pp new file mode 100644 index 0000000..7088eca --- /dev/null +++ b/bigtop-deploy/puppet/modules/gridgain-hadoop/manifests/init.pp @@ -0,0 +1,36 @@ +# 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. + +class gridgain-hadoop { + define server() { + package { "gridgain-hadoop": + ensure => latest, + } + + package { "gridgain-hadoop-service": + ensure => latest, + } + + file { "/etc/default/gridgain-hadoop": + content => template("gridgain-hadoop/gridgain-hadoop"), + require => Package["gridgain-hadoop"], + } + + service { "gridgain-hadoop": + ensure => running, + require => [ Package["gridgain-hadoop", "gridgain-hadoop-service"], File["/etc/default/gridgain-hadoop"] ], + } + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/bigtop/blob/70c8dec5/bigtop-deploy/puppet/modules/gridgain-hadoop/templates/gridgain-hadoop ---------------------------------------------------------------------- diff --git a/bigtop-deploy/puppet/modules/gridgain-hadoop/templates/gridgain-hadoop b/bigtop-deploy/puppet/modules/gridgain-hadoop/templates/gridgain-hadoop new file mode 100644 index 0000000..4ab127f --- /dev/null +++ b/bigtop-deploy/puppet/modules/gridgain-hadoop/templates/gridgain-hadoop @@ -0,0 +1,21 @@ +# 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. + +export HADOOP_PREFIX=/usr +export GRIDGAIN_HOME=/usr/lib/gridgain-hadoop +export GRIDGAIN_LOG_DIR=/var/log/gridgain-hadoop +export GRIDGAIN_PID_DIR=/var/run/gridgain-hadoop +export GRIDGAIN_WORK_DIR="/var/run/gridgain-hadoop/work" +export HADOOP_HOME=${HADOOP_HOME:-/usr/lib/hadoop} http://git-wip-us.apache.org/repos/asf/bigtop/blob/70c8dec5/bigtop-deploy/puppet/modules/gridgain-hadoop/tests/init.pp ---------------------------------------------------------------------- diff --git a/bigtop-deploy/puppet/modules/gridgain-hadoop/tests/init.pp b/bigtop-deploy/puppet/modules/gridgain-hadoop/tests/init.pp new file mode 100644 index 0000000..c4536ed --- /dev/null +++ b/bigtop-deploy/puppet/modules/gridgain-hadoop/tests/init.pp @@ -0,0 +1,16 @@ +# 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. + +gridgain-hadoop::server { "test-gridgain-hadoop-server": } http://git-wip-us.apache.org/repos/asf/bigtop/blob/70c8dec5/bigtop-deploy/puppet/modules/hadoop-hive/tests/init.pp ---------------------------------------------------------------------- diff --git a/bigtop-deploy/puppet/modules/hadoop-hive/tests/init.pp b/bigtop-deploy/puppet/modules/hadoop-hive/tests/init.pp index 1ad4fd3..44c62c8 100644 --- a/bigtop-deploy/puppet/modules/hadoop-hive/tests/init.pp +++ b/bigtop-deploy/puppet/modules/hadoop-hive/tests/init.pp @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -hadoop-hive::client { "test-hive": } +hadoop-hive::client { "test-hive": } http://git-wip-us.apache.org/repos/asf/bigtop/blob/70c8dec5/bigtop-packages/src/common/gridgain-hadoop/do-component-build ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/common/gridgain-hadoop/do-component-build b/bigtop-packages/src/common/gridgain-hadoop/do-component-build new file mode 100644 index 0000000..e314f1f --- /dev/null +++ b/bigtop-packages/src/common/gridgain-hadoop/do-component-build @@ -0,0 +1,22 @@ +#!/bin/bash +# 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. + +set -ex + +. `dirname $0`/bigtop.bom + +export MAVEN_OPTS="-Xmx512M -XX:MaxPermSize=512M" +mvn clean package -DskipTests -DskipClientDocs -Dhadoop.version=$HADOOP_VERSION -Dgridgain.edition=hadoop http://git-wip-us.apache.org/repos/asf/bigtop/blob/70c8dec5/bigtop-packages/src/common/gridgain-hadoop/gridgain-hadoop.1 ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/common/gridgain-hadoop/gridgain-hadoop.1 b/bigtop-packages/src/common/gridgain-hadoop/gridgain-hadoop.1 new file mode 100644 index 0000000..ebd5838 --- /dev/null +++ b/bigtop-packages/src/common/gridgain-hadoop/gridgain-hadoop.1 @@ -0,0 +1,59 @@ +.\" 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. +.\" +.\" Process this file with +.\" groff -man -Tascii gridgain.1 +.\" +.TH gridgain 1 "June 2014 " Linux "User Manuals" + +.SH NAME +Gradgain \- Gridgain is a filesystem and MR accelerator for Hadoop. + +.SH SYNOPSIS + +.B gridgain +\fICOMMAND\fR + +.SH DESCRIPTION + +Gridgain is a filesystem and MR accelerator for Hadoop. Use it when you +you need predictable file system caching, fast MR processing... + +Gridgain is an open-source, distributed blah-blah + +For more information about Gridgain, see http://gridgain.org. + +\fICOMMAND\fR may be one of the following: + something do something + else do something else + +Most commands print help when invoked w/o parameters or with --help. + +.SH ENVIRONMENT + +.IP JAVA_HOME +The java implementation to use. Overrides JAVA_HOME. + +.IP GRIDGAIN_HOME +Extra Java CLASSPATH entries. + +.IP GRIDGAIN_CONF_DIR +Alternate conf dir. Default is ${GRIDGAIN_HOME}/conf. + +.IP HADOOP_HOME +Optionally, the Hadoop home to run with. + +.SH COPYRIGHT +Copyright (C) 2014 Gridgain???? All rights reserved. http://git-wip-us.apache.org/repos/asf/bigtop/blob/70c8dec5/bigtop-packages/src/common/gridgain-hadoop/gridgain-hadoop.default ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/common/gridgain-hadoop/gridgain-hadoop.default b/bigtop-packages/src/common/gridgain-hadoop/gridgain-hadoop.default new file mode 100644 index 0000000..3d0a1e8 --- /dev/null +++ b/bigtop-packages/src/common/gridgain-hadoop/gridgain-hadoop.default @@ -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. + +export GRIDGAIN_HOME="/usr/lib/gridgain-hadoop" +export GRIDGAIN_CONF_DIR="/etc/gridgain-hadoop/conf" + +export GRIDGAIN_PID_DIR="/var/run/gridgain-hadoop" +export GRIDGAIN_LOG_DIR="/var/log/gridgain-hadoop" +export GRIDGAIN_WORK_DIR="/var/run/gridgain-hadoop/work" +export GRIDGAIN_IDENT_STRING=gridgain http://git-wip-us.apache.org/repos/asf/bigtop/blob/70c8dec5/bigtop-packages/src/common/gridgain-hadoop/gridgain-hadoop.svc ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/common/gridgain-hadoop/gridgain-hadoop.svc b/bigtop-packages/src/common/gridgain-hadoop/gridgain-hadoop.svc new file mode 100644 index 0000000..6b26b14 --- /dev/null +++ b/bigtop-packages/src/common/gridgain-hadoop/gridgain-hadoop.svc @@ -0,0 +1,63 @@ +# 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. + +DAEMON="@GRIDGAIN_DAEMON@" +DESC="@GRIDGAIN_DAEMON@ daemon" +EXEC_PATH="\${GRIDGAIN_HOME}/bin/include/service.sh" +SVC_USER="gridgain" +PIDFILE="\${GRIDGAIN_PID_DIR}/${DAEMON}.pid" + +generate_start() { + +cat <<'__EOT__' +start() { + [ -x $EXEC_PATH ] || exit $ERROR_PROGRAM_NOT_INSTALLED + log_success_msg "Starting $DESC (${DAEMON}): " + + checkstatusofproc + status=$? + if [ "$status" -eq "$STATUS_RUNNING" ]; then + log_success_msg "${DESC} is running" + exit 0 + fi + + su -s /bin/bash ${SVC_USER} -c "${EXEC_PATH} start ${DAEMON}" + + checkstatusofproc + RETVAL=$? + [ $RETVAL -eq $STATUS_RUNNING ] && touch $LOCKFILE + return $RETVAL +} +__EOT__ + +} + +generate_stop() { + +cat <<'__EOT__' +stop() { + log_success_msg "Stopping $DESC (${DAEMON}): " + + su -s /bin/bash ${SVC_USER} -c "${EXEC_PATH} stop ${DAEMON}" + + sleep 3 + RETVAL=$? + + [ $RETVAL -eq $RETVAL_SUCCESS ] && rm -f $LOCKFILE $PIDFILE + return $RETVAL +} +__EOT__ + +} http://git-wip-us.apache.org/repos/asf/bigtop/blob/70c8dec5/bigtop-packages/src/common/gridgain-hadoop/install_gridgain.sh ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/common/gridgain-hadoop/install_gridgain.sh b/bigtop-packages/src/common/gridgain-hadoop/install_gridgain.sh new file mode 100644 index 0000000..213f227 --- /dev/null +++ b/bigtop-packages/src/common/gridgain-hadoop/install_gridgain.sh @@ -0,0 +1,139 @@ +#!/bin/bash + +# 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. + +set -ex + +usage() { + echo " +usage: $0 <options> + Required not-so-options: + --build-dir=DIR path to gridgain dist.dir + --prefix=PREFIX path to install into + + Optional options: + --doc-dir=DIR path to install docs into [/usr/share/doc/gridgain] + --lib-dir=DIR path to install gridgain home [/usr/lib/gridgain] + --installed-lib-dir=DIR path where lib-dir will end up on target system + --bin-dir=DIR path to install bins [/usr/bin] + --examples-dir=DIR path to install examples [doc-dir/examples] + ... [ see source for more similar options ] + " + exit 1 +} + +OPTS=$(getopt \ + -n $0 \ + -o '' \ + -l 'prefix:' \ + -l 'doc-dir:' \ + -l 'lib-dir:' \ + -l 'installed-lib-dir:' \ + -l 'bin-dir:' \ + -l 'examples-dir:' \ + -l 'conf-dir:' \ + -l 'build-dir:' -- "$@") + +if [ $? != 0 ] ; then + usage +fi + +eval set -- "$OPTS" +while true ; do + case "$1" in + --prefix) + PREFIX=$2 ; shift 2 + ;; + --build-dir) + BUILD_DIR=$2 ; shift 2 + ;; + --doc-dir) + DOC_DIR=$2 ; shift 2 + ;; + --lib-dir) + LIB_DIR=$2 ; shift 2 + ;; + --installed-lib-dir) + INSTALLED_LIB_DIR=$2 ; shift 2 + ;; + --bin-dir) + BIN_DIR=$2 ; shift 2 + ;; + --examples-dir) + EXAMPLES_DIR=$2 ; shift 2 + ;; + --conf-dir) + CONF_DIR=$2 ; shift 2 + ;; + --) + shift ; break + ;; + *) + echo "Unknown option: $1" + usage + exit 1 + ;; + esac +done + +for var in PREFIX BUILD_DIR ; do + if [ -z "$(eval "echo \$$var")" ]; then + echo Missing param: $var + usage + fi +done + +MAN_DIR=${MAN_DIR:-/usr/share/man/man1} +DOC_DIR=${DOC_DIR:-/usr/share/doc/gridgain-hadoop} +LIB_DIR=${LIB_DIR:-/usr/lib/gridgain-hadoop} +BIN_DIR=${BIN_DIR:-/usr/lib/gridgain-hadoop/bin} +ETC_DIR=${ETC_DIR:-/etc/gridgain-hadoop} +CONF_DIR=${CONF_DIR:-${ETC_DIR}/conf.dist} + +install -d -m 0755 $PREFIX/$LIB_DIR +install -d -m 0755 $PREFIX/$LIB_DIR/libs +install -d -m 0755 $PREFIX/$DOC_DIR +install -d -m 0755 $PREFIX/$BIN_DIR +install -d -m 0755 $PREFIX/$BIN_DIR/include +install -d -m 0755 $PREFIX/$ETC_DIR +install -d -m 0755 $PREFIX/$CONF_DIR +install -d -m 0755 $PREFIX/$MAN_DIR +install -d -m 0755 $PREFIX/var/run/gridgain-hadoop/work/ + +unzip -x $BUILD_DIR/gridgain-hadoop-os-*.zip + +UNZIP_DIR=gridgain-hadoop-os-* +cp -ar $UNZIP_DIR/libs $PREFIX/$LIB_DIR +cp -ar $UNZIP_DIR/docs $PREFIX/$LIB_DIR +cp -a $UNZIP_DIR/config/* $PREFIX/$CONF_DIR +cp -ra $UNZIP_DIR/bin/* $PREFIX/$BIN_DIR + +ln -s $ETC_DIR/conf $PREFIX/$LIB_DIR/config + +wrapper=$PREFIX/usr/bin/gridgain-hadoop +mkdir -p `dirname $wrapper` +cat > $wrapper <<EOF +#!/bin/bash + +BIGTOP_DEFAULTS_DIR=\${BIGTOP_DEFAULTS_DIR-/etc/default} +[ -n "\${BIGTOP_DEFAULTS_DIR}" -a -r \${BIGTOP_DEFAULTS_DIR}/hadoop ] && . \${BIGTOP_DEFAULTS_DIR}/hadoop +[ -n "\${BIGTOP_DEFAULTS_DIR}" -a -r \${BIGTOP_DEFAULTS_DIR}/gridgain-hadoop ] && . \${BIGTOP_DEFAULTS_DIR}/gridgain-hadoop + +exec /usr/lib/gridgain-hadoop/bin/include/service.sh \$1 gridgain-hadoop +EOF +chmod 755 $wrapper + +install -d -m 0755 $PREFIX/usr/bin http://git-wip-us.apache.org/repos/asf/bigtop/blob/70c8dec5/bigtop-packages/src/deb/gridgain-hadoop/compat ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/deb/gridgain-hadoop/compat b/bigtop-packages/src/deb/gridgain-hadoop/compat new file mode 100644 index 0000000..7f8f011 --- /dev/null +++ b/bigtop-packages/src/deb/gridgain-hadoop/compat @@ -0,0 +1 @@ +7 http://git-wip-us.apache.org/repos/asf/bigtop/blob/70c8dec5/bigtop-packages/src/deb/gridgain-hadoop/control ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/deb/gridgain-hadoop/control b/bigtop-packages/src/deb/gridgain-hadoop/control new file mode 100644 index 0000000..c3ed230 --- /dev/null +++ b/bigtop-packages/src/deb/gridgain-hadoop/control @@ -0,0 +1,34 @@ +# 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. +Source: gridgain-hadoop +Section: misc +Priority: extra +Maintainer: Bigtop <[email protected]> +Build-Depends: debhelper (>= 7.0.50~) +Standards-Version: 3.8.0 +Homepage: http://github.com/gridgain/ + +Package: gridgain-hadoop +Architecture: all +Depends: adduser, hadoop-hdfs, hadoop-mapreduce, bigtop-utils (>= 0.7) +Description: GridGain is an open-source, distributed, in-memory computation platform + . + * HDFS caching and MR performance booster + +Package: gridgain-hadoop-doc +Architecture: all +Section: doc +Description: Gridgain Documentation + Documentation for Gridgain Hadoop Accelerator http://git-wip-us.apache.org/repos/asf/bigtop/blob/70c8dec5/bigtop-packages/src/deb/gridgain-hadoop/copyright ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/deb/gridgain-hadoop/copyright b/bigtop-packages/src/deb/gridgain-hadoop/copyright new file mode 100644 index 0000000..f0b7b62 --- /dev/null +++ b/bigtop-packages/src/deb/gridgain-hadoop/copyright @@ -0,0 +1,15 @@ +Format: http://dep.debian.net/deps/dep5 +Source: http://github.com/gridgain/ +Upstream-Name: Gridgain + +Files: * +Copyright: 2014, The Apache Software Foundation +License: Apache-2.0 + +Files debian/* +Copyright: 2011, The Apache Software Foundation +License: Apache-2.0 + +License: Apache-2.0 + On Debian systems, the complete text of the Apache 2.0 license + can be found in "/usr/share/common-licenses/Apache-2.0". http://git-wip-us.apache.org/repos/asf/bigtop/blob/70c8dec5/bigtop-packages/src/deb/gridgain-hadoop/format ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/deb/gridgain-hadoop/format b/bigtop-packages/src/deb/gridgain-hadoop/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/bigtop-packages/src/deb/gridgain-hadoop/format @@ -0,0 +1 @@ +3.0 (quilt) http://git-wip-us.apache.org/repos/asf/bigtop/blob/70c8dec5/bigtop-packages/src/deb/gridgain-hadoop/gridgain-hadoop-doc.dirs ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/deb/gridgain-hadoop/gridgain-hadoop-doc.dirs b/bigtop-packages/src/deb/gridgain-hadoop/gridgain-hadoop-doc.dirs new file mode 100644 index 0000000..c905766 --- /dev/null +++ b/bigtop-packages/src/deb/gridgain-hadoop/gridgain-hadoop-doc.dirs @@ -0,0 +1 @@ +/usr/share/doc/gridgain-hadoop-doc/ http://git-wip-us.apache.org/repos/asf/bigtop/blob/70c8dec5/bigtop-packages/src/deb/gridgain-hadoop/gridgain-hadoop-doc.install ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/deb/gridgain-hadoop/gridgain-hadoop-doc.install b/bigtop-packages/src/deb/gridgain-hadoop/gridgain-hadoop-doc.install new file mode 100644 index 0000000..074db3d --- /dev/null +++ b/bigtop-packages/src/deb/gridgain-hadoop/gridgain-hadoop-doc.install @@ -0,0 +1 @@ +/usr/share/doc/gridgain-hadoop-doc http://git-wip-us.apache.org/repos/asf/bigtop/blob/70c8dec5/bigtop-packages/src/deb/gridgain-hadoop/gridgain-hadoop.dirs ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/deb/gridgain-hadoop/gridgain-hadoop.dirs b/bigtop-packages/src/deb/gridgain-hadoop/gridgain-hadoop.dirs new file mode 100644 index 0000000..0aa64e2 --- /dev/null +++ b/bigtop-packages/src/deb/gridgain-hadoop/gridgain-hadoop.dirs @@ -0,0 +1,4 @@ +/usr/bin +/var/log/gridgain-hadoop +/var/run/gridgain-hadoop +/etc/default http://git-wip-us.apache.org/repos/asf/bigtop/blob/70c8dec5/bigtop-packages/src/deb/gridgain-hadoop/gridgain-hadoop.install ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/deb/gridgain-hadoop/gridgain-hadoop.install b/bigtop-packages/src/deb/gridgain-hadoop/gridgain-hadoop.install new file mode 100644 index 0000000..aba18ed --- /dev/null +++ b/bigtop-packages/src/deb/gridgain-hadoop/gridgain-hadoop.install @@ -0,0 +1,3 @@ +/usr/lib/gridgain-hadoop +/usr/bin/gridgain-hadoop +/etc/gridgain-hadoop http://git-wip-us.apache.org/repos/asf/bigtop/blob/70c8dec5/bigtop-packages/src/deb/gridgain-hadoop/gridgain-hadoop.manpages ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/deb/gridgain-hadoop/gridgain-hadoop.manpages b/bigtop-packages/src/deb/gridgain-hadoop/gridgain-hadoop.manpages new file mode 100644 index 0000000..8c4a29e --- /dev/null +++ b/bigtop-packages/src/deb/gridgain-hadoop/gridgain-hadoop.manpages @@ -0,0 +1 @@ +debian/gridgain-hadoop.1 http://git-wip-us.apache.org/repos/asf/bigtop/blob/70c8dec5/bigtop-packages/src/deb/gridgain-hadoop/gridgain-hadoop.postinst ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/deb/gridgain-hadoop/gridgain-hadoop.postinst b/bigtop-packages/src/deb/gridgain-hadoop/gridgain-hadoop.postinst new file mode 100644 index 0000000..9e85e91 --- /dev/null +++ b/bigtop-packages/src/deb/gridgain-hadoop/gridgain-hadoop.postinst @@ -0,0 +1,47 @@ +#!/bin/bash +# +# 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. + +# postinst script for gridgain-hadoop + +gg_hadoop_pkg_name=gridgain-hadoop + +set -e + +case "$1" in + configure) + # Install config alternatives + update-alternatives --install /etc/${gg_hadoop_pkg_name}/conf ${gg_hadoop_pkg_name}-conf \ + /etc/${gg_hadoop_pkg_name}/conf.dist 30 + + mkdir -p /var/log/${gg_hadoop_pkg_name} /var/run/${gg_hadoop_pkg_name} /var/run/${gg_hadoop_pkg_name}/work || : + chown gridgain:gridgain /var/log/${gg_hadoop_pkg_name} /var/run/${gg_hadoop_pkg_name} + chmod g+w /var/log/${gg_hadoop_pkg_name} /var/run/${gg_hadoop_pkg_name} + chown gridgain:gridgain /var/run/${gg_hadoop_pkg_name} /var/run/${gg_hadoop_pkg_name}/work + chmod 0755 /var/run/${gg_hadoop_pkg_name} + chmod 1777 /var/run/${gg_hadoop_pkg_name}/work + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# http://git-wip-us.apache.org/repos/asf/bigtop/blob/70c8dec5/bigtop-packages/src/deb/gridgain-hadoop/gridgain-hadoop.preinst ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/deb/gridgain-hadoop/gridgain-hadoop.preinst b/bigtop-packages/src/deb/gridgain-hadoop/gridgain-hadoop.preinst new file mode 100644 index 0000000..a151c17 --- /dev/null +++ b/bigtop-packages/src/deb/gridgain-hadoop/gridgain-hadoop.preinst @@ -0,0 +1,61 @@ +#!/bin/bash +# +# 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. + +# preinst script for gridgain-hadoop +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * <new-preinst> `install' +# * <new-preinst> `install' <old-version> +# * <new-preinst> `upgrade' <old-version> +# * <old-preinst> `abort-upgrade' <new-version> +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + install|upgrade) + if ! getent passwd gridgain >/dev/null; then + # Adding system user: gridgain. + adduser \ + --system \ + --group \ + --home /var/run/gridgain-hadoop \ + --gecos "Geidgain User" \ + --shell /bin/bash \ + gridgain >/dev/null + fi + ;; + + abort-upgrade) + ;; + + *) + echo "preinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 http://git-wip-us.apache.org/repos/asf/bigtop/blob/70c8dec5/bigtop-packages/src/deb/gridgain-hadoop/gridgain-hadoop.prerm ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/deb/gridgain-hadoop/gridgain-hadoop.prerm b/bigtop-packages/src/deb/gridgain-hadoop/gridgain-hadoop.prerm new file mode 100644 index 0000000..216dea2 --- /dev/null +++ b/bigtop-packages/src/deb/gridgain-hadoop/gridgain-hadoop.prerm @@ -0,0 +1,55 @@ +#!/bin/bash +# +# 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. + +# prerm script for gridgain-hadoop +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * <prerm> `remove' +# * <old-prerm> `upgrade' <new-version> +# * <new-prerm> `failed-upgrade' <old-version> +# * <conflictor's-prerm> `remove' `in-favour' <package> <new-version> +# * <deconfigured's-prerm> `deconfigure' `in-favour' +# <package-being-installed> <version> `removing' +# <conflicting-package> <version> +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + remove|upgrade|deconfigure) + update-alternatives --remove gridgain-hadoop-conf /etc/gridgain-hadoop/conf.dist || : + ;; + + failed-upgrade) + ;; + + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 http://git-wip-us.apache.org/repos/asf/bigtop/blob/70c8dec5/bigtop-packages/src/deb/gridgain-hadoop/install_init_scripts.sh ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/deb/gridgain-hadoop/install_init_scripts.sh b/bigtop-packages/src/deb/gridgain-hadoop/install_init_scripts.sh new file mode 100644 index 0000000..6e019c7 --- /dev/null +++ b/bigtop-packages/src/deb/gridgain-hadoop/install_init_scripts.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# +# 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. + +SRC_PKG=gridgain-hadoop + +service_pkgdir=debian/$SRC_PKG +debdir=$service_pkgdir/DEBIAN +mkdir -p $service_pkgdir/etc/init.d/ $debdir +sed -i -e "s|@GRIDGAIN_DAEMON@|gridgain-hadoop|" debian/gridgain-hadoop.svc +echo bash debian/init.d.tmpl debian/gridgain-hadoop.svc deb $service_pkgdir/etc/init.d/$SRC_PKG +bash debian/init.d.tmpl debian/gridgain-hadoop.svc deb $service_pkgdir/etc/init.d/$SRC_PKG + +sed -e "s|@GRIDGAIN_DAEMON@|gridgain-hadoop|" debian/service-postinst.tpl > $debdir/postinst +sed -e "s|@GRIDGAIN_DAEMON@|gridgain-hadoop|" debian/service-postrm.tpl > $debdir/postrm +echo /etc/init.d/$SRC_PKG > $debdir/conffiles +chmod 755 $debdir/postinst $debdir/postrm $service_pkgdir/etc/init.d* http://git-wip-us.apache.org/repos/asf/bigtop/blob/70c8dec5/bigtop-packages/src/deb/gridgain-hadoop/rules ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/deb/gridgain-hadoop/rules b/bigtop-packages/src/deb/gridgain-hadoop/rules new file mode 100644 index 0000000..979c5d7 --- /dev/null +++ b/bigtop-packages/src/deb/gridgain-hadoop/rules @@ -0,0 +1,46 @@ +#!/usr/bin/make -f +# +# 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. +# +# -*- makefile -*- +SHELL=/bin/bash + +# Uncomment this to turn on verbose mode. +export DH_VERBOSE=1 + +# This has to be exported to make some magic below work. +export DH_OPTIONS + +gridgain-hadoop_pkg_name=gridgain-hadoop + +%: + dh $@ + +override_dh_auto_build: + bash debian/do-component-build -Dmaven.repo.local=${HOME}/.m2/repository + + +override_dh_auto_install: + cp debian/gridgain-hadoop.default debian/${gridgain-hadoop_pkg_name}/etc/default/${gridgain-hadoop_pkg_name} + bash -x debian/install_gridgain.sh \ + --build-dir=target \ + --conf-dir=/etc/${gridgain-hadoop_pkg_name}/conf.dist \ + --doc-dir=usr/share/doc/${gridgain-hadoop_pkg_name}-doc \ + --prefix=debian/tmp + ln -s /var/log/${gridgain-hadoop_pkg_name} debian/tmp/usr/lib/${gridgain-hadoop_pkg_name}/logs + ln -s /var/run/${gridgain-hadoop_pkg_name} debian/tmp/usr/lib/${gridgain-hadoop_pkg_name}/pids + + bash debian/install_init_scripts.sh http://git-wip-us.apache.org/repos/asf/bigtop/blob/70c8dec5/bigtop-packages/src/deb/gridgain-hadoop/service-postinst.tpl ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/deb/gridgain-hadoop/service-postinst.tpl b/bigtop-packages/src/deb/gridgain-hadoop/service-postinst.tpl new file mode 100644 index 0000000..3f5acfe --- /dev/null +++ b/bigtop-packages/src/deb/gridgain-hadoop/service-postinst.tpl @@ -0,0 +1,51 @@ +#!/bin/bash +# +# 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. + +# postinst script for gridgain-hadoop +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * <postinst> `configure' <most-recently-configured-version> +# * <old-postinst> `abort-upgrade' <new version> +# * <conflictor's-postinst> `abort-remove' `in-favour' <package> +# <new-version> +# * <postinst> `abort-remove' +# * <deconfigured's-postinst> `abort-deconfigure' `in-favour' +# <failed-install-package> <version> `removing' +# <conflicting-package> <version> +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + configure) + update-rc.d @GRIDGAIN_DAEMON@ defaults >/dev/null || exit 1 + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +exit 0 http://git-wip-us.apache.org/repos/asf/bigtop/blob/70c8dec5/bigtop-packages/src/deb/gridgain-hadoop/service-postrm.tpl ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/deb/gridgain-hadoop/service-postrm.tpl b/bigtop-packages/src/deb/gridgain-hadoop/service-postrm.tpl new file mode 100644 index 0000000..5818b30 --- /dev/null +++ b/bigtop-packages/src/deb/gridgain-hadoop/service-postrm.tpl @@ -0,0 +1,51 @@ +#!/bin/bash +# +# 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. + +# postrm script for gridgain-hadoop +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * <postrm> `remove' +# * <postrm> `purge' +# * <old-postrm> `upgrade' <new-version> +# * <new-postrm> `failed-upgrade' <old-version> +# * <new-postrm> `abort-install' +# * <new-postrm> `abort-install' <old-version> +# * <new-postrm> `abort-upgrade' <old-version> +# * <disappearer's-postrm> `disappear' <overwriter> +# <overwriter-version> +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + purge) + update-rc.d -f @GRIDGAIN_DAEMON@ remove > /dev/null || exit 1 + ;; + remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +exit 0 http://git-wip-us.apache.org/repos/asf/bigtop/blob/70c8dec5/bigtop-packages/src/deb/gridgain-hadoop/source/format ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/deb/gridgain-hadoop/source/format b/bigtop-packages/src/deb/gridgain-hadoop/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/bigtop-packages/src/deb/gridgain-hadoop/source/format @@ -0,0 +1 @@ +3.0 (quilt) http://git-wip-us.apache.org/repos/asf/bigtop/blob/70c8dec5/bigtop-packages/src/rpm/gridgain-hadoop/SPECS/gridgain-hadoop.spec ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/rpm/gridgain-hadoop/SPECS/gridgain-hadoop.spec b/bigtop-packages/src/rpm/gridgain-hadoop/SPECS/gridgain-hadoop.spec new file mode 100644 index 0000000..549914f --- /dev/null +++ b/bigtop-packages/src/rpm/gridgain-hadoop/SPECS/gridgain-hadoop.spec @@ -0,0 +1,223 @@ +# 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. +%define etc_gridgain_conf %{_sysconfdir}/%{name}/conf +%define etc_gridgain_conf_dist %{etc_gridgain_conf}.dist +%define gridgain_home /usr/lib/%{name} +%define bin_gridgain %{gridgain_home}/bin +%define lib_gridgain %{gridgain_home}/lib +%define conf_gridgain %{gridgain_home}/config +%define logs_gridgain %{gridgain_home}/logs +%define pids_gridgain %{gridgain_home}/pids +%define man_dir %{_mandir} +%define gridgain_username gridgain +%define gridgain_services gridgain-hadoop +%define vcs_tag release-6.5.2 + +%if %{?suse_version:1}0 + +# Only tested on openSUSE 11.4. le'ts update it for previous release when confirmed +%if 0%{suse_version} > 1130 +%define suse_check \# Define an empty suse_check for compatibility with older sles +%endif + +# SLES is more strict anc check all symlinks point to valid path +# But we do point to a hadoop jar which is not there at build time +# (but would be at install time). +# Since our package build system does not handle dependencies, +# these symlink checks are deactivated +%define __os_install_post \ + %{suse_check} ; \ + /usr/lib/rpm/brp-compress ; \ + %{nil} + +%define doc_gridgain %{_docdir}/%{name} +%global initd_dir %{_sysconfdir}/rc.d +%define alternatives_cmd update-alternatives + +%else + +# CentOS 5 does not have any dist macro +# So I will suppose anything that is not Mageia or a SUSE will be a RHEL/CentOS/Fedora +%if %{!?mgaversion:1}0 + +# FIXME: brp-repack-jars uses unzip to expand jar files +# Unfortunately guice-2.0.jar pulled by ivy contains some files and directories without any read permission +# and make whole process to fail. +# So for now brp-repack-jars is being deactivated until this is fixed. +# See BIGTOP-294 +#%define __os_install_post \ +# /usr/lib/rpm/redhat/brp-compress ; \ +# /usr/lib/rpm/redhat/brp-strip-static-archive %{__strip} ; \ +# /usr/lib/rpm/redhat/brp-strip-comment-note %{__strip} %{__objdump} ; \ +# /usr/lib/rpm/brp-python-bytecompile ; \ +# %{nil} +%endif + +%define doc_gridgain %{_docdir}/%{name}-%{gridgain_hadoop_version} +%global initd_dir %{_sysconfdir}/rc.d/init.d +%define alternatives_cmd alternatives + +%endif + + +Name: gridgain-hadoop +Version: %{gridgain_hadoop_version} +Release: %{gridgain_hadoop_release} +Summary: gridgain Hadoop accelerator. The system provides for in-memory caching of HDFS data and MR performance improvements +URL: http://gridgain.org/ +Group: Development/Libraries +Buildroot: %{_topdir}/INSTALL/%{name}-%{version} +License: APL2 +Source0: gridgain-hadoop-%{gridgain_hadoop_base_version}.tar.gz +Source1: do-component-build +Source2: install_gridgain.sh +Source3: gridgain-hadoop.svc +Source4: init.d.tmpl +Source5: gridgain-hadoop.default +BuildArch: noarch +Requires: coreutils, /usr/sbin/useradd, /sbin/chkconfig, /sbin/service +Requires: hadoop-hdfs, hadoop-mapreduce, bigtop-utils >= 0.7 + +%if 0%{?mgaversion} +Requires: bsh-utils +%else +Requires: sh-utils +%endif + +%description +GridGain is an open-source, distributed, in-memory computation platform + + * HDFS caching and MR performance booster + +%package service +Summary: Hadoop Accelerator platform +Group: System/Daemons +Requires: %{name} = %{version}-%{release} +Requires(pre): %{name} = %{version}-%{release} + +%if %{?suse_version:1}0 +# Required for init scripts +Requires: insserv +%endif + +%if 0%{?mgaversion} +# Required for init scripts +Requires: initscripts +%endif + +# CentOS 5 does not have any dist macro +# So I will suppose anything that is not Mageia or a SUSE will be a RHEL/CentOS/Fedora +%if %{!?suse_version:1}0 && %{!?mgaversion:1}0 +# Required for init scripts +Requires: redhat-lsb +%endif + +%description service +Gridgain accelerator package + +%package doc +Summary: Gridgain Documentation +Group: Documentation +BuildArch: noarch + +%description doc +Documentation for GridGain platform + +%prep +%setup -n gridgain-%{vcs_tag} + +%build +env gridgain_hadoop_VERSION=%{version} bash %{SOURCE1} + +%install +%__rm -rf $RPM_BUILD_ROOT +bash %{SOURCE2} \ + --build-dir=target \ + --doc-dir=%{doc_gridgain} \ + --conf-dir=%{etc_gridgain_conf_dist} \ + --prefix=$RPM_BUILD_ROOT + +%__install -d -m 0755 $RPM_BUILD_ROOT/%{initd_dir}/ + +%__install -d -m 0755 $RPM_BUILD_ROOT/etc/default/ +%__install -m 0644 %{SOURCE5} $RPM_BUILD_ROOT/etc/default/%{name} + +%__install -d -m 0755 %{buildroot}/%{_localstatedir}/log/%{name} + +ln -s %{_localstatedir}/log/%{name} %{buildroot}/%{logs_gridgain} + +%__install -d -m 0755 %{buildroot}/%{_localstatedir}/run/%{name} +ln -s %{_localstatedir}/run/%{name} %{buildroot}/%{pids_gridgain} + +for service in %{gridgain_services} +do + init_file=$RPM_BUILD_ROOT/%{initd_dir}/%{name} + %__sed -e "s|@GRIDGAIN_DAEMON@|${service}|" %{SOURCE3} > ${RPM_SOURCE_DIR}/gridgain.node + bash %{SOURCE4} ${RPM_SOURCE_DIR}/gridgain.node rpm $init_file + + chmod 755 $init_file +done + +%__install -d -m 0755 $RPM_BUILD_ROOT/usr/bin + +# Pull hadoop from their packages +rm -f $RPM_BUILD_ROOT/%{lib_gridgain}/libs/{hadoop}*.jar + +%pre +getent group gridgain 2>/dev/null >/dev/null || /usr/sbin/groupadd -r gridgain +getent passwd gridgain 2>&1 > /dev/null || /usr/sbin/useradd -c "gridgain" -s /sbin/nologin -g gridgain -r -d /var/run/gridgain gridgain 2> /dev/null || : + +%post +%{alternatives_cmd} --install %{etc_gridgain_conf} %{name}-conf %{etc_gridgain_conf_dist} 30 + +%preun +if [ "$1" = 0 ]; then + %{alternatives_cmd} --remove %{name}-conf %{etc_gridgain_conf_dist} || : +fi + +####################### +#### FILES SECTION #### +####################### +%files +%defattr(-,gridgain,gridgain) +%dir %{_localstatedir}/log/%{name} +%dir %{_localstatedir}/run/%{name} + +%defattr(-,root,root) +%config(noreplace) %{_sysconfdir}/default/%{name} +%{gridgain_home} +/usr/bin/%{name} +%config(noreplace) %{etc_gridgain_conf_dist} + +%files doc +%defattr(-,root,root) +%doc %{doc_gridgain}/ + +%define service_macro() \ +%files %1 \ +%attr(0755,root,root)/%{initd_dir}/%{name} \ +%post %1 \ +chkconfig --add %{name} \ +\ +%preun %1 \ +if [ $1 = 0 ] ; then \ + service %{name} stop > /dev/null 2>&1 \ + chkconfig --del %{name} \ +fi \ +%postun %1 \ +if [ $1 -ge 1 ]; then \ + service %{name} condrestart >/dev/null 2>&1 \ +fi +%service_macro service http://git-wip-us.apache.org/repos/asf/bigtop/blob/70c8dec5/bigtop-tests/smoke-tests/gridgain-hadoop/TestGridGainHadoop.groovy ---------------------------------------------------------------------- diff --git a/bigtop-tests/smoke-tests/gridgain-hadoop/TestGridGainHadoop.groovy b/bigtop-tests/smoke-tests/gridgain-hadoop/TestGridGainHadoop.groovy new file mode 100644 index 0000000..ca9af2f --- /dev/null +++ b/bigtop-tests/smoke-tests/gridgain-hadoop/TestGridGainHadoop.groovy @@ -0,0 +1,72 @@ +/** + * 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 + * <p/> + * http://www.apache.org/licenses/LICENSE-2.0 + * <p/> + * 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. + */ + +package org.apache.bigtop.itest.hadoop.gridgain + +import org.apache.bigtop.itest.shell.Shell +import org.apache.commons.logging.Log +import org.apache.commons.logging.LogFactory +import org.junit.Before +import org.junit.Test + +import static org.junit.Assert.assertEquals + +class TestGridGainHadoop { + static private Log LOG = LogFactory.getLog(Object.class) + + static Shell sh = new Shell("/bin/bash -s") + + static String hadoopClassPath = "/usr/lib/gridgain-hadoop/libs/*:/usr/lib/gridgain-hadoop/libs/gridgain-hadoop/*" + + static String cmdPrefix = "export HADOOP_CLASSPATH=$hadoopClassPath:\$HADOOP_CLASSPATH; " + + "export HADOOP_CONF_DIR=\$(pwd)/conf;" + + + private static void execCommand(String cmd) { + LOG.info(cmd) + + sh.exec("$cmdPrefix $cmd") + } + + @Before + void cleanFileSystem() { + execCommand("hadoop fs -rm -r /gh-input") + execCommand("hadoop fs -rm -r /gh-output") + } + + @Test + void test() { + execCommand("hadoop fs -mkdir /gh-input") + execCommand("hadoop fs -put test.data /gh-input/") + + execCommand("hadoop jar \$HADOOP_MAPRED_HOME/hadoop-mapreduce-examples.jar wordcount /gh-input /gh-output") + + execCommand("hadoop fs -cat /gh-output/part-r-00000") + + String expected = + "black\t5\n" + + "blue\t11\n" + + "green\t11\n" + + "white\t5\n" + + "yellow\t11"; + + String actual = sh.out.join('\n') + + assertEquals("Incorrect output", expected, actual) + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/bigtop/blob/70c8dec5/bigtop-tests/smoke-tests/gridgain-hadoop/build.gradle ---------------------------------------------------------------------- diff --git a/bigtop-tests/smoke-tests/gridgain-hadoop/build.gradle b/bigtop-tests/smoke-tests/gridgain-hadoop/build.gradle new file mode 100644 index 0000000..9240fcc --- /dev/null +++ b/bigtop-tests/smoke-tests/gridgain-hadoop/build.gradle @@ -0,0 +1,53 @@ +/** + * 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 + * <p/> + * http://www.apache.org/licenses/LICENSE-2.0 + * <p/> + * 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. + */ +apply plugin: 'groovy' + +repositories { + mavenCentral() +} + +dependencies { + //needed to avoid groovy not on classpath error. + testCompile module('org.codehaus.groovy:groovy:1.8.0') + testCompile group: 'org.apache.bigtop.itest', name: 'itest-common', version: itestVersion, transitive: 'true' + testCompile group: 'org.apache.hadoop', name: 'hadoop-common', version: hadoopVersion, transitive: 'true' + testCompile group: 'org.apache.hadoop', name: 'hadoop-hdfs', version: hadoopVersion, transitive: 'true' +} + +def tests_to_include() { + return [ + "TestGridGainHadoop.groovy" + ]; +} + +sourceSets { + test { + resources { + srcDirs = [ + 'conf/' + ] + } + groovy { + srcDirs = ["$System.env.BIGTOP_HOME"+"/bigtop-tests/smoke-tests/gridgain-hadoop/"] + } + } +} + +test.doFirst { + checkEnv(["BIGTOP_HOME", "HADOOP_MAPRED_HOME"]) +} http://git-wip-us.apache.org/repos/asf/bigtop/blob/70c8dec5/bigtop-tests/smoke-tests/gridgain-hadoop/conf/core-site.xml ---------------------------------------------------------------------- diff --git a/bigtop-tests/smoke-tests/gridgain-hadoop/conf/core-site.xml b/bigtop-tests/smoke-tests/gridgain-hadoop/conf/core-site.xml new file mode 100644 index 0000000..5411fc4 --- /dev/null +++ b/bigtop-tests/smoke-tests/gridgain-hadoop/conf/core-site.xml @@ -0,0 +1,65 @@ +<?xml version="1.0" encoding="UTF-8"?> +<?xml-stylesheet type="text/xsl" href="configuration.xsl"?> +<!-- + Licensed 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. See accompanying LICENSE file. +--> + +<!-- + This template file contains settings needed to run Apache Hadoop jobs + with GridGain's distributed in-memory file system GGFS. + + You can replace '$HADOOP_HOME/etc/hadoop/core-site.xml' file with this one + to work with GridGain GGFS nodes running on localhost (these local nodes can be + a part of distributed cluster though). To work with file system on remote + hosts you need to change the host of file system URI to any host running + GridGain's GGFS node. + + Note that GridGain jars must be in Apache Hadoop client classpath to work + with this configuration. + + Run script '$GRIDGAIN_HOME/bin/setup-hadoop.{sh|bat}' for Apache Hadoop client setup. +--> + +<configuration> + <!-- + Set default file system to GGFS instance named "ggfs" configured in GridGain. + --> + <property> + <name>fs.default.name</name> + <value>ggfs://ggfs@localhost</value> + </property> + + <!-- + Set Hadoop 1.* file system implementation class for GGFS. + --> + <property> + <name>fs.ggfs.impl</name> + <value>org.gridgain.grid.ggfs.hadoop.v1.GridGgfsHadoopFileSystem</value> + </property> + + <!-- + Set Hadoop 2.* file system implementation class for GGFS. + --> + <property> + <name>fs.AbstractFileSystem.ggfs.impl</name> + <value>org.gridgain.grid.ggfs.hadoop.v2.GridGgfsHadoopFileSystem</value> + </property> + + <!-- + Disallow data node replacement since it does not make sense for GridGain's GGFS nodes. + --> + <property> + <name>dfs.client.block.write.replace-datanode-on-failure.policy</name> + <value>NEVER</value> + </property> +</configuration> http://git-wip-us.apache.org/repos/asf/bigtop/blob/70c8dec5/bigtop-tests/smoke-tests/gridgain-hadoop/conf/log4j.properties ---------------------------------------------------------------------- diff --git a/bigtop-tests/smoke-tests/gridgain-hadoop/conf/log4j.properties b/bigtop-tests/smoke-tests/gridgain-hadoop/conf/log4j.properties new file mode 100644 index 0000000..0723326 --- /dev/null +++ b/bigtop-tests/smoke-tests/gridgain-hadoop/conf/log4j.properties @@ -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. + +# Set root logger level to INFO and its only appender to A1. +log4j.rootLogger=INFO, A1 + +# A1 is set to be a ConsoleAppender. +log4j.appender.A1=org.apache.log4j.ConsoleAppender + +# A1 uses PatternLayout. +log4j.appender.A1.layout=org.apache.log4j.PatternLayout +log4j.appender.A1.layout.ConversionPattern=%-4r [BIGTOP-TEST-LOG %t] %-5p %c %x --- %m%n http://git-wip-us.apache.org/repos/asf/bigtop/blob/70c8dec5/bigtop-tests/smoke-tests/gridgain-hadoop/conf/mapred-site.xml ---------------------------------------------------------------------- diff --git a/bigtop-tests/smoke-tests/gridgain-hadoop/conf/mapred-site.xml b/bigtop-tests/smoke-tests/gridgain-hadoop/conf/mapred-site.xml new file mode 100644 index 0000000..d2be8eb --- /dev/null +++ b/bigtop-tests/smoke-tests/gridgain-hadoop/conf/mapred-site.xml @@ -0,0 +1,62 @@ +<?xml version="1.0"?> +<?xml-stylesheet type="text/xsl" href="configuration.xsl"?> +<!-- + Licensed 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. See accompanying LICENSE file. +--> + +<!-- + This template file contains settings needed to run Apache Hadoop jobs + with GridGain In-Memory Accelerator. + + You can replace '$HADOOP_HOME/etc/hadoop/mapred-site.xml' file with this one + to run jobs on localhost (local node can be a part of distributed cluster though). + To run jobs on remote host you have to change jobtracker address to the REST address + of any running GridGain node. + + Note that GridGain jars must be in Apache Hadoop client classpath to work + with this configuration. + + Run script '$GRIDGAIN_HOME/bin/setup-hadoop.{sh|bat}' for Apache Hadoop client setup. +--> + +<configuration> + <!-- + Framework name must be set to 'gridgain'. + --> + <property> + <name>mapreduce.framework.name</name> + <value>gridgain</value> + </property> + + <!-- + Job tracker address must be set to the REST address of any running GridGain node. + --> + <property> + <name>mapreduce.jobtracker.address</name> + <value>localhost:11211</value> + </property> + + <!-- Parameters for job tuning. --> + <!-- + <property> + <name>mapreduce.job.reduces</name> + <value>1</value> + </property> + + <property> + <name>mapreduce.job.maps</name> + <value>4</value> + </property> + --> + +</configuration> http://git-wip-us.apache.org/repos/asf/bigtop/blob/70c8dec5/bigtop-tests/smoke-tests/gridgain-hadoop/test.data ---------------------------------------------------------------------- diff --git a/bigtop-tests/smoke-tests/gridgain-hadoop/test.data b/bigtop-tests/smoke-tests/gridgain-hadoop/test.data new file mode 100644 index 0000000..6599669 --- /dev/null +++ b/bigtop-tests/smoke-tests/gridgain-hadoop/test.data @@ -0,0 +1,11 @@ +green blue yellow +yellow green blue black white +yellow green blue +white yellow green blue black +blue yellow green +black white yellow green blue +green blue yellow +blue black white yellow green +yellow green blue +green blue black white yellow +blue yellow green http://git-wip-us.apache.org/repos/asf/bigtop/blob/70c8dec5/bigtop-tests/test-artifacts/package/src/main/resources/package_data.xml ---------------------------------------------------------------------- diff --git a/bigtop-tests/test-artifacts/package/src/main/resources/package_data.xml b/bigtop-tests/test-artifacts/package/src/main/resources/package_data.xml index 415f034..7024c87 100644 --- a/bigtop-tests/test-artifacts/package/src/main/resources/package_data.xml +++ b/bigtop-tests/test-artifacts/package/src/main/resources/package_data.xml @@ -629,7 +629,48 @@ easy to test, and efficient to run.</description> <hive-webhcat>/self</hive-webhcat> </deps> </hive-webhcat-server> - <hbase> + <gridgain-hadoop> + <metadata> + <summary>gridgain Hadoop accelerator. The system provides for in-memory caching of HDFS data and MR performance improvements</summary> + <description>GridGain is an open-source, distributed, in-memory computation platform + + * HDFS caching and MR performance booster + + </description> + <url>http://gridgain.org/</url> + </metadata> + <deps> + <hadoop-hdfs/> + <hadoop-mapreduce/> + <bigtop-utils/> + </deps> + <alternatives> + <gridgain-hadoop-conf> + <status>auto</status> + <link>/etc/gridgain-hadoop/conf</link> + <value>/etc/gridgain-hadoop/conf.dist</value> + <alt>/etc/gridgain-hadoop/conf.dist</alt> + </gridgain-hadoop-conf> + </alternatives> + </gridgain-hadoop> + <gridgain-hadoop-service> + <metadata> + <summary>Hadoop Accelerator platform</summary> + <description>GridGain is an open-source, distributed, in-memory computation platform</description> + <url>http://gridgain.org/</url> + </metadata> + <deps> + <gridgain-hadoop/> + </deps> + </gridgain-hadoop-service> + <gridgain-hadoop-doc> + <metadata> + <summary>Gridgain Documentation</summary> + <description>Documentation for GridGain platform</description> + <url>http://gridgain.org/</url> + </metadata> + </gridgain-hadoop-doc> + <hbase> <metadata> <summary>HBase is the Hadoop database. Use it when you need random, realtime read/write access to your Big Data. This project's goal is the hosting of very large tables -- billions of rows X millions of columns -- atop clusters of commodity hardware.</summary> <description>HBase is an open-source, distributed, column-oriented store modeled after Google' Bigtable: A Distributed Storage System for Structured Data by Chang et al. Just as Bigtable leverages the distributed data storage provided by the Google File System, HBase provides Bigtable-like capabilities on top of Hadoop. HBase includes: http://git-wip-us.apache.org/repos/asf/bigtop/blob/70c8dec5/bigtop.mk ---------------------------------------------------------------------- diff --git a/bigtop.mk b/bigtop.mk index 5a19970..e2e8e26 100644 --- a/bigtop.mk +++ b/bigtop.mk @@ -48,6 +48,21 @@ HADOOP_SITE=$(APACHE_MIRROR)$(HADOOP_DOWNLOAD_PATH) HADOOP_ARCHIVE=$(APACHE_ARCHIVE)$(HADOOP_DOWNLOAD_PATH) $(eval $(call PACKAGE,hadoop,HADOOP)) +# Gridgain +GRIDGAIN_HADOOP_NAME=gridgain-hadoop +GRIDGAIN_HADOOP_RELNOTES_NAME=Gridgain +GRIDGAIN_HADOOP_PKG_NAME=gridgain-hadoop +GRIDGAIN_HADOOP_VCS_TAG=release-6.5.2 +GRIDGAIN_HADOOP_BASE_VERSION=6.5.2 +GRIDGAIN_HADOOP_PKG_VERSION=6.5.2 +GRIDGAIN_HADOOP_RELEASE_VERSION=1 +GRIDGAIN_HADOOP_TARBALL_DST=$(GRIDGAIN_HADOOP_NAME)-$(GRIDGAIN_HADOOP_BASE_VERSION).tar.gz +GRIDGAIN_HADOOP_TARBALL_SRC=$(GRIDGAIN_HADOOP_VCS_TAG).tar.gz +GRIDGAIN_HADOOP_DOWNLOAD_PATH=https://github.com/gridgain/gridgain/archive +GRIDGAIN_HADOOP_SITE=$(GRIDGAIN_HADOOP_DOWNLOAD_PATH) +GRIDGAIN_HADOOP_ARCHIVE=$(GRIDGAIN_HADOOP_DOWNLOAD_PATH) +$(eval $(call PACKAGE,gridgain-hadoop,GRIDGAIN_HADOOP)) + # HBase HBASE_NAME=hbase HBASE_RELNOTES_NAME=Apache HBase
