Start switching to declarative package-installs

Make use of the package-installs element to declare in yaml format the
packages to be installed at the beginning of a phase.

Other than reducing the amont of explicit 'install-packages pkg1 ...'
invocations, they can also be installed just once per-phase.

Change-Id: I1f1acfb2bd74fed5cf4c0b48bc739f7f75c35d83
This commit is contained in:
Pino Toscano 2015-04-09 10:15:29 +02:00 committed by luhuichun
parent c3e937604a
commit c8cbe25f1b
46 changed files with 66 additions and 48 deletions

View File

@ -0,0 +1 @@
package-installs

View File

@ -0,0 +1,2 @@
which:
phase: post-install.d

View File

@ -6,8 +6,6 @@ fi
set -eu
set -o pipefail
install-packages which
if which systemctl; then
systemctl disable firewalld
fi

View File

@ -1,3 +1,4 @@
java
package-installs
sahara-version
ssh

View File

@ -0,0 +1,4 @@
curl:
phase: post-install.d
wget:
phase: post-install.d

View File

@ -29,7 +29,6 @@ esac
echo "CDH 4 will be injected into image. Starting the download"
install-packages wget
# Here more versions of CDH could be supported by downloading the right repository package.
wget -P $tmp_dir "http://archive.cloudera.com/cdh4/one-click-install/precise/amd64/cdh4-repository_1.0_all.deb"
if [ $? -ne 0 ]; then

View File

@ -1,2 +1,3 @@
extjs
package-installs
ssh

View File

@ -0,0 +1,2 @@
wget:
phase: pre-install.d

View File

@ -1,5 +1,6 @@
disable-firewall
disable-selinux
java
package-installs
sahara-version
source-repositories

View File

@ -26,14 +26,6 @@ fi
set -eu
set -o pipefail
install-packages wget
install-packages ntp
install-packages bind-utils
#install cloud-inint which is necessary for all images
install-packages cloud-init
# change the cloud-init user to root
sed "s/ec2-user/root/" -i /etc/cloud/cloud.cfg
sed "s/disable_root: 1/disable_root: 0/" -i /etc/cloud/cloud.cfg

View File

@ -150,9 +150,6 @@ function installHDP_2_0 {
# Start of Main HDP Install Element
# Make sure wget is installed
install-packages wget
# Call version-specific script to install the desired version of HDP
if [[ $DIB_HDP_VERSION == "1.3" ]]; then
echo "Installing HDP Version $DIB_HDP_VERSION..."

View File

@ -0,0 +1,5 @@
wget:
ntp:
bind-utils:
# install cloud-init which is necessary for all images
cloud-init:

View File

@ -1,3 +1,4 @@
extjs
java
mysql
package-installs

View File

@ -8,8 +8,6 @@ set -o pipefail
echo "START: installing MapR core repository"
install-packages curl
MAPR_REPO_DIR=/opt/mapr-repository/core
if [ "$DISTRO_NAME" = "ubuntu" ]; then

View File

@ -0,0 +1,2 @@
curl:
wget:

View File

@ -1,4 +1,5 @@
cache-url
java
package-installs
sahara-version
ssh

View File

@ -0,0 +1,4 @@
wget:
phase: post-install.d
tar:
phase: post-install.d

View File

@ -13,8 +13,6 @@ fi
set -eu
set -o pipefail
install-packages wget tar
function install_hadoop_v1 {
case "$DISTRO_NAME" in
ubuntu )

View File

@ -1,3 +1,4 @@
cache-url
hadoop
mysql
package-installs

View File

@ -0,0 +1,2 @@
tar:
phase: post-install.d

View File

@ -6,8 +6,6 @@ fi
set -eu
set -o pipefail
install-packages tar
tmp_dir=/tmp/hive
cd $tmp_dir

View File

@ -1,2 +1,3 @@
cache-url
package-installs
sahara-version

View File

@ -8,8 +8,6 @@ set -o pipefail
echo "Oozie setup"
install-packages zip unzip tar
tmp_dir=/tmp/oozie
if [[ "$DIB_HADOOP_VERSION" < "2.0.0" ]]; then

View File

@ -0,0 +1,5 @@
zip:
unzip:
tar:
wget:
phase: post-install.d

View File

@ -6,8 +6,6 @@ fi
set -eu
set -o pipefail
install-packages wget
ln -s /usr/share/java/mysql-connector-java.jar /opt/oozie/libtools/mysql.jar
ln -s /usr/share/java/mysql-connector-java.jar /opt/oozie/oozie-server/lib/mysql.jar

View File

@ -0,0 +1 @@
package-installs

View File

@ -0,0 +1,2 @@
redhat-lsb:
phase: pre-install.d

View File

@ -1,9 +0,0 @@
#!/bin/bash
if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then
set -x
fi
set -eu
set -o pipefail
install-packages redhat-lsb

View File

@ -0,0 +1 @@
package-installs

View File

@ -0,0 +1,6 @@
augeas-tools:
phase: post-install.d
openssh-server:
phase: post-install.d
openssh-client:
phase: post-install.d

View File

@ -11,7 +11,6 @@ if [ -z "$DIB_PASSWORD" ]; then
exit 1
fi
sed -i "s/disable_root: true/disable_root: false/" /etc/cloud/cloud.cfg
install-packages augeas-tools openssh-server openssh-client
augtool -s set /files/etc/ssh/sshd_config/PasswordAuthentication yes
augtool -s set /files/etc/ssh/sshd_config/PermitRootLogin yes
augtool -s set /files/etc/ssh/ssh_config/PasswordAuthentication yes

View File

@ -1,2 +1,3 @@
cache-url
hadoop-cdh
package-installs

View File

@ -8,8 +8,6 @@ fi
set -eu
set -o pipefail
install-packages tar
tmp_dir=/tmp/spark
pushd $tmp_dir

View File

@ -0,0 +1 @@
tar:

View File

@ -0,0 +1 @@
package-installs

View File

@ -7,12 +7,6 @@ set -u
set -o pipefail
echo "Begin: install and configure SSH"
# /etc/ssh/sshd_config is provided by openssh-server
# /etc/ssh/ssh_config is provided by openssh-client
# Note: You need diskimage-builder w/ SHA 82eacdec (11 July 2013) for
# this install to work on Fedora - https://review.openstack.org/#/c/36739/
install-packages augeas-tools openssh-server openssh-client
augtool -s set /files/etc/ssh/sshd_config/GSSAPIAuthentication no
augtool -s set /files/etc/ssh/sshd_config/UseDNS no
augtool -s set /files/etc/ssh/sshd_config/PermitTunnel yes

View File

@ -0,0 +1,5 @@
augeas-tools:
# /etc/ssh/sshd_config is provided by openssh-server
openssh-server:
# /etc/ssh/ssh_config is provided by openssh-client
openssh-client:

View File

@ -1,2 +1,3 @@
cache-url
package-installs
zookeeper

View File

@ -8,8 +8,6 @@ fi
set -u
set -o pipefail
install-packages wget unzip build-essential uuid-dev git libtool autoconf pkg-config tar
tmp_dir=/tmp/storm
echo "Creating Storm User"

View File

@ -0,0 +1,8 @@
unzip:
build-essential:
uuid-dev:
git:
libtool:
autoconf:
pkg-config:
tar:

View File

@ -0,0 +1 @@
package-installs

View File

@ -0,0 +1,2 @@
wget:
phase: post-install.d

View File

@ -6,8 +6,6 @@ fi
set -eu
set -o pipefail
install-packages wget
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"

View File

@ -0,0 +1 @@
package-installs

View File

@ -8,8 +8,6 @@ fi
set -eu
set -o pipefail
install-packages wget
echo "Downloading Zookeeper"
mkdir -p /opt/zookeeper

View File

@ -0,0 +1 @@
wget: