From 4560d069f23583fbee1c29e063b67ccbfc37bb8c Mon Sep 17 00:00:00 2001 From: Trevor McKay Date: Fri, 16 Jan 2015 15:43:29 -0500 Subject: [PATCH] Add the swift_hadoop element to Spark images The Spark image needs the hadoop-swift.jar in /usr/lib/hadoop in order for Spark jobs to access Swift URLs. Change-Id: I1c47cbc877e6c6628dc3fd2181152b2c4d4cd3f9 Partial-Implements: blueprint edp-spark-swift-integration --- diskimage-create/diskimage-create.sh | 4 +++- elements/swift_hadoop/post-install.d/81-add-jar | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/diskimage-create/diskimage-create.sh b/diskimage-create/diskimage-create.sh index 36e632c9..b7f3abb1 100755 --- a/diskimage-create/diskimage-create.sh +++ b/diskimage-create/diskimage-create.sh @@ -365,6 +365,7 @@ fi ########################## if [ -z "$PLUGIN" -o "$PLUGIN" = "spark" ]; then + export DIB_HDFS_LIB_DIR="/usr/lib/hadoop" export DIB_CLOUD_INIT_DATASOURCES=$CLOUD_INIT_DATASOURCES # Ignoring image type and hadoop version options @@ -374,7 +375,7 @@ if [ -z "$PLUGIN" -o "$PLUGIN" = "spark" ]; then export DIB_HADOOP_VERSION="CDH4" export ubuntu_image_name=${ubuntu_spark_image_name:-"ubuntu_sahara_spark_latest"} - ubuntu_elements_sequence="base vm ubuntu java hadoop-cdh spark" + ubuntu_elements_sequence="base vm ubuntu java hadoop-cdh swift_hadoop spark" if [ -n "$USE_MIRRORS" ]; then [ -n "$UBUNTU_MIRROR" ] && ubuntu_elements_sequence="$ubuntu_elements_sequence apt-mirror" @@ -384,6 +385,7 @@ if [ -z "$PLUGIN" -o "$PLUGIN" = "spark" ]; then disk-image-create $ubuntu_elements_sequence -o $ubuntu_image_name mv $ubuntu_image_name.qcow2 ../ unset DIB_CLOUD_INIT_DATASOURCES + unset DIB_HDFS_LIB_DIR fi diff --git a/elements/swift_hadoop/post-install.d/81-add-jar b/elements/swift_hadoop/post-install.d/81-add-jar index bfcbf745..be0eebf0 100755 --- a/elements/swift_hadoop/post-install.d/81-add-jar +++ b/elements/swift_hadoop/post-install.d/81-add-jar @@ -2,7 +2,7 @@ install-packages wget -HDFS_LIB_DIR="/usr/share/hadoop/lib" +HDFS_LIB_DIR=${DIB_HDFS_LIB_DIR:-"/usr/share/hadoop/lib"} SWIFT_LIB_URI="http://sahara-files.mirantis.com/hadoop-swift/hadoop-swift-latest.jar" if [ -z "$swift_url" ]; then