Vagrant and start-up script updates for GBP image 05/28805/2
authorAndrew Grimberg <agrimberg@linuxfoundation.org>
Mon, 26 Oct 2015 15:35:45 +0000 (08:35 -0700)
committerAndrew Grimberg <agrimberg@linuxfoundation.org>
Mon, 26 Oct 2015 16:03:36 +0000 (09:03 -0700)
This change is a working setup for the image that is proposed by GBP for
testing purposes.

NOTE: Due to snapshots refusing to connect to the network after OVS is
installed but not having an issue once the system is up and OVS is
installed, the final OVS installation / statup is left as a step to
happen in the jenkins-script. That change is part of this submission.

Change-Id: I0cd2861d6e8cfe50538a9064eb30ca44b9d70153
Signed-off-by: Andrew Grimberg <agrimberg@linuxfoundation.org>
jenkins-scripts/ubuntu-docker-ovs.sh [changed mode: 0644->0755]
vagrant/gbp-ubuntu-docker-ovs-node/bootstrap.sh
vagrant/gbp-ubuntu-docker-ovs-node/docker_setup.pp [new file with mode: 0644]
vagrant/gbp-ubuntu-docker-ovs-node/gbp_packages.pp [new file with mode: 0644]
vagrant/gbp-ubuntu-docker-ovs-node/ovs_setup.pp [new file with mode: 0644]

old mode 100644 (file)
new mode 100755 (executable)
index 4b442d9..0947991
@@ -1,5 +1,10 @@
 #!/bin/bash
 
+# Do the final install of OVS that the has to be done at boot time for
+# some reason due to how the snapshots keep behaving.
+dpkg --install /root/openvswitch-datapath-dkms* && \
+dpkg --install /root/openvswitch-{common,switch}*
+
 # add user jenkins to docker group
 /usr/sbin/usermod -a -G docker jenkins
 
index 831a2d962c4378325a29b44cd50fb0310945fd97..2fadf142d43d3f5b82bffa1c232b542cad2f4541 100644 (file)
@@ -6,27 +6,47 @@ echo "---> Updating operating system"
 apt-get update -qq
 apt-get upgrade -y --force-yes -qq
 
-echo "---> Installing Group Based Policy requirements"
-apt-get install -y software-properties-common -qq
-apt-get install -y python-software-properties -qq
-apt-get install -y python-pip -qq
-apt-get install -y python-virtualenv -qq
-apt-get install -y git-core git -qq
-apt-get install -y curl -qq
-apt-get install -y bridge-utils -qq
+# we need garethr-docker in our puppet manifest to install docker
+# cleanly
+puppet module install garethr-docker --version 4.1.1
 
-# docker
-curl -sSL https://get.docker.com/ | sh
+# do the package install via puppet so that we know it actually installs
+# properly and it also makes it quieter but with better error reporting
+echo "---> Installing Group Based Policy requirements"
+puppet apply /vagrant/gbp_packages.pp
 
 # configure docker networking so that it does not conflict with LF internal networks
 # configure docker daemon to listen on port 5555 enabling remote managment
+# This has to happen before docker gets installed or things go sideways
+# badly
 cat <<EOL > /etc/default/docker
 # /etc/default/docker
 DOCKER_OPTS='-H unix:///var/run/docker.sock -H tcp://0.0.0.0:5555 --bip=10.250.0.254/24'
 EOL
-ip link set dev docker0 down
-brctl delbr docker0
-restart docker
+
+# docker
+echo "---> Installing docker"
+puppet apply /vagrant/docker_setup.pp
+
+echo "---> stopping docker"
+puppet apply -e "service { 'docker': ensure => stopped }"
+
+echo "---> cleaning docker configs that break after snapshotting"
+rm -f /var/lib/docker/repositories-aufs /etc/docker/key.json
 
 # OVS
-curl https://raw.githubusercontent.com/pritesh/ovs/nsh-v8/third-party/start-ovs-deb.sh | bash
+echo "---> Installing ovs"
+puppet module install puppetlabs-vcsrepo
+puppet apply /vagrant/ovs_setup.pp
+
+pushd /root/ovs
+DEB_BUILD_OPTIONS='parallel=8 nocheck' fakeroot debian/rules binary | \
+ grep 'dpkg-deb: building package'
+popd
+
+# Note this does not actually install OVS. Everytime we've tried to do
+# that the snapshot system hangs on spin-up for some reason. As such the
+# final installation will have to be left as a spin-up task
+
+# The following is what should be used in the spin-up task
+# dpkg --install /root/openvswitch-datapath-dkms* && dpkg --install /root/openvswitch-{common,switch}*
diff --git a/vagrant/gbp-ubuntu-docker-ovs-node/docker_setup.pp b/vagrant/gbp-ubuntu-docker-ovs-node/docker_setup.pp
new file mode 100644 (file)
index 0000000..4a3a66e
--- /dev/null
@@ -0,0 +1,6 @@
+
+#include docker
+class { 'docker':
+  tcp_bind         => 'tcp://0.0.0.0:5555',
+  extra_parameters => '--bip=10.250.0.254/24',
+}
diff --git a/vagrant/gbp-ubuntu-docker-ovs-node/gbp_packages.pp b/vagrant/gbp-ubuntu-docker-ovs-node/gbp_packages.pp
new file mode 100644 (file)
index 0000000..cfd4c6d
--- /dev/null
@@ -0,0 +1,11 @@
+package { [
+  'software-properties-common',
+  'python-software-properties',
+  'python-pip',
+  'python-virtualenv',
+  'git-core',
+  'git',
+  'curl',
+  'bridge-utils']:
+  ensure => present,
+}
diff --git a/vagrant/gbp-ubuntu-docker-ovs-node/ovs_setup.pp b/vagrant/gbp-ubuntu-docker-ovs-node/ovs_setup.pp
new file mode 100644 (file)
index 0000000..e475770
--- /dev/null
@@ -0,0 +1,30 @@
+package { [
+    'build-essential',
+    'fakeroot',
+    'debhelper',
+    'autoconf',
+    'automake',
+    'libssl-dev',
+    'bzip2',
+    'openssl',
+    'graphviz',
+    'python-all',
+    'procps',
+    'python-qt4',
+    'python-zopeinterface',
+    'python-twisted-conch',
+    'libtool',
+    "linux-headers-${::releaseversion}",
+    'dkms',
+  ]:
+  ensure => present,
+}
+
+vcsrepo { '/root/ovs':
+  ensure   => present,
+  provider => git,
+  source   => 'https://github.com/pritesh/ovs.git',
+  revision => 'nsh-v8',
+}
+
+