BIGTOP-2908: use giraph-examples.jar from giraph-doc Signed-off-by: Evans Ye <[email protected]>
Project: http://git-wip-us.apache.org/repos/asf/bigtop/repo Commit: http://git-wip-us.apache.org/repos/asf/bigtop/commit/e8128261 Tree: http://git-wip-us.apache.org/repos/asf/bigtop/tree/e8128261 Diff: http://git-wip-us.apache.org/repos/asf/bigtop/diff/e8128261 Branch: refs/heads/branch-1.2 Commit: e8128261ec7457c6b4ac46aa3b67ead4602c9124 Parents: 051a4d2 Author: Kevin W Monroe <[email protected]> Authored: Thu Oct 19 00:57:55 2017 +0000 Committer: Evans Ye <[email protected]> Committed: Fri Oct 20 00:10:46 2017 +0800 ---------------------------------------------------------------------- .../charm/giraph/layer-giraph/reactive/giraph.py | 16 +++++++++++----- .../resources/giraph-examples-1.1.0.jar | Bin 133651 -> 0 bytes 2 files changed, 11 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/bigtop/blob/e8128261/bigtop-packages/src/charm/giraph/layer-giraph/reactive/giraph.py ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/charm/giraph/layer-giraph/reactive/giraph.py b/bigtop-packages/src/charm/giraph/layer-giraph/reactive/giraph.py index 49ba0c7..ffae27c 100644 --- a/bigtop-packages/src/charm/giraph/layer-giraph/reactive/giraph.py +++ b/bigtop-packages/src/charm/giraph/layer-giraph/reactive/giraph.py @@ -15,11 +15,13 @@ import os +from glob import glob from jujubigdata import utils from path import Path from charms.reactive import is_state, when, when_not, set_state from charms.layer.apache_bigtop_base import Bigtop, get_package_version +from charmhelpers import fetch from charmhelpers.core import hookenv @@ -72,13 +74,17 @@ def install_giraph(giraph): ], ) bigtop.trigger_puppet() + + # Put down the -doc subpackage so we get giraph-examples + fetch.apt_install('giraph-doc') + giraph_home = Path('/usr/lib/giraph') + giraph_docdir = Path('/usr/share/doc/giraph') giraph_libdir = Path(giraph_home / 'lib') - giraph_examples = Path('{}/resources/giraph-examples-1.1.0.jar'.format( - hookenv.charm_dir())) + giraph_examples = glob('{}/giraph-examples-*.jar'.format(giraph_docdir)) # Gather a list of all the giraph jars (needed for -libjars) - giraph_jars = [giraph_examples] + giraph_jars = giraph_examples giraph_jars.extend(get_good_jars(giraph_home, prefix=True)) giraph_jars.extend(get_good_jars(giraph_libdir, prefix=True)) @@ -89,8 +95,8 @@ def install_giraph(giraph): with utils.environment_edit_in_place('/etc/environment') as env: cur_cp = env['HADOOP_CLASSPATH'] if 'HADOOP_CLASSPATH' in env else "" env['GIRAPH_HOME'] = giraph_home - env['HADOOP_CLASSPATH'] = "{ex}:{home}/*:{libs}/*:{cp}".format( - ex=giraph_examples, + env['HADOOP_CLASSPATH'] = "{examples}/*:{home}/*:{libs}/*:{cp}".format( + examples=giraph_docdir, home=giraph_home, libs=giraph_libdir, cp=cur_cp http://git-wip-us.apache.org/repos/asf/bigtop/blob/e8128261/bigtop-packages/src/charm/giraph/layer-giraph/resources/giraph-examples-1.1.0.jar ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/charm/giraph/layer-giraph/resources/giraph-examples-1.1.0.jar b/bigtop-packages/src/charm/giraph/layer-giraph/resources/giraph-examples-1.1.0.jar deleted file mode 100644 index 63e0a48..0000000 Binary files a/bigtop-packages/src/charm/giraph/layer-giraph/resources/giraph-examples-1.1.0.jar and /dev/null differ
