From e278eb97efef77e97896572bb6095d971e30ebb7 Mon Sep 17 00:00:00 2001 From: Daniele Venzano Date: Fri, 17 Jul 2015 08:29:31 +0000 Subject: [PATCH] Deprecate Spark 0.x and 1.0.x images This change request adds deprecation warnings when generating images containing Spark versions that have been deprecated in the Sahara Spark plugin. The idea is also to deprecate all Spark versions that depend on the hadoop-cdh element, so that it can be removed later on. Change-Id: Iefed31c8f22a40eb4e3eed835d7bb10f4fa20750 Implements: blueprint deprecate-spark-100 --- elements/hadoop-cdh/root.d/0-check-hadoop-cdh | 7 ++++++ elements/spark/root.d/0-check-spark | 22 +++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/elements/hadoop-cdh/root.d/0-check-hadoop-cdh b/elements/hadoop-cdh/root.d/0-check-hadoop-cdh index 278b9b86..e7ad22d4 100755 --- a/elements/hadoop-cdh/root.d/0-check-hadoop-cdh +++ b/elements/hadoop-cdh/root.d/0-check-hadoop-cdh @@ -6,6 +6,13 @@ fi set -eu set -o pipefail +echo "##############################################################" +echo "## ##" +echo "## WARNING: this element (hadoop-cdh) has been deprecated ##" +echo "## Please use the hadoop-cloudera element ##" +echo "## ##" +echo "##############################################################" + if [ -z "${JAVA_DOWNLOAD_URL:-}" ]; then if [ -z "${JAVA_FILE:-}" ]; then echo "JAVA_FILE and JAVA_DOWNLOAD_URL are not set. Proceeding with distro native Java." diff --git a/elements/spark/root.d/0-check-spark b/elements/spark/root.d/0-check-spark index e07fff36..2c13e06c 100755 --- a/elements/spark/root.d/0-check-spark +++ b/elements/spark/root.d/0-check-spark @@ -6,6 +6,28 @@ fi set -eu set -o pipefail +print_deprecation_warning() { + echo "##############################################################" + echo "## ##" + echo "## WARNING: the version of Spark being included in this ##" + echo "## image has been deprecated in the Sahara Spark ##" + echo "## plugin. Please consider upgrading to a ##" + echo "## supported version. ##" + echo "## ##" + echo "## See: https://wiki.openstack.org/wiki/Sahara/SparkPlugin ##" + echo "## ##" + echo "##############################################################" +} + +# Check for deprecated versions in the Spark plugin +major_v=$(echo $DIB_SPARK_VERSION | cut -f1 -d.) +minor_v=$(echo $DIB_SPARK_VERSION | cut -f2 -d.) +if [ "${major_v}" == "0" ]; then + print_deprecation_warning +elif [ "${major_v}" == "1" -a "${minor_v}" == "0" ]; then + print_deprecation_warning +fi + if [ -z "${SPARK_DOWNLOAD_URL:-}" -a -z "${DIB_CDH_VERSION:-}" ]; then echo -e "Neither DIB_CDH_VERSION nor SPARK_DOWNLOAD_URL are set. Impossible to install Spark.\nAborting" exit 1