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
This commit is contained in:
Daniele Venzano 2015-07-17 08:29:31 +00:00
parent 7b5e1f8fe6
commit e278eb97ef
2 changed files with 29 additions and 0 deletions

View File

@ -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."

View File

@ -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