Repository: bigtop Updated Branches: refs/heads/master 1038442ad -> c0afe3595
BIGTOP-2481: Add HBase Charm (closes #125) Signed-off-by: Kevin W Monroe <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/bigtop/repo Commit: http://git-wip-us.apache.org/repos/asf/bigtop/commit/c0afe359 Tree: http://git-wip-us.apache.org/repos/asf/bigtop/tree/c0afe359 Diff: http://git-wip-us.apache.org/repos/asf/bigtop/diff/c0afe359 Branch: refs/heads/master Commit: c0afe3595bd64e5c7af6e0b5ce4b1c4023545fba Parents: 1038442 Author: Konstantinos Tsakalozos <[email protected]> Authored: Wed Jun 1 20:32:11 2016 +0300 Committer: Kevin W Monroe <[email protected]> Committed: Sun Oct 30 16:52:21 2016 -0500 ---------------------------------------------------------------------- .../src/charm/hbase/layer-hbase/README.md | 166 +++++++++++ .../src/charm/hbase/layer-hbase/actions.yaml | 23 ++ .../charm/hbase/layer-hbase/actions/perf-test | 45 +++ .../src/charm/hbase/layer-hbase/actions/restart | 34 +++ .../charm/hbase/layer-hbase/actions/smoke-test | 49 ++++ .../src/charm/hbase/layer-hbase/actions/start | 35 +++ .../layer-hbase/actions/start-hbase-master | 35 +++ .../actions/start-hbase-regionserver | 37 +++ .../src/charm/hbase/layer-hbase/actions/stop | 35 +++ .../hbase/layer-hbase/actions/stop-hbase-master | 35 +++ .../layer-hbase/actions/stop-hbase-regionserver | 37 +++ .../src/charm/hbase/layer-hbase/copyright | 16 ++ .../src/charm/hbase/layer-hbase/icon.svg | 278 +++++++++++++++++++ .../src/charm/hbase/layer-hbase/layer.yaml | 33 +++ .../lib/charms/layer/bigtop_hbase.py | 69 +++++ .../src/charm/hbase/layer-hbase/metadata.yaml | 15 + .../charm/hbase/layer-hbase/reactive/hbase.py | 82 ++++++ .../layer-hbase/tests/01-basic-deployment.py | 38 +++ .../hbase/layer-hbase/tests/02-smoke-test.py | 57 ++++ .../charm/hbase/layer-hbase/tests/tests.yaml | 3 + .../src/charm/hbase/layer-hbase/wheelhouse.txt | 1 + 21 files changed, 1123 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/bigtop/blob/c0afe359/bigtop-packages/src/charm/hbase/layer-hbase/README.md ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/charm/hbase/layer-hbase/README.md b/bigtop-packages/src/charm/hbase/layer-hbase/README.md new file mode 100644 index 0000000..a63ddf8 --- /dev/null +++ b/bigtop-packages/src/charm/hbase/layer-hbase/README.md @@ -0,0 +1,166 @@ +<!-- + 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. +--> +# Overview + +HBase is the Hadoop database. Think of it as a distributed scalable Big Data +store. + +Use HBase 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. + +HBase is an open-source, distributed, versioned, column-oriented store modeled +after Google's 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 and HDFS. + +HBase provides: + +- Linear and modular scalability. +- Strictly consistent reads and writes. +- Automatic and configurable sharding of tables +- Automatic failover support between RegionServers. +- Convenient base classes for backing Hadoop MapReduce jobs with HBase tables. +- Easy to use Java API for client access. +- Block cache and Bloom Filters for real-time queries. +- Query predicate push down via server side Filters +- Thrift gateway and a REST-ful Web service that supports XML, Protobuf, + and binary data encoding options +- Extensible jruby-based (JIRB) shell +- Support for exporting metrics via the Hadoop metrics subsystem to files + or Ganglia; or via JMX. + +See [the homepage](http://hbase.apache.org) for more information. + +This charm deploys the hbase master and regionserver components of the +[Apache Bigtop][] platform. + +[Apache Bigtop]: http://bigtop.apache.org/ + + +# Deploying + +A working Juju installation is assumed to be present. If Juju is not yet set +up, please follow the [getting-started][] instructions prior to deploying this +charm. + +An HBase deployment consists of HBase masters and HBase RegionServers. +In a distributed HBase environment, one master and one regionserver are +deployed on each unit. HBase makes sure that only one master is active and +the rest are in standby mode in case the active one fails. + +HBase operates over HDFS, so we first need to deploy an HDFS cluster: + + juju deploy hadoop-namenode namenode + juju deploy hadoop-slave slave + juju deploy hadoop-plugin plugin + + juju add-relation namenode slave + juju add-relation plugin namenode + +In order to function correctly, the HBase master and regionserver applications +have a mandatory relationship with Zookeeper. Use the zookeeper charm to +create a functional zookeeper quorum. Remember that quorums come in odd numbers +starting with 3 (one will work, but will offer no resilience): + + juju deploy zookeeper -n 3 + +Now add HBase scaled to 3 units and add the required relations: + + juju deploy hbase -n 3 + + juju add-relation plugin hbase + juju add-relation zookeeper hbase + +The charm also supports use of the thrift gateway. + +## Network-Restricted Environments +Charms can be deployed in environments with limited network access. To deploy +in this environment, configure a Juju model with appropriate proxy and/or +mirror options. See [Configuring Models][] for more information. + +[getting-started]: https://jujucharms.com/docs/stable/getting-started +[Configuring Models]: https://jujucharms.com/docs/stable/models-config + + +# Verifying + +## Status +Apache Bigtop charms provide extended status reporting to indicate when they +are ready: + + juju status + +This is particularly useful when combined with `watch` to track the on-going +progress of the deployment: + + watch -n 2 juju status + +The message column will provide information about a given unit's state. +This charm is ready for use once the status message indicates that it is +ready. + +## Smoke Test +This charm provides a `smoke-test` action that can be used to verify the +application is functioning as expected. Run the action as follows: + + juju run-action hbase/0 smoke-test + +> **Note**: The above assumes Juju 2.0 or greater. If using an earlier version +of Juju, the syntax is `juju action do hbase/0 smoke-test`. + +Watch the progress of the smoke test actions with: + + watch -n 2 juju show-action-status + +> **Note**: The above assumes Juju 2.0 or greater. If using an earlier version +of Juju, the syntax is `juju action status`. + +Eventually, the action should settle to `status: completed`. If it +reports `status: failed`, the application is not working as expected. Get +more information about a specific smoke test with: + + juju show-action-output <action-id> + +> **Note**: The above assumes Juju 2.0 or greater. If using an earlier version +of Juju, the syntax is `juju action fetch <action-id>`. + + +# Limitations + +Restarting an HBase deployment is potentially disruptive. Be aware that the +following events will cause a restart: + +- Zookeeper service units joining or departing relations. +- Upgrading the charm or changing the configuration. + + +# Contact Information + +- <[email protected]> + + +# Resources + +- [Apache Bigtop](http://bigtop.apache.org/) home page +- [Apache Bigtop mailing lists](http://bigtop.apache.org/mail-lists.html) +- [Apache HBase home page](https://hbase.apache.org/) +- [Apache Zookeeper issue tracker](https://issues.apache.org/jira/browse/HBASE) +- [Juju Bigtop charms](https://jujucharms.com/q/apache/bigtop) +- [Juju mailing list](https://lists.ubuntu.com/mailman/listinfo/juju) +- [Juju community](https://jujucharms.com/community) http://git-wip-us.apache.org/repos/asf/bigtop/blob/c0afe359/bigtop-packages/src/charm/hbase/layer-hbase/actions.yaml ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/charm/hbase/layer-hbase/actions.yaml b/bigtop-packages/src/charm/hbase/layer-hbase/actions.yaml new file mode 100644 index 0000000..fc4edf9 --- /dev/null +++ b/bigtop-packages/src/charm/hbase/layer-hbase/actions.yaml @@ -0,0 +1,23 @@ +restart: + description: Retart HBase HMaster and RegionServer. +start-hbase-master: + description: Start HBase HMaster. +start-hbase-regionserver: + description: Start HBase RegionServer. +start: + description: Start HBase HMaster and RegionServer. +stop-hbase-master: + description: Stop HBase HMaster. +stop-hbase-regionserver: + description: Stop HBase RegionServer. +stop: + description: Stop HBase HMaster and RegionServer. +smoke-test: + description: Verify that HBase is working. +perf-test: + description: Verify that HBase is working by running a perf test. + params: + mrows: + description: Rows to be written in milions + type: integer + default: 1 http://git-wip-us.apache.org/repos/asf/bigtop/blob/c0afe359/bigtop-packages/src/charm/hbase/layer-hbase/actions/perf-test ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/charm/hbase/layer-hbase/actions/perf-test b/bigtop-packages/src/charm/hbase/layer-hbase/actions/perf-test new file mode 100755 index 0000000..2209d37 --- /dev/null +++ b/bigtop-packages/src/charm/hbase/layer-hbase/actions/perf-test @@ -0,0 +1,45 @@ +#!/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 + +if ! charms.reactive is_state 'hbase.installed'; then + action-fail 'HBase is not yet ready' + exit +fi + +MROWS=`action-get mrows` + +# create dir to store results +RUN=`date +%s` +RESULT_DIR=/opt/hbase-perf-results +RESULT_LOG=${RESULT_DIR}/${RUN}.log +mkdir -p ${RESULT_DIR} +chown -R hbase:hbase ${RESULT_DIR} + +benchmark-start +START=`date +%s` +su hbase << EOF +echo 'Running performance evaluation' +hbase org.apache.hadoop.hbase.PerformanceEvaluation --nomapred randomWrite ${MROWS} &> ${RESULT_LOG} +EOF +STOP=`date +%s` +benchmark-finish + +DURATION=`expr $STOP - $START` +benchmark-composite "${DURATION}" 'secs' 'asc' +benchmark-raw ${RESULT_LOG} http://git-wip-us.apache.org/repos/asf/bigtop/blob/c0afe359/bigtop-packages/src/charm/hbase/layer-hbase/actions/restart ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/charm/hbase/layer-hbase/actions/restart b/bigtop-packages/src/charm/hbase/layer-hbase/actions/restart new file mode 100755 index 0000000..c798db7 --- /dev/null +++ b/bigtop-packages/src/charm/hbase/layer-hbase/actions/restart @@ -0,0 +1,34 @@ +#!/usr/bin/env python3 + +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import sys +sys.path.append('lib') + +from charmhelpers.core import hookenv +from charms.reactive import is_state +from charms.layer.bigtop_hbase import HBase + + +def fail(msg): + hookenv.action_fail(msg) + sys.exit() + +if not is_state('hbase.installed'): + fail('HBase is not yet ready') + +hb = HBase() +hb.restart() http://git-wip-us.apache.org/repos/asf/bigtop/blob/c0afe359/bigtop-packages/src/charm/hbase/layer-hbase/actions/smoke-test ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/charm/hbase/layer-hbase/actions/smoke-test b/bigtop-packages/src/charm/hbase/layer-hbase/actions/smoke-test new file mode 100755 index 0000000..bc6f45b --- /dev/null +++ b/bigtop-packages/src/charm/hbase/layer-hbase/actions/smoke-test @@ -0,0 +1,49 @@ +#!/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 + +if ! charms.reactive is_state 'hbase.installed'; then + action-fail 'HBase is not yet ready' + exit +fi + +tbl=$1`date +%s` +echo "create '$tbl', 'cf'" > hbase_table.txt +echo "list '$tbl'" >> hbase_table.txt +echo "put '$tbl', 'row1', 'cf:a', 'value1'" >> hbase_table.txt +echo "put '$tbl', 'row2', 'cf:b', 'value2'" >> hbase_table.txt +echo "put '$tbl', 'row3', 'cf:c', 'value3'" >> hbase_table.txt +echo "put '$tbl', 'row4', 'cf:d', 'value4'" >> hbase_table.txt +echo "scan '$tbl'" >> hbase_table.txt +echo "get '$tbl', 'row1'" >> hbase_table.txt +echo "disable '$tbl'" >> hbase_table.txt +echo "enable '$tbl'" >> hbase_table.txt +echo "exit;" >> hbase_table.txt + +hbase shell hbase_table.txt + +echo "describe '$tbl'" | hbase shell +status=$? +echo "HBase shell return code was: " $status + +if [ $status -eq 0 ]; then + action-set outcome="success" +else + action-set outcome="failed with return code ${status}" + action-fail "smoke-test failed" +fi http://git-wip-us.apache.org/repos/asf/bigtop/blob/c0afe359/bigtop-packages/src/charm/hbase/layer-hbase/actions/start ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/charm/hbase/layer-hbase/actions/start b/bigtop-packages/src/charm/hbase/layer-hbase/actions/start new file mode 100755 index 0000000..9a6c91b --- /dev/null +++ b/bigtop-packages/src/charm/hbase/layer-hbase/actions/start @@ -0,0 +1,35 @@ +#!/usr/bin/env python3 + +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import sys +sys.path.append('lib') + +from charmhelpers.core import hookenv +from charms.reactive import is_state +from charms.layer.bigtop_hbase import HBase + + +def fail(msg): + hookenv.action_fail(msg) + sys.exit() + +if not is_state('hbase.installed'): + fail('HBase is not yet ready') + +hb = HBase() +hb.start() +hb.open_ports() http://git-wip-us.apache.org/repos/asf/bigtop/blob/c0afe359/bigtop-packages/src/charm/hbase/layer-hbase/actions/start-hbase-master ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/charm/hbase/layer-hbase/actions/start-hbase-master b/bigtop-packages/src/charm/hbase/layer-hbase/actions/start-hbase-master new file mode 100755 index 0000000..85aa926 --- /dev/null +++ b/bigtop-packages/src/charm/hbase/layer-hbase/actions/start-hbase-master @@ -0,0 +1,35 @@ +#!/usr/bin/env python3 + +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import sys +sys.path.append('lib') + +from charmhelpers.core import host, hookenv +from charms.reactive import is_state + + +def fail(msg): + hookenv.action_fail(msg) + sys.exit() + +if not is_state('hbase.installed'): + fail('HBase is not yet ready') + +if not host.service_available('hbase-master'): + fail('Could not find hbase-master init service') + +host.service_start('hbase-master') http://git-wip-us.apache.org/repos/asf/bigtop/blob/c0afe359/bigtop-packages/src/charm/hbase/layer-hbase/actions/start-hbase-regionserver ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/charm/hbase/layer-hbase/actions/start-hbase-regionserver b/bigtop-packages/src/charm/hbase/layer-hbase/actions/start-hbase-regionserver new file mode 100755 index 0000000..aaa2ad7 --- /dev/null +++ b/bigtop-packages/src/charm/hbase/layer-hbase/actions/start-hbase-regionserver @@ -0,0 +1,37 @@ +#!/usr/bin/env python3 + +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import sys +sys.path.append('lib') + +from charmhelpers.core import host, hookenv +from charms.reactive import is_state + + +def fail(msg): + hookenv.action_fail(msg) + sys.exit() + +if not is_state('hbase.installed'): + fail('HBase is not yet ready') + +if not host.service_available('hbase-regionserver') or \ + not host.service_available('hbase-thrift'): + fail('Could not find hbase-regionserver/hbase-thrift init services') + +host.service_start('hbase-regionserver') +host.service_start('hbase-thrift') http://git-wip-us.apache.org/repos/asf/bigtop/blob/c0afe359/bigtop-packages/src/charm/hbase/layer-hbase/actions/stop ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/charm/hbase/layer-hbase/actions/stop b/bigtop-packages/src/charm/hbase/layer-hbase/actions/stop new file mode 100755 index 0000000..7cc16ff --- /dev/null +++ b/bigtop-packages/src/charm/hbase/layer-hbase/actions/stop @@ -0,0 +1,35 @@ +#!/usr/bin/env python3 + +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import sys +sys.path.append('lib') + +from charmhelpers.core import hookenv +from charms.reactive import is_state +from charms.layer.bigtop_hbase import HBase + + +def fail(msg): + hookenv.action_fail(msg) + sys.exit() + +if not is_state('hbase.installed'): + fail('HBase is not yet ready') + +hb = HBase() +hb.close_ports() +hb.stop() http://git-wip-us.apache.org/repos/asf/bigtop/blob/c0afe359/bigtop-packages/src/charm/hbase/layer-hbase/actions/stop-hbase-master ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/charm/hbase/layer-hbase/actions/stop-hbase-master b/bigtop-packages/src/charm/hbase/layer-hbase/actions/stop-hbase-master new file mode 100755 index 0000000..2936118 --- /dev/null +++ b/bigtop-packages/src/charm/hbase/layer-hbase/actions/stop-hbase-master @@ -0,0 +1,35 @@ +#!/usr/bin/env python3 + +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import sys +sys.path.append('lib') + +from charmhelpers.core import host, hookenv +from charms.reactive import is_state + + +def fail(msg): + hookenv.action_fail(msg) + sys.exit() + +if not is_state('hbase.installed'): + fail('HBase is not yet ready') + +if not host.service_available('hbase-master'): + fail('Could not find hbase-master init service') + +host.service_stop('hbase-master') http://git-wip-us.apache.org/repos/asf/bigtop/blob/c0afe359/bigtop-packages/src/charm/hbase/layer-hbase/actions/stop-hbase-regionserver ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/charm/hbase/layer-hbase/actions/stop-hbase-regionserver b/bigtop-packages/src/charm/hbase/layer-hbase/actions/stop-hbase-regionserver new file mode 100755 index 0000000..a203dbe --- /dev/null +++ b/bigtop-packages/src/charm/hbase/layer-hbase/actions/stop-hbase-regionserver @@ -0,0 +1,37 @@ +#!/usr/bin/env python3 + +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import sys +sys.path.append('lib') + +from charmhelpers.core import host, hookenv +from charms.reactive import is_state + + +def fail(msg): + hookenv.action_fail(msg) + sys.exit() + +if not is_state('hbase.installed'): + fail('HBase is not yet ready') + +if not host.service_available('hbase-regionserver') or \ + not host.service_available('hbase-thrift'): + fail('Could not find hbase-regionserver/hbase-thrift init services') + +host.service_stop('hbase-regionserver') +host.service_stop('hbase-thrift') http://git-wip-us.apache.org/repos/asf/bigtop/blob/c0afe359/bigtop-packages/src/charm/hbase/layer-hbase/copyright ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/charm/hbase/layer-hbase/copyright b/bigtop-packages/src/charm/hbase/layer-hbase/copyright new file mode 100644 index 0000000..e900b97 --- /dev/null +++ b/bigtop-packages/src/charm/hbase/layer-hbase/copyright @@ -0,0 +1,16 @@ +Format: http://dep.debian.net/deps/dep5/ + +Files: * +Copyright: Copyright 2015, Canonical Ltd., All Rights Reserved. +License: Apache License 2.0 + 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. http://git-wip-us.apache.org/repos/asf/bigtop/blob/c0afe359/bigtop-packages/src/charm/hbase/layer-hbase/icon.svg ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/charm/hbase/layer-hbase/icon.svg b/bigtop-packages/src/charm/hbase/layer-hbase/icon.svg new file mode 100644 index 0000000..4da7352 --- /dev/null +++ b/bigtop-packages/src/charm/hbase/layer-hbase/icon.svg @@ -0,0 +1,278 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="96" + height="96" + id="svg6517" + version="1.1" + inkscape:version="0.48.4 r9939" + sodipodi:docname="icon.svg"> + <defs + id="defs6519"> + <linearGradient + id="Background"> + <stop + id="stop4178" + offset="0" + style="stop-color:#b8b8b8;stop-opacity:1" /> + <stop + id="stop4180" + offset="1" + style="stop-color:#c9c9c9;stop-opacity:1" /> + </linearGradient> + <filter + style="color-interpolation-filters:sRGB;" + inkscape:label="Inner Shadow" + id="filter1121"> + <feFlood + flood-opacity="0.59999999999999998" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood1123" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite1125" /> + <feGaussianBlur + in="composite1" + stdDeviation="1" + result="blur" + id="feGaussianBlur1127" /> + <feOffset + dx="0" + dy="2" + result="offset" + id="feOffset1129" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="composite2" + id="feComposite1131" /> + </filter> + <filter + style="color-interpolation-filters:sRGB;" + inkscape:label="Drop Shadow" + id="filter950"> + <feFlood + flood-opacity="0.25" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood952" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="in" + result="composite1" + id="feComposite954" /> + <feGaussianBlur + in="composite1" + stdDeviation="1" + result="blur" + id="feGaussianBlur956" /> + <feOffset + dx="0" + dy="1" + result="offset" + id="feOffset958" /> + <feComposite + in="SourceGraphic" + in2="offset" + operator="over" + result="composite2" + id="feComposite960" /> + </filter> + <clipPath + clipPathUnits="userSpaceOnUse" + id="clipPath873"> + <g + transform="matrix(0,-0.66666667,0.66604479,0,-258.25992,677.00001)" + id="g875" + inkscape:label="Layer 1" + style="fill:#ff00ff;fill-opacity:1;stroke:none;display:inline"> + <path + style="fill:#ff00ff;fill-opacity:1;stroke:none;display:inline" + d="m 46.702703,898.22775 50.594594,0 C 138.16216,898.22775 144,904.06497 144,944.92583 l 0,50.73846 c 0,40.86071 -5.83784,46.69791 -46.702703,46.69791 l -50.594594,0 C 5.8378378,1042.3622 0,1036.525 0,995.66429 L 0,944.92583 C 0,904.06497 5.8378378,898.22775 46.702703,898.22775 Z" + id="path877" + inkscape:connector-curvature="0" + sodipodi:nodetypes="sssssssss" /> + </g> + </clipPath> + <filter + inkscape:collect="always" + id="filter891" + inkscape:label="Badge Shadow"> + <feGaussianBlur + inkscape:collect="always" + stdDeviation="0.71999962" + id="feGaussianBlur893" /> + </filter> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="4.0745362" + inkscape:cx="-19.035615" + inkscape:cy="49.018169" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="true" + fit-margin-top="0" + fit-margin-left="0" + fit-margin-right="0" + fit-margin-bottom="0" + inkscape:window-width="1920" + inkscape:window-height="1056" + inkscape:window-x="0" + inkscape:window-y="24" + inkscape:window-maximized="1" + showborder="true" + showguides="true" + inkscape:guide-bbox="true" + inkscape:showpageshadow="false" + inkscape:snap-global="false"> + <inkscape:grid + type="xygrid" + id="grid821" /> + <sodipodi:guide + orientation="1,0" + position="16,48" + id="guide823" /> + <sodipodi:guide + orientation="0,1" + position="64,80" + id="guide825" /> + <sodipodi:guide + orientation="1,0" + position="80,40" + id="guide827" /> + <sodipodi:guide + orientation="0,1" + position="64,16" + id="guide829" /> + </sodipodi:namedview> + <metadata + id="metadata6522"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title /> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="BACKGROUND" + inkscape:groupmode="layer" + id="layer1" + transform="translate(268,-635.29076)" + style="display:inline"> + <path + style="fill:#e6e3e2;fill-opacity:1;stroke:none;display:inline;filter:url(#filter1121)" + d="m -268,700.15563 0,-33.72973 c 0,-27.24324 3.88785,-31.13513 31.10302,-31.13513 l 33.79408,0 c 27.21507,0 31.1029,3.89189 31.1029,31.13513 l 0,33.72973 c 0,27.24325 -3.88783,31.13514 -31.1029,31.13514 l -33.79408,0 C -264.11215,731.29077 -268,727.39888 -268,700.15563 Z" + id="path6455" + inkscape:connector-curvature="0" + sodipodi:nodetypes="sssssssss" /> + </g> + <g + inkscape:groupmode="layer" + id="layer3" + inkscape:label="PLACE YOUR PICTOGRAM HERE" + style="display:inline"> + <image + y="43.003983" + x="16.397383" + id="image3795" + xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQsAAABCCAYAAABAdfNCAAAABHNCSVQICAgIfAhkiAAADmdJREFU eJztnXtwXFUdx7/fc3c3j7s1ocku+ChUB1BaBOUh6OAogzR9YaESGauFdJpdHB3FN1VB6hNwwIFR iux22jKVx7Qio0DJ1gc+0FqQ8nCK+K6oIHmUBrLbNNncn38k6SSbx969e/feu5vz+Wv37Dm/883N 3t+ee87v/A4xRkdHx3HhcHgjyXMBLAYQQmn0icg+kvenUqnbS2xbNolEootkmxu2ROSfAH4vIrdv 3rz5N27YdMKaNWuOMU3zqwDeBeCtJCMlmugHsE9EHkyn07cAsFwXaZP169efoJTaAOBMkosBNDqx IyI3ptPpDe6qm55EIvFLku+Z0HcmnU4vddo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EZwDZzS26RseynkeB1IJ tLOoFkTymKvZsqoZwXUr+/Gy3zLcQDuLKkEEtyzpyeqzMaqLZ3/XM3CH3yLcQjuLKkAgB4Z6s9f5 rUNTKvLpjbARh1El6AnOoCMYAEauuAjI+S1FUxJfW9Kd3e23CDfRziLAiMiLI5AVy3sGn/Rbi8Ye ImKBuLqtO3uT31rc Rj+GBBCBHAHk5uGh7OLlPTntKKoEEfx2BHJWLToKQI8s/EdkGMRzAjwD4GkC T2cPZ59Y/WoVpY+bg4zneBHhfwH5lWXJ/cv6co/7rauS/B/ne3S/hgBqfAAAAABJRU5ErkJggg== " + height="15.675" + width="63.412498" /> + </g> + <g + inkscape:groupmode="layer" + id="layer2" + inkscape:label="BADGE" + style="display:none" + sodipodi:insensitive="true"> + <g + style="display:inline" + transform="translate(-340.00001,-581)" + id="g4394" + clip-path="none"> + <g + id="g855"> + <g + inkscape:groupmode="maskhelper" + id="g870" + clip-path="url(#clipPath873)" + style="opacity:0.6;filter:url(#filter891)"> + <path + transform="matrix(1.4999992,0,0,1.4999992,-29.999795,-237.54282)" + d="m 264,552.36218 c 0,6.62742 -5.37258,12 -12,12 -6.62742,0 -12,-5.37258 -12,-12 0,-6.62741 5.37258,-12 12,-12 6.62742,0 12,5.37259 12,12 z" + sodipodi:ry="12" + sodipodi:rx="12" + sodipodi:cy="552.36218" + sodipodi:cx="252" + id="path844" + style="color:#000000;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:4;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" + sodipodi:type="arc" /> + </g> + <g + id="g862"> + <path + sodipodi:type="arc" + style="color:#000000;fill:#f5f5f5;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:4;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" + id="path4398" + sodipodi:cx="252" + sodipodi:cy="552.36218" + sodipodi:rx="12" + sodipodi:ry="12" + d="m 264,552.36218 c 0,6.62742 -5.37258,12 -12,12 -6.62742,0 -12,-5.37258 -12,-12 0,-6.62741 5.37258,-12 12,-12 6.62742,0 12,5.37259 12,12 z" + transform="matrix(1.4999992,0,0,1.4999992,-29.999795,-238.54282)" /> + <path + transform="matrix(1.25,0,0,1.25,33,-100.45273)" + d="m 264,552.36218 c 0,6.62742 -5.37258,12 -12,12 -6.62742,0 -12,-5.37258 -12,-12 0,-6.62741 5.37258,-12 12,-12 6.62742,0 12,5.37259 12,12 z" + sodipodi:ry="12" + sodipodi:rx="12" + sodipodi:cy="552.36218" + sodipodi:cx="252" + id="path4400" + style="color:#000000;fill:#dd4814;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:4;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" + sodipodi:type="arc" /> + <path + sodipodi:type="star" + style="color:#000000;fill:#f5f5f5;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" + id="path4459" + sodipodi:sides="5" + sodipodi:cx="666.19574" + sodipodi:cy="589.50385" + sodipodi:r1="7.2431178" + sodipodi:r2="4.3458705" + sodipodi:arg1="1.0471976" + sodipodi:arg2="1.6755161" + inkscape:flatsided="false" + inkscape:rounded="0.1" + inkscape:randomized="0" + d="m 669.8173,595.77657 c -0.39132,0.22593 -3.62645,-1.90343 -4.07583,-1.95066 -0.44938,-0.0472 -4.05653,1.36297 -4.39232,1.06062 -0.3358,-0.30235 0.68963,-4.03715 0.59569,-4.47913 -0.0939,-0.44198 -2.5498,-3.43681 -2.36602,-3.8496 0.18379,-0.41279 4.05267,-0.59166 4.44398,-0.81759 0.39132,-0.22593 2.48067,-3.48704 2.93005,-3.4398 0.44938,0.0472 1.81505,3.67147 2.15084,3.97382 0.3358,0.30236 4.08294,1.2817 4.17689,1.72369 0.0939,0.44198 -2.9309,2.86076 -3.11469,3.27355 -0.18379,0.41279 0.0427,4.27917 -0.34859,4.5051 z" + transform="matrix(1.511423,-0.16366377,0.16366377,1.511423,-755.37346,-191.93651)" /> + </g> + </g> + </g> + </g> +</svg> http://git-wip-us.apache.org/repos/asf/bigtop/blob/c0afe359/bigtop-packages/src/charm/hbase/layer-hbase/layer.yaml ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/charm/hbase/layer-hbase/layer.yaml b/bigtop-packages/src/charm/hbase/layer-hbase/layer.yaml new file mode 100644 index 0000000..ebebc56 --- /dev/null +++ b/bigtop-packages/src/charm/hbase/layer-hbase/layer.yaml @@ -0,0 +1,33 @@ +repo: https://github.com/apache/bigtop/tree/master/bigtop-packages/src/charm/hbase/layer-hbase +includes: + - 'layer:apache-bigtop-base' + - 'layer:hadoop-client' + - 'interface:zookeeper' + - 'interface:benchmark' + - 'interface:hbase' +options: + apache-bigtop-base: + ports: + # Ports that need to be exposed, overridden, or manually specified. + # Only expose ports serving a UI or external API (i.e., namenode and + # resourcemanager). Communication among units within the cluster does + # not need ports to be explicitly opened. + hbase-master: + port: 60000 + exposed_on: 'hbase' + hbase-master-web: + port: 60010 + exposed_on: 'hbase' + hbase-region: + port: 60020 + exposed_on: 'hbase' + hbase-region-web: + port: 60030 + exposed_on: 'hbase' + hbase-thrift: + port: 9090 + exposed_on: 'hbase' + # Not yet on bigtop + #hbase-rest: + # port: 8080 + # exposed_on: 'hbase' http://git-wip-us.apache.org/repos/asf/bigtop/blob/c0afe359/bigtop-packages/src/charm/hbase/layer-hbase/lib/charms/layer/bigtop_hbase.py ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/charm/hbase/layer-hbase/lib/charms/layer/bigtop_hbase.py b/bigtop-packages/src/charm/hbase/layer-hbase/lib/charms/layer/bigtop_hbase.py new file mode 100755 index 0000000..cd7c14c --- /dev/null +++ b/bigtop-packages/src/charm/hbase/layer-hbase/lib/charms/layer/bigtop_hbase.py @@ -0,0 +1,69 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from charmhelpers.core import hookenv, host +from jujubigdata import utils +from charms.layer.apache_bigtop_base import Bigtop +from charms import layer + + +class HBase(object): + """ + This class manages HBase. + """ + def __init__(self): + self.dist_config = utils.DistConfig( + data=layer.options('apache-bigtop-base')) + + def configure(self, hosts, zk_units): + zks = [] + for unit in zk_units: + ip = utils.resolve_private_address(unit['host']) + zks.append(ip) + zks.sort() + zk_connect = ",".join(zks) + + roles = ['hbase-server', 'hbase-master', 'hbase-client'] + + override = { + 'hadoop_hbase::common_config::zookeeper_quorum': zk_connect, + 'hadoop_hbase::deploy::auxiliary': False + } + + bigtop = Bigtop() + bigtop.render_site_yaml(hosts, roles, override) + bigtop.trigger_puppet() + + def restart(self): + self.stop() + self.start() + + def start(self): + host.service_start('hbase-master') + host.service_start('hbase-regionserver') + host.service_start('hbase-thrift') + + def stop(self): + host.service_stop('hbase-master') + host.service_stop('hbase-regionserver') + host.service_stop('hbase-thrift') + + def open_ports(self): + for port in self.dist_config.exposed_ports('hbase'): + hookenv.open_port(port) + + def close_ports(self): + for port in self.dist_config.exposed_ports('hbase'): + hookenv.close_port(port) http://git-wip-us.apache.org/repos/asf/bigtop/blob/c0afe359/bigtop-packages/src/charm/hbase/layer-hbase/metadata.yaml ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/charm/hbase/layer-hbase/metadata.yaml b/bigtop-packages/src/charm/hbase/layer-hbase/metadata.yaml new file mode 100644 index 0000000..9157ad1 --- /dev/null +++ b/bigtop-packages/src/charm/hbase/layer-hbase/metadata.yaml @@ -0,0 +1,15 @@ +name: hbase +summary: Apache Bitop HBase +maintainer: Juju Big Data <[email protected]> +description: > + HBase is the Hadoop database. This charm provides a Apache HBase from + Apache Bigtop. +tags: [] +requires: + zookeeper: + interface: zookeeper +provides: + hbclient: + interface: hbase + benchmark: + interface: benchmark http://git-wip-us.apache.org/repos/asf/bigtop/blob/c0afe359/bigtop-packages/src/charm/hbase/layer-hbase/reactive/hbase.py ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/charm/hbase/layer-hbase/reactive/hbase.py b/bigtop-packages/src/charm/hbase/layer-hbase/reactive/hbase.py new file mode 100644 index 0000000..b11cac2 --- /dev/null +++ b/bigtop-packages/src/charm/hbase/layer-hbase/reactive/hbase.py @@ -0,0 +1,82 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from charms.reactive import when, when_not_all, is_state, set_state, remove_state +from charms.layer.bigtop_hbase import HBase +from charmhelpers.core import hookenv +from charms.reactive.helpers import data_changed +from charms.layer.apache_bigtop_base import get_layer_opts + + +@when('bigtop.available') +def report_status(): + hadoop_joined = is_state('hadoop.joined') + hdfs_ready = is_state('hadoop.hdfs.ready') + zk_joined = is_state('zookeeper.joined') + zk_ready = is_state('zookeeper.ready') + hbase_installed = is_state('hbase.installed') + if not hadoop_joined: + hookenv.status_set('blocked', + 'waiting for relation to hadoop plugin') + elif not hdfs_ready: + hookenv.status_set('waiting', + 'waiting for hdfs to become ready') + elif not zk_joined: + hookenv.status_set('blocked', + 'waiting for relation to zookeeper') + elif not zk_ready: + hookenv.status_set('waiting', + 'waiting for zookeeper to become ready') + elif hbase_installed: + hookenv.status_set('active', + 'ready') + + +@when('bigtop.available', 'zookeeper.ready', 'hadoop.hdfs.ready') +def installing_hbase(zk, hdfs): + zks = zk.zookeepers() + if is_state('hbase.installed') and (not data_changed('zks', zks)): + return + + msg = "configuring hbase" if is_state('hbase.installed') else "installing hbase" + hookenv.status_set('maintenance', msg) + + hbase = HBase() + hosts = {} + nns = hdfs.namenodes() + hosts['namenode'] = nns[0] + hbase.configure(hosts, zks) + hbase.open_ports() + set_state('hbase.installed') + hookenv.status_set('active', 'ready') + + +@when('hbase.installed') +@when_not_all('hadoop.hdfs.ready', 'zookeeper.ready') +def stop_hbase(): + hbase = HBase() + hbase.close_ports() + hbase.stop() + remove_state('hbase.installed') + report_status() + + +@when('hbase.installed', 'hbclient.joined') +def serve_client(client): + config = get_layer_opts() + master_port = config.port('hbase-master') + regionserver_port = config.port('hbase-region') + thrift_port = config.port('hbase-thrift') + client.send_port(master_port, regionserver_port, thrift_port) http://git-wip-us.apache.org/repos/asf/bigtop/blob/c0afe359/bigtop-packages/src/charm/hbase/layer-hbase/tests/01-basic-deployment.py ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/charm/hbase/layer-hbase/tests/01-basic-deployment.py b/bigtop-packages/src/charm/hbase/layer-hbase/tests/01-basic-deployment.py new file mode 100755 index 0000000..3bfc5f2 --- /dev/null +++ b/bigtop-packages/src/charm/hbase/layer-hbase/tests/01-basic-deployment.py @@ -0,0 +1,38 @@ +#!/usr/bin/env python3 + +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import amulet +import re +import unittest + + +class TestDeploy(unittest.TestCase): + """ + Trivial deployment test for Apache Bigtop HBase. + """ + @classmethod + def setUpClass(cls): + cls.d = amulet.Deployment(series='xenial') + cls.d.add('hbase', 'cs:xenial/hbase') + + cls.d.setup(timeout=1800) + cls.d.sentry.wait_for_messages({'hbase': re.compile('ready')}, timeout=1800) + cls.unit = cls.d.sentry['hbase'][0] + + +if __name__ == '__main__': + unittest.main() http://git-wip-us.apache.org/repos/asf/bigtop/blob/c0afe359/bigtop-packages/src/charm/hbase/layer-hbase/tests/02-smoke-test.py ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/charm/hbase/layer-hbase/tests/02-smoke-test.py b/bigtop-packages/src/charm/hbase/layer-hbase/tests/02-smoke-test.py new file mode 100755 index 0000000..5382542 --- /dev/null +++ b/bigtop-packages/src/charm/hbase/layer-hbase/tests/02-smoke-test.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python3 + +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import amulet +import re +import unittest + + +class TestDeploy(unittest.TestCase): + """ + HDFS/HBase deployment and smoke test for the Apache Bigtop HBase service. + """ + @classmethod + def setUpClass(cls): + cls.d = amulet.Deployment(series='xenial') + cls.d.add('hbase', 'cs:xenial/hbase') + cls.d.add('namenode', 'cs:xenial/hadoop-namenode') + cls.d.add('plugin', 'cs:xenial/hadoop-plugin') + cls.d.add('slave', 'cs:xenial/hadoop-slave') + cls.d.add('zookeeper', 'cs:xenial/zookeeper') + + cls.d.relate('hbase:hadoop', 'plugin:hadoop-plugin') + cls.d.relate('hbase:zookeeper', 'zookeeper:zookeeper') + cls.d.relate('plugin:namenode', 'namenode:namenode') + cls.d.relate('slave:namenode', 'namenode:datanode') + + cls.d.setup(timeout=3600) + cls.d.sentry.wait_for_messages({'hbase': re.compile('ready')}, timeout=3600) + cls.hbase = cls.d.sentry['hbase'][0] + + def test_hbase(self): + """ + Validate HBase by running the smoke-test action. + """ + uuid = self.hbase.run_action('smoke-test') + result = self.d.action_fetch(uuid, full_output=True) + # action status=completed on success + if (result['status'] != "completed"): + self.fail('HBase smoke-test failed: %s' % result) + + +if __name__ == '__main__': + unittest.main() http://git-wip-us.apache.org/repos/asf/bigtop/blob/c0afe359/bigtop-packages/src/charm/hbase/layer-hbase/tests/tests.yaml ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/charm/hbase/layer-hbase/tests/tests.yaml b/bigtop-packages/src/charm/hbase/layer-hbase/tests/tests.yaml new file mode 100644 index 0000000..3b6ce3e --- /dev/null +++ b/bigtop-packages/src/charm/hbase/layer-hbase/tests/tests.yaml @@ -0,0 +1,3 @@ +reset: false +packages: + - amulet http://git-wip-us.apache.org/repos/asf/bigtop/blob/c0afe359/bigtop-packages/src/charm/hbase/layer-hbase/wheelhouse.txt ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/charm/hbase/layer-hbase/wheelhouse.txt b/bigtop-packages/src/charm/hbase/layer-hbase/wheelhouse.txt new file mode 100644 index 0000000..183242f --- /dev/null +++ b/bigtop-packages/src/charm/hbase/layer-hbase/wheelhouse.txt @@ -0,0 +1 @@ +charms.benchmark>=1.0.0,<2.0.0
