Merge "Reduce number of logs kept for merge and periodic jobs"
[releng/builder.git] / vagrant / gbp-ubuntu-docker-ovs-node / bootstrap.sh
index 831a2d962c4378325a29b44cd50fb0310945fd97..e8ac368235ae07070f9569d4a1c9fb9887e90e39 100644 (file)
@@ -4,29 +4,50 @@
 
 echo "---> Updating operating system"
 apt-get update -qq
-apt-get upgrade -y --force-yes -qq
+DEBIAN_FRONTEND=noninteractive apt-get upgrade -y --force-yes -qq \
+    -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold"
 
-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}*