Set DIB_CDH_MINOR_VERSION when required
Set DIB_CDH_MINOR_VERSION in diskimage-create so that it could not be an empty value. The order of the lines where DIB_CDH_VERSION is assigned for other CDH versions where DIB_CDH_MINOR_VERSION is not used was changed as well for consistency. Also, in order to try to prevent future errors, set the value of DIB_CDH_MINOR_VERSION based on DIB_CDH_VERSION in all elements where it is used (thanks to the ${VAR:-value} syntax which does not fail with set -u even if DIB_CDH_MINOR_VERSION is not assigned). Closes-Bug: #1657482 Change-Id: I31b25fd4ba886d051b9b57902cd72349a4a2dbfa
This commit is contained in:
parent
a94b9bbb85
commit
3dfcb641c0
@ -648,61 +648,62 @@ if [ -z "$PLUGIN" -o "$PLUGIN" = "cloudera" ]; then
|
||||
# hadoop version by '-v' parameter
|
||||
HADOOP_VERSION=${DIB_CDH_MINOR_VERSION%.*}
|
||||
fi
|
||||
export DIB_CDH_MINOR_VERSION=${DIB_CDH_MINOR_VERSION:-$HADOOP_VERSION.0}
|
||||
|
||||
cloudera_elements_sequence="hadoop-cloudera swift_hadoop kdc"
|
||||
if [ -z "$BASE_IMAGE_OS" -o "$BASE_IMAGE_OS" = "ubuntu" ]; then
|
||||
if [ -z "$HADOOP_VERSION" -o "$HADOOP_VERSION" = "5.0" ]; then
|
||||
export DIB_CDH_VERSION="5.0"
|
||||
cloudera_5_0_ubuntu_image_name=${cloudera_5_0_ubuntu_image_name:-ubuntu_sahara_cloudera_5_0_0}
|
||||
|
||||
# Cloudera supports only 12.04 Ubuntu
|
||||
export DIB_CDH_VERSION="5.0"
|
||||
export DIB_RELEASE="precise"
|
||||
image_create ubuntu $cloudera_5_0_ubuntu_image_name $cloudera_elements_sequence
|
||||
unset DIB_CDH_VERSION DIB_RELEASE
|
||||
fi
|
||||
if [ -z "$HADOOP_VERSION" -o "$HADOOP_VERSION" = "5.3" ]; then
|
||||
export DIB_CDH_VERSION="5.3"
|
||||
cloudera_5_3_ubuntu_image_name=${cloudera_5_3_ubuntu_image_name:-ubuntu_sahara_cloudera_5_3_0}
|
||||
|
||||
# Cloudera supports only 12.04 Ubuntu
|
||||
export DIB_CDH_VERSION="5.3"
|
||||
export DIB_RELEASE="precise"
|
||||
image_create ubuntu $cloudera_5_3_ubuntu_image_name $cloudera_elements_sequence
|
||||
unset DIB_CDH_VERSION DIB_RELEASE
|
||||
fi
|
||||
if [ -z "$HADOOP_VERSION" -o "$HADOOP_VERSION" = "5.4" ]; then
|
||||
export DIB_CDH_VERSION="5.4"
|
||||
cloudera_5_4_ubuntu_image_name=${cloudera_5_4_ubuntu_image_name:-ubuntu_sahara_cloudera_5_4_0}
|
||||
|
||||
# Cloudera supports only 12.04 Ubuntu
|
||||
export DIB_CDH_VERSION="5.4"
|
||||
export DIB_RELEASE="precise"
|
||||
image_create ubuntu $cloudera_5_4_ubuntu_image_name $cloudera_elements_sequence
|
||||
unset DIB_CDH_VERSION DIB_RELEASE
|
||||
fi
|
||||
if [ -z "$HADOOP_VERSION" -o "$HADOOP_VERSION" = "5.5" ]; then
|
||||
export DIB_CDH_VERSION="5.5"
|
||||
cloudera_5_5_ubuntu_image_name=${cloudera_5_5_ubuntu_image_name:-ubuntu_sahara_cloudera_5_5_0}
|
||||
|
||||
# Cloudera supports 14.04 Ubuntu in 5.5
|
||||
export DIB_CDH_VERSION="5.5"
|
||||
export DIB_RELEASE="trusty"
|
||||
image_create ubuntu $cloudera_5_5_ubuntu_image_name $cloudera_elements_sequence
|
||||
unset DIB_CDH_VERSION DIB_RELEASE
|
||||
fi
|
||||
if [ -z "$HADOOP_VERSION" -o "$HADOOP_VERSION" = "5.7" ]; then
|
||||
export DIB_CDH_VERSION="5.7"
|
||||
export DIB_CDH_MINOR_VERSION=${DIB_CDH_MINOR_VERSION:-$DIB_CDH_VERSION.0}
|
||||
cloudera_5_7_ubuntu_image_name=${cloudera_5_7_ubuntu_image_name:-ubuntu_sahara_cloudera_$DIB_CDH_MINOR_VERSION}
|
||||
|
||||
export DIB_CDH_VERSION="5.7"
|
||||
export DIB_RELEASE="trusty"
|
||||
image_create ubuntu $cloudera_5_7_ubuntu_image_name $cloudera_elements_sequence
|
||||
unset DIB_CDH_VERSION DIB_RELEASE
|
||||
unset DIB_CDH_VERSION DIB_RELEASE DIB_CDH_MINOR_VERSION
|
||||
fi
|
||||
if [ -z "$HADOOP_VERSION" -o "$HADOOP_VERSION" = "5.9" ]; then
|
||||
export DIB_CDH_VERSION="5.9"
|
||||
export DIB_CDH_MINOR_VERSION=${DIB_CDH_MINOR_VERSION:-$DIB_CDH_VERSION.0}
|
||||
cloudera_5_9_ubuntu_image_name=${cloudera_5_9_ubuntu_image_name:-ubuntu_sahara_cloudera_$DIB_CDH_MINOR_VERSION}
|
||||
|
||||
export DIB_CDH_VERSION="5.9"
|
||||
export DIB_RELEASE="trusty"
|
||||
image_create ubuntu $cloudera_5_9_ubuntu_image_name $cloudera_elements_sequence
|
||||
unset DIB_CDH_VERSION DIB_RELEASE
|
||||
unset DIB_CDH_VERSION DIB_RELEASE DIB_CDH_MINOR_VERSION
|
||||
fi
|
||||
fi
|
||||
|
||||
@ -754,19 +755,21 @@ if [ -z "$PLUGIN" -o "$PLUGIN" = "cloudera" ]; then
|
||||
fi
|
||||
if [ -z "$HADOOP_VERSION" -o "$HADOOP_VERSION" = "5.7" ]; then
|
||||
export DIB_CDH_VERSION="5.7"
|
||||
export DIB_CDH_MINOR_VERSION=${DIB_CDH_MINOR_VERSION:-$DIB_CDH_VERSION.0}
|
||||
|
||||
cloudera_5_7_centos7_image_name=${cloudera_5_7_centos7_image_name:-centos7_sahara_cloudera_$DIB_CDH_MINOR_VERSION}
|
||||
image_create centos7 $cloudera_5_7_centos7_image_name $cloudera_elements_sequence $centos7_cloudera_elements_sequence
|
||||
|
||||
unset DIB_CDH_VERSION
|
||||
unset DIB_CDH_VERSION DIB_CDH_MINOR_VERSION
|
||||
fi
|
||||
if [ -z "$HADOOP_VERSION" -o "$HADOOP_VERSION" = "5.9" ]; then
|
||||
export DIB_CDH_VERSION="5.9"
|
||||
export DIB_CDH_MINOR_VERSION=${DIB_CDH_MINOR_VERSION:-$DIB_CDH_VERSION.0}
|
||||
|
||||
cloudera_5_9_centos7_image_name=${cloudera_5_9_centos7_image_name:-centos7_sahara_cloudera_$DIB_CDH_MINOR_VERSION}
|
||||
image_create centos7 $cloudera_5_9_centos7_image_name $cloudera_elements_sequence $centos7_cloudera_elements_sequence
|
||||
|
||||
unset DIB_CDH_VERSION
|
||||
unset DIB_CDH_VERSION DIB_CDH_MINOR_VERSION
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -61,6 +61,8 @@ if [ -z "${DIB_CDH_HDFS_ONLY:-}" ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
DIB_CDH_MINOR_VERSION=${DIB_CDH_MINOR_VERSION:-$DIB_CDH_VERSION.0}
|
||||
|
||||
case "$DIB_CDH_VERSION" in
|
||||
5.7)
|
||||
HADOOP_OPENSTACK_5_7_x_URL="https://repository.cloudera.com/artifactory/repo/org/apache/hadoop/hadoop-openstack/2.6.0-cdh$DIB_CDH_MINOR_VERSION/hadoop-openstack-2.6.0-cdh$DIB_CDH_MINOR_VERSION.jar"
|
||||
|
@ -333,6 +333,8 @@ function add_repo_5_9_x {
|
||||
esac
|
||||
}
|
||||
|
||||
DIB_CDH_MINOR_VERSION=${DIB_CDH_MINOR_VERSION:-$DIB_CDH_VERSION.0}
|
||||
|
||||
# Call version-specific script to install the desired version of CDH
|
||||
case "$DIB_CDH_VERSION" in
|
||||
5.0)
|
||||
|
@ -28,6 +28,7 @@ case "$plugin_type" in
|
||||
esac
|
||||
case "$plugin_type" in
|
||||
"cloudera")
|
||||
DIB_CDH_MINOR_VERSION=${DIB_CDH_MINOR_VERSION:-$DIB_CDH_VERSION.0}
|
||||
DIB_HADOOP_SWIFT_JAR_NAME="hadoop-openstack-$hadoop-cdh$DIB_CDH_MINOR_VERSION.jar";;
|
||||
"spark")
|
||||
DIB_HADOOP_SWIFT_JAR_NAME="hadoop-openstack.jar";;
|
||||
|
Loading…
Reference in New Issue
Block a user