Elements and diskimage-create removed

You can find them in savanna-image-elements repo.

Fixes: bug #1234656

Change-Id: I75ad57ab16f1a117b33b0be5b2313325a51b1da9
This commit is contained in:
Sergey Lukjanov 2013-10-03 15:23:01 +04:00
parent c3ef37253f
commit 34ebde2bd6
10 changed files with 0 additions and 134 deletions

View File

@ -1,18 +0,0 @@
Diskimage-builder script for creation cloud images
=================================================
This scrtips builds Ubuntu and Fedora cloud images with default parameters.
For users:
1. Use your environment (export / setenv) to alter the scripts behavior. Environment variables the script accepts are DIB_HADOOP_VERSION, JAVA_DOWNLOAD_URL, OOZIE_DOWNLOAD_URL, HIVE_VERSION, ubuntu_image_name, fedora_image_name.
2. If you want to use your local mirrors, you should specify http urls for Fedora and Ubuntu mirrors using parameters 'FEDORA_MIRROR' and 'UBUNTU_MIRROR' like this:
.. sourcecode:: bash
sudo USE_MIRRORS=true FEDORA_MIRROR="url_for_fedora_mirror" UBUNTU_MIRROR="url_for_ubuntu_mirror" bash diskimage-create.sh
For developers:
1. If you want to add your element to this repository, you should edit this script in your commit (you should export variables for your element and add name of element to variables 'element_sequence').

View File

@ -1,79 +0,0 @@
#!/bin/bash
set -e
# Export variables for elements
export DIB_HADOOP_VERSION="1.1.2"
export JAVA_DOWNLOAD_URL="http://download.oracle.com/otn-pub/java/jdk/7u25-b15/jdk-7u25-linux-x64.tar.gz"
export ubuntu_image_name="ubuntu_savanna_latest"
export fedora_image_name="fedora_savanna_latest"
export OOZIE_DOWNLOAD_URL="http://a8e0dce84b3f00ed7910-a5806ff0396addabb148d230fde09b7b.r31.cf1.rackcdn.com/oozie-3.3.2.tar.gz"
export HIVE_VERSION="0.11.0"
str=$(head -1 /etc/os-release)
if [ $str = 'NAME="Ubuntu"' ]; then
apt-get update -y
apt-get install qemu kpartx git -y
elif [ $str = 'NAME=Fedora' ]; then
yum update -y
yum install qemu kpartx git -y
fi
if [ -d /home/$USER/.cache/image-create ]; then
rm -rf /home/$USER/.cache/image-create/*
fi
cur_dir=$(pwd)
if [ ! -d "DIB_work" ]; then
mkdir DIB_work
fi
pushd DIB_work
# Cloning repostiroies
rm -rf diskimage-builder
git clone https://github.com/openstack/diskimage-builder
rm -rf savanna-extra
git clone https://github.com/stackforge/savanna-extra
pushd diskimage-builder
export DIB_COMMIT_ID=`git show --format=%H | head -1`
popd
export PATH=$PATH:$cur_dir/DIB_work/diskimage-builder/bin
export ELEMENTS_PATH=$cur_dir/DIB_work/diskimage-builder/elements
pushd savanna-extra
export SAVANNA_ELEMENTS_COMMIT_ID=`git show --format=%H | head -1`
popd
if [ -e $cur_dir/DIB_work/diskimage-builder/sudoers.d/img-build-sudoers ]; then
cp $cur_dir/DIB_work/diskimage-builder/sudoers.d/img-build-sudoers /etc/sudoers.d/
chown root:root /etc/sudoers.d/img-build-sudoers
chmod 0440 /etc/sudoers.d/img-build-sudoers
fi
cp -r $cur_dir/DIB_work/savanna-extra/elements/* $cur_dir/DIB_work/diskimage-builder/elements/
ubuntu_elements_sequence="base vm ubuntu hadoop swift_hadoop oozie mysql hive"
fedora_elements_sequence="base vm fedora hadoop swift_hadoop oozie mysql hive selinux-permissive"
if [ -n "$USE_MIRRORS" ]; then
mirror_element=" apt-mirror"
ubuntu_elements_sequence=$ubuntu_elements_sequence$mirror_element
mirror_element=" yum-mirror"
fedora_elements_sequence=$fedora_elements_sequence$mirror_element
fi
# Creating Ubuntu cloud image
disk-image-create $ubuntu_elements_sequence -o $ubuntu_image_name
# Creating Fedora cloud image
# Patameter 'DIB_IMAGE_SIZE' should be specified for Fedora only
export DIB_IMAGE_SIZE="10"
disk-image-create $fedora_elements_sequence -o $fedora_image_name
mv $fedora_image_name.qcow2 ../
mv $ubuntu_image_name.qcow2 ../
popd
rm -rf DIB_work

View File

@ -1,2 +0,0 @@
This element setups mirror for updating Ubuntu cloud image. Using mirror increases speed of building image.
You should specify http url for Ubuntu mirror using parameter 'UBUNTU_MIRROR'.

View File

@ -1,3 +0,0 @@
#!/bin/bash
rm /etc/apt/apt.conf.d/01proxy

View File

@ -1,5 +0,0 @@
#!/bin/bash
mkdir -p /etc/apt/apt.conf.d/
touch /etc/apt/apt.conf.d/01proxy
echo -e "Acquire::http { Proxy \"$UBUNTU_MIRROR\"; };" > /etc/apt/apt.conf.d/01proxy

View File

@ -1,5 +0,0 @@
#!/bin/bash
if [ -z "$UBUNTU_MIRROR" ]; then
echo "You should specify parameter 'UBUNTU_MIRROR'"
exit 2
fi

View File

@ -1,2 +0,0 @@
This element setups mirror for updating Fedora cloud image. Using mirror increases speed of building image.
You should specify http url for Fedora mirror using parameter 'FEDORA_MIRROR'.

View File

@ -1,3 +0,0 @@
#!/bin/bash
mv /etc/yum.repos.d/tempfile /etc/yum.repos.d/fedora.repo

View File

@ -1,12 +0,0 @@
#!/bin/bash
mv /etc/yum.repos.d/fedora.repo /etc/yum.repos.d/tempfile
cat >> /etc/yum.repos.d/fedora.repo <<EOF
[Local-Repository]
name=Fedora \$releasever - \$basearch - Local
baseurl=$FEDORA_MIRROR
enabled=1
gpgcheck=0
priority=1
EOF
yum makecache

View File

@ -1,5 +0,0 @@
#!/bin/bash
if [ -z "$FEDORA_MIRROR" ]; then
echo "You should specify parameter 'FEDORA_MIRROR'"
exit 2
fi