Updated Branches: refs/heads/master d00a6bf5e -> 7c382699e
BIGTOP-993. Add packaging for Phoenix Project: http://git-wip-us.apache.org/repos/asf/bigtop/repo Commit: http://git-wip-us.apache.org/repos/asf/bigtop/commit/7c382699 Tree: http://git-wip-us.apache.org/repos/asf/bigtop/tree/7c382699 Diff: http://git-wip-us.apache.org/repos/asf/bigtop/diff/7c382699 Branch: refs/heads/master Commit: 7c382699e95e55567ba19a144ad8ff4c81c92232 Parents: d00a6bf Author: Andrew Purtell <[email protected]> Authored: Tue Oct 8 08:36:04 2013 -0700 Committer: Andrew Purtell <[email protected]> Committed: Tue Oct 8 08:49:19 2013 -0700 ---------------------------------------------------------------------- .../src/common/phoenix/do-component-build | 27 ++ .../src/common/phoenix/install_phoenix.sh | 133 +++++++++ bigtop-packages/src/deb/phoenix/changelog | 1 + bigtop-packages/src/deb/phoenix/compat | 1 + bigtop-packages/src/deb/phoenix/control | 34 +++ bigtop-packages/src/deb/phoenix/copyright | 15 + bigtop-packages/src/deb/phoenix/phoenix.install | 1 + bigtop-packages/src/deb/phoenix/rules | 56 ++++ bigtop-packages/src/deb/phoenix/source/format | 1 + bigtop-packages/src/rpm/phoenix/RPMS/.gitignore | 1 + .../src/rpm/phoenix/SOURCES/.gitignore | 0 .../src/rpm/phoenix/SPECS/.gitignore | 3 + .../src/rpm/phoenix/SPECS/phoenix.spec | 147 +++++++++ .../src/rpm/phoenix/SRPMS/.gitignore | 0 bigtop-tests/test-artifacts/phoenix/pom.xml | 33 +++ .../itest/phoenix/smoke/TestPhoenixSmoke.groovy | 296 +++++++++++++++++++ bigtop-tests/test-artifacts/pom.xml | 1 + .../test-execution/smokes/phoenix/pom.xml | 60 ++++ bigtop-tests/test-execution/smokes/pom.xml | 8 + bigtop.mk | 13 + 20 files changed, 831 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/bigtop/blob/7c382699/bigtop-packages/src/common/phoenix/do-component-build ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/common/phoenix/do-component-build b/bigtop-packages/src/common/phoenix/do-component-build new file mode 100644 index 0000000..8a7efdb --- /dev/null +++ b/bigtop-packages/src/common/phoenix/do-component-build @@ -0,0 +1,27 @@ +#!/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 + +mvn -DskipTests -Dhadoop.profile=2 \ + -Dhadoop.version=$HADOOP_VERSION \ + -Dhbase.version=$HBASE_VERSION \ + clean package "$@" +rm -rf build +mkdir build +tar -C build --strip-components=1 -xzf target/phoenix*.tar.gz http://git-wip-us.apache.org/repos/asf/bigtop/blob/7c382699/bigtop-packages/src/common/phoenix/install_phoenix.sh ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/common/phoenix/install_phoenix.sh b/bigtop-packages/src/common/phoenix/install_phoenix.sh new file mode 100755 index 0000000..07da426 --- /dev/null +++ b/bigtop-packages/src/common/phoenix/install_phoenix.sh @@ -0,0 +1,133 @@ +#!/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 phoenix dist.dir + --prefix=PREFIX path to install into + + Optional options: + --doc-dir=DIR path to install docs into [/usr/share/doc/phoenix] + --lib-dir=DIR path to install phoenix home [/usr/lib/phoenix] + --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/phoenix} +LIB_DIR=${LIB_DIR:-/usr/lib/phoenix} +BIN_DIR=${BIN_DIR:-/usr/lib/phoenix/bin} +ETC_DIR=${ETC_DIR:-/etc/phoenix} +CONF_DIR=${CONF_DIR:-${ETC_DIR}/conf.dist} + +install -d -m 0755 $PREFIX/$BIN_DIR +install -d -m 0755 $PREFIX/$LIB_DIR +install -d -m 0755 $PREFIX/$LIB_DIR/lib +install -d -m 0755 $PREFIX/$DOC_DIR +install -d -m 0755 $PREFIX/$MAN_DIR +install -d -m 0755 $PREFIX/$ETC_DIR +install -d -m 0755 $PREFIX/$CONF_DIR + +cp -ra $BUILD_DIR/lib/* $PREFIX/$LIB_DIR/lib +cp -a $BUILD_DIR/phoenix*.jar $PREFIX/$LIB_DIR +cp -a $BUILD_DIR/docs/* $PREFIX/$DOC_DIR +cp -a $BUILD_DIR/examples $PREFIX/$DOC_DIR +cp -a $BUILD_DIR/*.txt $PREFIX/$DOC_DIR + +cp -a $BUILD_DIR/bin/sqlline.sh $PREFIX/$BIN_DIR +# needed for sqlline.sh +cp -a $BUILD_DIR/bin/log4j.properties $PREFIX/$CONF_DIR +# Fix up sqlline.sh for Bigtop install layout +sed -i -e s#target## -e s#\$current_dir/log4j.properties#$ETC_DIR/conf/log4j.properties# $PREFIX/$BIN_DIR/sqlline.sh + +# Remove sources jar +rm $PREFIX/$LIB_DIR/phoenix-*-sources.jar + +# Remove the executable bit from jars to avoid lintian warnings +find $PREFIX/$LIB_DIR -name '*.jar' -exec chmod a-x {} \; + +# Create version independent symlinks +ln -s `cd $PREFIX/$LIB_DIR ; ls phoenix*-client.jar` $PREFIX/$LIB_DIR/phoenix-client.jar http://git-wip-us.apache.org/repos/asf/bigtop/blob/7c382699/bigtop-packages/src/deb/phoenix/changelog ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/deb/phoenix/changelog b/bigtop-packages/src/deb/phoenix/changelog new file mode 100644 index 0000000..547ed02 --- /dev/null +++ b/bigtop-packages/src/deb/phoenix/changelog @@ -0,0 +1 @@ +--- This is auto-generated http://git-wip-us.apache.org/repos/asf/bigtop/blob/7c382699/bigtop-packages/src/deb/phoenix/compat ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/deb/phoenix/compat b/bigtop-packages/src/deb/phoenix/compat new file mode 100644 index 0000000..7f8f011 --- /dev/null +++ b/bigtop-packages/src/deb/phoenix/compat @@ -0,0 +1 @@ +7 http://git-wip-us.apache.org/repos/asf/bigtop/blob/7c382699/bigtop-packages/src/deb/phoenix/control ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/deb/phoenix/control b/bigtop-packages/src/deb/phoenix/control new file mode 100644 index 0000000..4eff48d --- /dev/null +++ b/bigtop-packages/src/deb/phoenix/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: phoenix +Section: misc +Priority: extra +Maintainer: Bigtop <[email protected]> +Build-Depends: debhelper (>= 7.0.50~) +Standards-Version: 3.8.0 +Homepage: https://github.com/forcedotcom/phoenix + +Package: phoenix +Architecture: all +Depends: zookeeper, hadoop, hadoop-mapreduce, hadoop-yarn, hbase, bigtop-utils (>= 0.7) +Description: Phoenix is a SQL skin over HBase + Phoenix is a SQL skin over HBase delivered as a client-embedded JDBC driver. + The Phoenix query engine transforms an SQL query into one or more HBase scans, + and orchestrates their execution to produce standard JDBC result sets. Direct + use of the HBase API, along with coprocessors and custom filters, results in + performance on the order of milliseconds for small queries, or seconds for + tens of millions of rows. Applications interact with Phoenix through a + standard JDBC interface; all the usual interfaces are supported. http://git-wip-us.apache.org/repos/asf/bigtop/blob/7c382699/bigtop-packages/src/deb/phoenix/copyright ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/deb/phoenix/copyright b/bigtop-packages/src/deb/phoenix/copyright new file mode 100644 index 0000000..c2b3681 --- /dev/null +++ b/bigtop-packages/src/deb/phoenix/copyright @@ -0,0 +1,15 @@ +Format: http://dep.debian.net/deps/dep5 +Source: https://github.com/forcedotcom/phoenix +Upstream-Name: Phoenix + +Files: * +Copyright: Copyright (c) 2013, Salesforce.com, Inc. +License: BSD-3-clause + +Files debian/* +Copyright: 2013, 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/7c382699/bigtop-packages/src/deb/phoenix/phoenix.install ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/deb/phoenix/phoenix.install b/bigtop-packages/src/deb/phoenix/phoenix.install new file mode 100644 index 0000000..123b3e9 --- /dev/null +++ b/bigtop-packages/src/deb/phoenix/phoenix.install @@ -0,0 +1 @@ +/usr/lib/phoenix http://git-wip-us.apache.org/repos/asf/bigtop/blob/7c382699/bigtop-packages/src/deb/phoenix/rules ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/deb/phoenix/rules b/bigtop-packages/src/deb/phoenix/rules new file mode 100755 index 0000000..03ab333 --- /dev/null +++ b/bigtop-packages/src/deb/phoenix/rules @@ -0,0 +1,56 @@ +#!/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 -*- + +# 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 + +phoenix_pkg_name=phoenix +zookeeper_home=/usr/lib/zookeeper +hadoop_home=/usr/lib/hadoop +hadoop_mapreduce_home=/usr/lib/hadoop-mapreduce +hadoop_yarn_home=/usr/lib/hadoop-yarn +hbase_home=/usr/lib/hbase + +%: + dh $@ + +override_dh_auto_build: + # we'll just use the build from the tarball. + mkdir -p debian/tmp/bigtop-empty + bash debian/do-component-build -Dmaven.repo.local=${HOME}/.m2/repository + +override_dh_auto_install: + bash -x debian/install_phoenix.sh \ + --build-dir=$${PWD}/build \ + --prefix=debian/tmp + # Symlink in the dependency jars from their packages. + rm -f debian/tmp/usr/lib/${phoenix_pkg_name}/lib/zookeeper*.jar + ln -f -s ${zookeeper_home}/zookeeper.jar debian/tmp/usr/lib/${phoenix_pkg_name}/lib/ + rm -f debian/tmp/usr/lib/${phoenix_pkg_name}/lib/hadoop*.jar + ln -f -s ${hadoop_home}/hadoop-annotations.jar debian/tmp/usr/lib/${phoenix_pkg_name}/lib/ + ln -f -s ${hadoop_home}/hadoop-auth.jar debian/tmp/usr/lib/${phoenix_pkg_name}/lib/ + ln -f -s ${hadoop_home}/hadoop-common.jar debian/tmp/usr/lib/${phoenix_pkg_name}/lib/ + ln -f -s ${hadoop_mapreduce_home}/hadoop-mapreduce-client-core.jar debian/tmp/usr/lib/${phoenix_pkg_name}/lib/ + ln -f -s ${hadoop_yarn_home}/hadoop-yarn-api.jar debian/tmp/usr/lib/${phoenix_pkg_name}/lib/ + ln -f -s ${hadoop_yarn_home}/hadoop-yarn-common.jar debian/tmp/usr/lib/${phoenix_pkg_name}/lib/ + rm -f debian/tmp/usr/lib/${phoenix_pkg_name}/lib/hbase*.jar + ln -f -s ${hbase_home}/hbase.jar debian/tmp/usr/lib/${phoenix_pkg_name}/lib/ http://git-wip-us.apache.org/repos/asf/bigtop/blob/7c382699/bigtop-packages/src/deb/phoenix/source/format ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/deb/phoenix/source/format b/bigtop-packages/src/deb/phoenix/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/bigtop-packages/src/deb/phoenix/source/format @@ -0,0 +1 @@ +3.0 (quilt) http://git-wip-us.apache.org/repos/asf/bigtop/blob/7c382699/bigtop-packages/src/rpm/phoenix/RPMS/.gitignore ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/rpm/phoenix/RPMS/.gitignore b/bigtop-packages/src/rpm/phoenix/RPMS/.gitignore new file mode 100644 index 0000000..1ab8c79 --- /dev/null +++ b/bigtop-packages/src/rpm/phoenix/RPMS/.gitignore @@ -0,0 +1 @@ +repodata http://git-wip-us.apache.org/repos/asf/bigtop/blob/7c382699/bigtop-packages/src/rpm/phoenix/SOURCES/.gitignore ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/rpm/phoenix/SOURCES/.gitignore b/bigtop-packages/src/rpm/phoenix/SOURCES/.gitignore new file mode 100644 index 0000000..e69de29 http://git-wip-us.apache.org/repos/asf/bigtop/blob/7c382699/bigtop-packages/src/rpm/phoenix/SPECS/.gitignore ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/rpm/phoenix/SPECS/.gitignore b/bigtop-packages/src/rpm/phoenix/SPECS/.gitignore new file mode 100644 index 0000000..caa5471 --- /dev/null +++ b/bigtop-packages/src/rpm/phoenix/SPECS/.gitignore @@ -0,0 +1,3 @@ +hadoop.spec +pig.spec +hive.spec http://git-wip-us.apache.org/repos/asf/bigtop/blob/7c382699/bigtop-packages/src/rpm/phoenix/SPECS/phoenix.spec ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/rpm/phoenix/SPECS/phoenix.spec b/bigtop-packages/src/rpm/phoenix/SPECS/phoenix.spec new file mode 100644 index 0000000..6ef1696 --- /dev/null +++ b/bigtop-packages/src/rpm/phoenix/SPECS/phoenix.spec @@ -0,0 +1,147 @@ +# 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 phoenix_home /usr/lib/%{name} +%define bin_phoenix %{phoenix_home}/bin +%define etc_phoenix_conf %{_sysconfdir}/%{name}/conf +%define etc_phoenix_conf_dist %{etc_phoenix_conf}.dist +%define lib_phoenix %{phoenix_home}/lib +%define man_dir %{_mandir} +%define zookeeper_home /usr/lib/zookeeper +%define hadoop_home /usr/lib/hadoop +%define hadoop_mapreduce_home /usr/lib/hadoop-mapreduce +%define hadoop_yarn_home /usr/lib/hadoop-yarn +%define hbase_home /usr/lib/hbase + +%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_phoenix %{_docdir}/%{name} +%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_phoenix %{_docdir}/%{name}-%{phoenix_version} +%define alternatives_cmd alternatives + +%endif + + +Name: phoenix +Version: %{phoenix_version} +Release: %{phoenix_release} +Summary: Phoenix is a SQL skin over HBase and client-embedded JDBC driver. +URL: https://github.com/forcedotcom/phoenix +Group: Development/Libraries +Buildroot: %{_topdir}/INSTALL/%{name}-%{version} +License: APL2 +Source0: %{name}-%{phoenix_base_version}.tar.gz +Source1: do-component-build +Source2: install_phoenix.sh +BuildArch: noarch +Requires: hadoop, hadoop-mapreduce, hadoop-yarn, hbase, zookeeper + +%if 0%{?mgaversion} +Requires: bsh-utils +%else +Requires: sh-utils +%endif + +%description +Phoenix is a SQL skin over HBase, delivered as a client-embedded JDBC driver. +The Phoenix query engine transforms an SQL query into one or more HBase scans, +and orchestrates their execution to produce standard JDBC result sets. Direct +use of the HBase API, along with coprocessors and custom filters, results in +performance on the order of milliseconds for small queries, or seconds for +tens of millions of rows. Applications interact with Phoenix through a +standard JDBC interface; all the usual interfaces are supported. + + +%prep +%setup -n %{name}-%{phoenix_base_version} + +%build +bash %{SOURCE1} + +%install +%__rm -rf $RPM_BUILD_ROOT +bash %{SOURCE2} \ + --build-dir=build \ + --doc-dir=%{doc_phoenix} \ + --prefix=$RPM_BUILD_ROOT + +%post +%{alternatives_cmd} --install %{etc_phoenix_conf} %{name}-conf %{etc_phoenix_conf_dist} 30 + +%preun +if [ "$1" = 0 ]; then + %{alternatives_cmd} --remove %{name}-conf %{etc_phoenix_conf_dist} || : +fi + +# Pull zookeeper, hadoop, hadoop-mapreduce, hadoop-yarn, and hbase deps from their packages +rm -f $RPM_BUILD_ROOT/%{lib_phoenix}/zookeeper*.jar +ln -f -s %{zookeeper_home}/zookeeper.jar $RPM_BUILD_ROOT/%{lib_phoenix} +rm -f $RPM_BUILD_ROOT/%{lib_phoenix}/hadoop*.jar +ln -f -s %{hadoop_home}/hadoop-annotations.jar $RPM_BUILD_ROOT/%{lib_phoenix} +ln -f -s %{hadoop_home}/hadoop-auth.jar $RPM_BUILD_ROOT/%{lib_phoenix} +ln -f -s %{hadoop_home}/hadoop-common.jar $RPM_BUILD_ROOT/%{lib_phoenix} +ln -f -s %{hadoop_mapreduce_home}/hadoop-mapreduce-client-core.jar $RPM_BUILD_ROOT/%{lib_phoenix} +ln -f -s %{hadoop_yarn_home}/hadoop-yarn-api.jar $RPM_BUILD_ROOT/%{lib_phoenix} +ln -f -s %{hadoop_yarn_home}/hadoop-yarn-common.jar $RPM_BUILD_ROOT/%{lib_phoenix} + +rm -f $RPM_BUILD_ROOT/%{lib_phoenix}/hbase*.jar +ln -f -s %{hbase_home}/hbase.jar $RPM_BUILD_ROOT/%{lib_phoenix} + + +####################### +#### FILES SECTION #### +####################### +%files +%defattr(-,root,root,755) +%doc %{doc_phoenix} +%{phoenix_home}/phoenix-*.jar +%{lib_phoenix} +%{bin_phoenix} +%config(noreplace) %{etc_phoenix_conf_dist} http://git-wip-us.apache.org/repos/asf/bigtop/blob/7c382699/bigtop-packages/src/rpm/phoenix/SRPMS/.gitignore ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/rpm/phoenix/SRPMS/.gitignore b/bigtop-packages/src/rpm/phoenix/SRPMS/.gitignore new file mode 100644 index 0000000..e69de29 http://git-wip-us.apache.org/repos/asf/bigtop/blob/7c382699/bigtop-tests/test-artifacts/phoenix/pom.xml ---------------------------------------------------------------------- diff --git a/bigtop-tests/test-artifacts/phoenix/pom.xml b/bigtop-tests/test-artifacts/phoenix/pom.xml new file mode 100644 index 0000000..4e4e0cf --- /dev/null +++ b/bigtop-tests/test-artifacts/phoenix/pom.xml @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + 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. +--> +<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/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.bigtop.itest</groupId> + <artifactId>bigtop-smokes</artifactId> + <version>0.7.0-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> + <groupId>org.apache.bigtop.itest</groupId> + <artifactId>phoenix-smoke</artifactId> + <version>0.7.0-SNAPSHOT</version> + + <name>phoenixsmoke</name> + +</project> http://git-wip-us.apache.org/repos/asf/bigtop/blob/7c382699/bigtop-tests/test-artifacts/phoenix/src/main/groovy/org/apache/bigtop/itest/phoenix/smoke/TestPhoenixSmoke.groovy ---------------------------------------------------------------------- diff --git a/bigtop-tests/test-artifacts/phoenix/src/main/groovy/org/apache/bigtop/itest/phoenix/smoke/TestPhoenixSmoke.groovy b/bigtop-tests/test-artifacts/phoenix/src/main/groovy/org/apache/bigtop/itest/phoenix/smoke/TestPhoenixSmoke.groovy new file mode 100644 index 0000000..6f6480d --- /dev/null +++ b/bigtop-tests/test-artifacts/phoenix/src/main/groovy/org/apache/bigtop/itest/phoenix/smoke/TestPhoenixSmoke.groovy @@ -0,0 +1,296 @@ +/* + * 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.phoenix.smoke + +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import org.apache.bigtop.itest.JarContent; +import org.apache.bigtop.itest.shell.Shell +import org.junit.Test + +public class TestPhoenixSmoke { + + static Shell sh = new Shell('/bin/bash -s'); + + static final String PHOENIX_HOME = System.getenv("PHOENIX_HOME"); + static { + assertNotNull("PHOENIX_HOME has to be set to run this test", PHOENIX_HOME); + } + static String phoenixClientJar = PHOENIX_HOME + "/" + + JarContent.getJarName(PHOENIX_HOME, "phoenix-.*client.jar"); + static String phoenixTestsJar = PHOENIX_HOME + "/" + + JarContent.getJarName(PHOENIX_HOME, "phoenix-.*tests.jar"); + + // Run a Phoenix end to end unit test using the hbase exec script. + // This really simplifies the testing setup we would otherwise need + // to accomplish with Maven and will be more amenable to change if + // the Phoenix tests someday can be run as test drivers against a + // running cluster as well. + + static void runTest(String testName) { + sh.exec("HBASE_CLASSPATH=" + phoenixClientJar + ":" + phoenixTestsJar + + " hbase org.junit.runner.JUnitCore " + testName); + assertTrue(testName + " failed", sh.getRet() == 0); + } + + @Test + public void testAlterTable() { + runTest("com.salesforce.phoenix.end2end.AlterTableTest") + } + + @Test + public void testArithmeticQuery() { + runTest("com.salesforce.phoenix.end2end.ArithmeticQueryTest") + } + + @Test + public void testAutoCommit() { + runTest("com.salesforce.phoenix.end2end.AutoCommitTest") + } + + @Test + public void testBinaryRowKey() { + runTest("com.salesforce.phoenix.end2end.BinaryRowKeyTest") + } + + @Test + public void testCoalesceFunction() { + runTest("com.salesforce.phoenix.end2end.CoalesceFunctionTest") + } + + @Test + public void testCompareDecimalToLong() { + runTest("com.salesforce.phoenix.end2end.CompareDecimalToLongTest") + } + + @Test + public void testCreateTable() { + runTest("com.salesforce.phoenix.end2end.CreateTableTest") + } + + @Test + public void testCSVLoader() { + runTest("com.salesforce.phoenix.end2end.CSVLoaderTest") + } + + @Test + public void testCustomEntityData() { + runTest("com.salesforce.phoenix.end2end.CustomEntityDataTest") + } + + @Test + public void testDefaultParallelIteratorsRegionSplitter() { + runTest("com.salesforce.phoenix.end2end.DefaultParallelIteratorsRegionSplitterTest") + } + + @Test + public void testDeleteRange() { + runTest("com.salesforce.phoenix.end2end.DeleteRangeTest") + } + + @Test + public void testDescColumnSortOrder() { + runTest("com.salesforce.phoenix.end2end.DescColumnSortOrderTest") + } + + @Test + public void testDistinctCount() { + runTest("com.salesforce.phoenix.end2end.DistinctCountTest") + } + + @Test + public void testDynamicColumn() { + runTest("com.salesforce.phoenix.end2end.DynamicColumnTest") + } + + @Test + public void testDynamicFamily() { + runTest("com.salesforce.phoenix.end2end.DynamicFamilyTest") + } + + @Test + public void testDynamicUpsert() { + runTest("com.salesforce.phoenix.end2end.DynamicUpsertTest") + } + + @Test + public void testExecuteStatements() { + runTest("com.salesforce.phoenix.end2end.ExecuteStatementsTest") + } + + @Test + public void testExtendedQueryExec() { + runTest("com.salesforce.phoenix.end2end.ExtendedQueryExecTest") + } + + @Test + public void testFunkyNames() { + runTest("com.salesforce.phoenix.end2end.FunkyNamesTest") + } + + @Test + public void testGroupByCase() { + runTest("com.salesforce.phoenix.end2end.GroupByCaseTest") + } + + @Test + public void testIsNull() { + runTest("com.salesforce.phoenix.end2end.IsNullTest") + } + + @Test + public void testKeyOnly() { + runTest("com.salesforce.phoenix.end2end.KeyOnlyTest") + } + + @Test + public void testMultiCfQueryExec() { + runTest("com.salesforce.phoenix.end2end.MultiCfQueryExecTest") + } + + @Test + public void testNativeHBaseTypes() { + runTest("com.salesforce.phoenix.end2end.NativeHBaseTypesTest") + } + + @Test + public void testPercentile() { + runTest("com.salesforce.phoenix.end2end.PercentileTest") + } + + @Test + public void testProductMetrics() { + runTest("com.salesforce.phoenix.end2end.ProductMetricsTest") + } + + @Test + public void testQueryDatabaseMetaData() { + runTest("com.salesforce.phoenix.end2end.QueryDatabaseMetaDataTest") + } + + @Test + public void testQueryExec() { + runTest("com.salesforce.phoenix.end2end.QueryExecTest") + } + + @Test + public void testQueryExecWithoutSCN() { + runTest("com.salesforce.phoenix.end2end.QueryExecWithoutSCNTest") + } + + @Test + public void testQueryPlan() { + runTest("com.salesforce.phoenix.end2end.QueryPlanTest") + } + + @Test + public void testReadIsolationLevel() { + runTest("com.salesforce.phoenix.end2end.ReadIsolationLevelTest") + } + + @Test + public void testReverseFunction() { + runTest("com.salesforce.phoenix.end2end.ReverseFunctionTest") + } + + @Test + public void testServerException() { + runTest("com.salesforce.phoenix.end2end.ServerExceptionTest") + } + + @Test + public void testSkipRangeParallelIteratorRegionSplitter() { + runTest("com.salesforce.phoenix.end2end.SkipRangeParallelIteratorRegionSplitterTest") + } + + @Test + public void testSkipScanQuery() { + runTest("com.salesforce.phoenix.end2end.SkipScanQueryTest") + } + + @Test + public void testSpooledOrderBy() { + runTest("com.salesforce.phoenix.end2end.SpooledOrderByTest") + } + + @Test + public void testStatementHints() { + runTest("com.salesforce.phoenix.end2end.StatementHintsTest") + } + + @Test + public void testStddev() { + runTest("com.salesforce.phoenix.end2end.StddevTest") + } + + @Test + public void testTopN() { + runTest("com.salesforce.phoenix.end2end.TopNTest") + } + + @Test + public void testUpsertBigValues() { + runTest("com.salesforce.phoenix.end2end.UpsertBigValuesTest") + } + + @Test + public void testUpsertSelect() { + runTest("com.salesforce.phoenix.end2end.UpsertSelectTest") + } + + @Test + public void testUpsertValues() { + runTest("com.salesforce.phoenix.end2end.UpsertValuesTest") + } + + @Test + public void testVariableLengthPK() { + runTest("com.salesforce.phoenix.end2end.VariableLengthPKTest") + } + + // INDEX + + @Test + public void testIndex() { + runTest("com.salesforce.phoenix.end2end.index.IndexTest") + } + + @Test + public void testIndexMetadata() { + runTest("com.salesforce.phoenix.end2end.index.IndexMetadataTest") + } + + // SALTED + + @Test + public void testSaltedTable() { + runTest("com.salesforce.phoenix.end2end.salted.SaltedTableTest") + } + + @Test + public void testSaltedTableUpsertSelect() { + runTest("com.salesforce.phoenix.end2end.salted.SaltedTableUpsertSelectTest") + } + + @Test + public void testSaltedTableVarLengthRowKey() { + runTest("com.salesforce.phoenix.end2end.salted.SaltedTableVarLengthRowKeyTest") + } + +} http://git-wip-us.apache.org/repos/asf/bigtop/blob/7c382699/bigtop-tests/test-artifacts/pom.xml ---------------------------------------------------------------------- diff --git a/bigtop-tests/test-artifacts/pom.xml b/bigtop-tests/test-artifacts/pom.xml index bcbdf59..f9360a4 100644 --- a/bigtop-tests/test-artifacts/pom.xml +++ b/bigtop-tests/test-artifacts/pom.xml @@ -49,6 +49,7 @@ <module>fatjar</module> <module>hcatalog</module> <module>spark</module> + <module>phoenix</module> </modules> <dependencies> http://git-wip-us.apache.org/repos/asf/bigtop/blob/7c382699/bigtop-tests/test-execution/smokes/phoenix/pom.xml ---------------------------------------------------------------------- diff --git a/bigtop-tests/test-execution/smokes/phoenix/pom.xml b/bigtop-tests/test-execution/smokes/phoenix/pom.xml new file mode 100644 index 0000000..6d537fc --- /dev/null +++ b/bigtop-tests/test-execution/smokes/phoenix/pom.xml @@ -0,0 +1,60 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + 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. +--> +<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/xsd/maven-4.0.0.xsd"> + + <parent> + <groupId>org.apache.bigtop.itest</groupId> + <artifactId>smoke-tests</artifactId> + <version>0.7.0-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> + + <modelVersion>4.0.0</modelVersion> + <groupId>org.apache.bigtop.itest</groupId> + <artifactId>phoenix-smoke-execution</artifactId> + <version>0.7.0-SNAPSHOT</version> + <name>Phoenix smoke test execution</name> + + <properties> + <org.apache.maven-dependency-plugin.groupId>org.apache.bigtop.itest</org.apache.maven-dependency-plugin.groupId> + <org.apache.maven-dependency-plugin.artifactId>phoenix-smoke</org.apache.maven-dependency-plugin.artifactId> + <org.apache.maven-dependency-plugin.version>${phoenix-smoke.version}</org.apache.maven-dependency-plugin.version> + <org.apache.maven-dependency-plugin.type>jar</org.apache.maven-dependency-plugin.type> + + <PHOENIX_HOME>${env.PHOENIX_HOME}</PHOENIX_HOME> + </properties> + + <dependencies> + <dependency> + <groupId>org.apache.bigtop.itest</groupId> + <artifactId>phoenix-smoke</artifactId> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-dependency-plugin</artifactId> + </plugin> + </plugins> + </build> + +</project> http://git-wip-us.apache.org/repos/asf/bigtop/blob/7c382699/bigtop-tests/test-execution/smokes/pom.xml ---------------------------------------------------------------------- diff --git a/bigtop-tests/test-execution/smokes/pom.xml b/bigtop-tests/test-execution/smokes/pom.xml index 23f4343..3403ef4 100644 --- a/bigtop-tests/test-execution/smokes/pom.xml +++ b/bigtop-tests/test-execution/smokes/pom.xml @@ -48,6 +48,7 @@ <package-smoke.version>${project.version}</package-smoke.version> <solr-smoke.version>${project.version}</solr-smoke.version> <hcatalog-smoke.version>${project.version}</hcatalog-smoke.version> + <phoenix-smoke.version>${project.version}</phoenix-smoke.version> </properties> <!-- @@ -69,6 +70,7 @@ <module>sqoop</module> --> <module>hcatalog</module> + <module>phoenix</module> </modules> <dependencyManagement> @@ -146,6 +148,12 @@ <version>${hcatalog-smoke.version}</version> <scope>test</scope> </dependency> + <dependency> + <groupId>org.apache.bigtop.itest</groupId> + <artifactId>phoenix-smoke</artifactId> + <version>${phoenix-smoke.version}</version> + <scope>test</scope> + </dependency> </dependencies> </dependencyManagement> http://git-wip-us.apache.org/repos/asf/bigtop/blob/7c382699/bigtop.mk ---------------------------------------------------------------------- diff --git a/bigtop.mk b/bigtop.mk index cbd0288..bc49ce1 100644 --- a/bigtop.mk +++ b/bigtop.mk @@ -236,6 +236,19 @@ SPARK_SITE=$(APACHE_MIRROR)$(SPARK_DOWNLOAD_PATH) SPARK_ARCHIVE=$(APACHE_ARCHIVE)$(SPARK_DOWNLOAD_PATH) $(eval $(call PACKAGE,spark,SPARK)) +# Phoenix +PHOENIX_NAME=phoenix +PHOENIX_RELNOTES_NAME=Phoenix: A SQL skin over HBase +PHOENIX_PKG_NAME=phoenix +PHOENIX_BASE_VERSION=2.0.2 +PHOENIX_PKG_VERSION=2.0.2 +PHOENIX_RELEASE_VERSION=1 +PHOENIX_TARBALL_DST=phoenix-$(PHOENIX_BASE_VERSION).tar.gz +PHOENIX_TARBALL_SRC=$(PHOENIX_BASE_VERSION).tar.gz +PHOENIX_SITE=https://github.com/forcedotcom/phoenix/archive +PHOENIX_ARCHIVE=$(PHOENIX_SITE) +$(eval $(call PACKAGE,phoenix,PHOENIX)) + # Bigtop-utils BIGTOP_UTILS_NAME=bigtop-utils BIGTOP_UTILS__RELNOTES_NAME=Bigtop-utils
