Commit 2935606f authored by Dimitris Aragiorgis's avatar Dimitris Aragiorgis

deploy: Fix GanetiDev component

This component is supposed to clone a ganeti repo and setup
a Ganeti QA cluster.

We provide a qa-init.sh that installs all required packages (apt-get
install and cabal install) and prepares the node for QA.

We provide a configure-ganeti similar to the one the debian packages
use so make install && /etc/init.d/ganeti restart will override
the existing binaries.

To install ganeti from source run on all nodes:

 # cd /srv/srv/ganeti
 # ./qa-init.sh
 # ./configure-ganeti
 # make && make install
 # cp doc/examples/ganeti.initd /etc/init.d/ganeti
 # /etc/init.d/ganeti restart

To run the QA do:

 # cd /srv/src/ganeti/qa
 # PYTHONPATH=/srv/src/ganeti/ ./ganeti-qa.py --yes-do-it /root/qa-sample.json
Signed-off-by: default avatarDimitris Aragiorgis <dimara@grnet.gr>
parent f9a429c6
......@@ -38,3 +38,7 @@ synnefo_public_network_subnet = 10.2.1.0/24
synnefo_public_network_gateway = 10.2.1.1
synnefo_public_network_netmask = 255.255.255.0
synnefo_public_network_type = CUSTOM
# Ganeti git repo
# git://git.ganeti.org/ganeti.git
ganeti_url = https://code.grnet.gr/git/snf-ganeti
......@@ -38,3 +38,7 @@ synnefo_public_network_subnet = 10.2.1.0/24
synnefo_public_network_gateway = 10.2.1.1
synnefo_public_network_netmask = 255.255.255.0
synnefo_public_network_type = CUSTOM
# Ganeti git repo
# git://git.ganeti.org/ganeti.git
ganeti_url = https://code.grnet.gr/git/snf-ganeti
./configure \
--prefix=/usr \
--localstatedir=/var \
--sysconfdir=/etc \
--with-export-dir=/var/lib/ganeti/export \
--with-iallocator-search-path=/usr/local/lib/ganeti/iallocators,/usr/lib/ganeti/iallocators \
--with-os-search-path=/srv/ganeti/os,/usr/local/lib/ganeti/os,/usr/lib/ganeti/os,/usr/share/ganeti/os \
--with-extstorage-search-path=/srv/ganeti/extstorage,/usr/local/lib/ganeti/extstorage,/usr/lib/ganeti/extstorage,/usr/share/ganeti/extstorage
\
--docdir=/usr/share/doc/ganeti \
--disable-symlinks
./configure \
--prefix=/usr \
--localstatedir=/var \
--sysconfdir=/etc \
--with-export-dir=/var/lib/ganeti/export \
--with-iallocator-search-path=/usr/local/lib/ganeti/iallocators,/usr/lib/ganeti/iallocators \
--with-os-search-path=/srv/ganeti/os,/usr/local/lib/ganeti/os,/usr/lib/ganeti/os,/usr/share/ganeti/os \
--with-extstorage-search-path=/srv/ganeti/extstorage,/usr/local/lib/ganeti/extstorage,/usr/lib/ganeti/extstorage,/usr/share/ganeti/extstorage
\
--docdir=/usr/share/doc/ganeti \
--enable-htools-rapi
cd %GANETI_SRC_DIR%
./autogen.sh
./configure \
--prefix=/usr \
--localstatedir=/var \
--sysconfdir=/etc \
--with-export-dir=/var/lib/ganeti/export \
--with-iallocator-search-path=/usr/local/lib/ganeti/iallocators,/usr/lib/ganeti/iallocators \
--with-os-search-path=/srv/ganeti/os,/usr/local/lib/ganeti/os,/usr/lib/ganeti/os,/usr/share/ganeti/os \
--with-extstorage-search-path=/srv/ganeti/extstorage,/usr/local/lib/ganeti/extstorage,/usr/lib/ganeti/extstorage,/usr/share/ganeti/extstorage \
--docdir=/usr/share/doc/ganeti \
--enable-symlinks
apt-get install \
gawk \
automake \
bridge-utils \
cabal-install \
fakeroot \
fping \
ghc \
ghc-haddock \
git \
graphviz \
hlint \
hscolour \
iproute \
iputils-arping \
libghc-attoparsec-dev \
libcurl4-gnutls-dev \
libghc-crypto-dev \
libghc-curl-dev \
libghc-haddock-dev \
libghc-hinotify-dev \
libghc-hslogger-dev \
libghc-hunit-dev \
libghc-json-dev \
libghc-network-dev \
libghc-parallel-dev \
libghc-quickcheck2-dev \
libghc-regex-pcre-dev \
libghc-snap-server-dev \
libghc-temporary-dev \
libghc-test-framework-dev \
libghc-test-framework-hunit-dev \
libghc-test-framework-quickcheck2-dev \
libghc-base64-bytestring-dev \
libghc-text-dev \
libcurl4-gnutls-dev \
libghc-utf8-string-dev \
libghc-vector-dev \
libghc-comonad-transformers-dev \
libpcre3-dev \
libghc6-zlib-dev \
libghc-lifted-base-dev \
shelltestrunner \
lvm2 \
make \
ndisc6 \
openssl \
pandoc \
pep8 \
pylint \
python \
python-bitarray \
python-coverage \
python-epydoc \
python-ipaddr \
python-openssl \
python-pip \
python-pycurl \
python-pyinotify \
python-pyparsing \
python-setuptools \
python-simplejson \
python-sphinx \
python-yaml \
qemu-kvm \
socat \
ssh \
vim \
python-fdsend
cabal update
cabal install \
json \
network \
parallel \
utf8-string \
curl \
hslogger \
Crypto \
hinotify==0.3.2 \
regex-pcre \
vector \
lifted-base==0.2.0.3 \
lens==3.10 \
base64-bytestring==1.0.0.1
# cluster is not initialized
if ! gnt-cluster getmaster; then
mkdir -p /etc/ganeti
mkdir -p /srv/ganeti/file-storage
mkdir -p /srv/ganeti/shared-file-storage
mkdir -p /var/lib/ganeti/rapi
cat >> /etc/ganeti/file-storage-paths <<EOF
/srv/ganeti/file-storage
/srv/ganeti/shared-file-storage
EOF
apt-get install drbd8-utils
cat >> /etc/modprobe.d/drbd.conf <<EOF
options drbd minor_count=255 usermode_helper=/bin/true
EOF
cat >> /etc/modules <<EOF
vhost-net
drbd
EOF
modprobe -v vhost-net
modprobe -v drbd
apt-get install -t wheezy-backports qemu-kvm
apt-get install snf-image
wget -4 http://cdn.synnefo.org/debian_base-7.0-x86_64.diskdump \
-o /var/lib/snf-image/debian_base.diskdump
touch /etc/ganeti/vnc-cluster-password
fi
cat >> /var/lib/ganeti/rapi/users <<EOF
ganeti-qa ganeti-qa write
EOF
......@@ -1952,105 +1952,12 @@ class Client(base.Component):
class GanetiDev(base.Component):
REQUIRED_PACKAGES = [
"automake",
"bridge-utils",
"cabal-install",
"fakeroot",
"fping",
"ghc",
"ghc-haddock",
"git",
"graphviz",
"hlint",
"hscolour",
"iproute",
"iputils-arping",
"libcurl4-openssl-dev",
"libghc-attoparsec-dev",
"libghc-crypto-dev",
"libghc-curl-dev",
"libghc-haddock-dev",
"libghc-hinotify-dev",
"libghc-hslogger-dev",
"libghc-hunit-dev",
"libghc-json-dev",
"libghc-network-dev",
"libghc-parallel-dev",
"libghc-quickcheck2-dev",
"libghc-regex-pcre-dev",
"libghc-snap-server-dev",
"libghc-temporary-dev",
"libghc-test-framework-dev",
"libghc-test-framework-hunit-dev",
"libghc-test-framework-quickcheck2-dev",
"libghc-base64-bytestring-dev",
"libghc-text-dev",
"libghc-utf8-string-dev",
"libghc-vector-dev",
"libghc-comonad-transformers-dev",
"libpcre3-dev",
"libghc6-zlib-dev",
"libghc-lifted-base-dev",
"libcurl4-openssl-dev",
"shelltestrunner",
"lvm2",
"make",
"ndisc6",
"openssl",
"pandoc",
"pep8",
"pylint",
"python",
"python-bitarray",
"python-coverage",
"python-epydoc",
"python-ipaddr",
"python-openssl",
"python-pip",
"python-pycurl",
"python-pyinotify",
"python-pyparsing",
"python-setuptools",
"python-simplejson",
"python-sphinx",
"python-yaml",
"qemu-kvm",
"socat",
"ssh",
"vim"
]
CABAL = [
"json",
"network",
"parallel",
"utf8-string",
"curl",
"hslogger",
"Crypto",
"hinotify==0.3.2",
"regex-pcre",
"vector",
"lifted-base==0.2.0.3",
"lens==3.10",
"base64-bytestring==1.0.0.1",
]
def _cabal(self):
ret = ["cabal update"]
for p in self.CABAL:
ret.append("cabal install %s" % p)
return ret
@base.run_cmds
def prepare(self):
src = config.src_dir
url1 = "git://git.ganeti.org/ganeti.git"
url2 = "https://code.grnet.gr/git/ganeti-local"
return self._cabal() + [
"git clone %s %s/ganeti" % (url1, src),
"git clone %s %s/snf-ganeti" % (url2, src)
return [
"mkdir -p %s" % config.src_dir,
"git clone %s %s/ganeti" % (config.ganeti_url, config.src_dir),
]
def _configure(self):
......@@ -2062,27 +1969,25 @@ class GanetiDev(base.Component):
"secondary": n.ip,
})
repl = {
r1 = {
"CLUSTER_NAME": self.cluster.name,
"VG": self.cluster.vg,
"CLUSTER_NETDEV": self.cluster.netdev,
"NODES": simplejson.dumps(sample_nodes),
"DOMAIN": self.cluster.domain
}
c8 = os.path.join(config.src_dir, "ganeti", "configure-2.8")
c10 = os.path.join(config.src_dir, "ganeti", "configure-2.10")
return [
("/root/qa-sample.json", repl, {}),
("/tmp/configure-2.8", {}, {"remote": c8, "mode": 0755}),
("/tmp/configure-2.10", {}, {"remote": c10, "mode": 0755}),
]
@base.run_cmds
def initialize(self):
d = os.path.join(config.src_dir, "ganeti")
r2 = {
"GANETI_SRC_DIR": "%s/ganeti" % config.src_dir,
}
remote1 = "%s/qa-init.sh" % config.src_dir
remote2 = "%s/configure-ganeti" % config.src_dir
return [
"cd %s; ./autogen.sh" % d,
"cd %s; ./configure" % d,
("/root/qa-sample.json", r1, {}),
("/tmp/qa-init.sh", {}, {"remote": remote1, "mode": 0755}),
("/tmp/configure-ganeti", r2, {"remote": remote2, "mode": 0755}),
]
@base.run_cmds
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment