summaryrefslogtreecommitdiffstats
path: root/ci
diff options
context:
space:
mode:
authorGuo Ruijing <ruijing.guo@intel.com>2017-11-09 11:42:19 -0500
committerGuo Ruijing <ruijing.guo@intel.com>2017-11-09 12:00:10 -0500
commit7272576f8f2b847f92d44c22282f660d2076ba00 (patch)
treed61136dd832d304d27ee48a3bb57ce639a72f7f9 /ci
parent5f41686bc6a09307e346bbbf980ab45df7ac9ced (diff)
create opnfv/container4nfv vagrant box
containter4nfv job is slow to install packages & docker image. opnfv/containter4nfv vagrant box install docker.io & kubernetes and pull kubernetes dockers. Change-Id: I78d5142127d31214c397bd8fc8465b0a6fc647cf Signed-off-by: Guo Ruijing <ruijing.guo@intel.com>
Diffstat (limited to 'ci')
-rw-r--r--ci/Vagrantfile38
-rwxr-xr-xci/setup_vagrant.sh7
2 files changed, 45 insertions, 0 deletions
diff --git a/ci/Vagrantfile b/ci/Vagrantfile
new file mode 100644
index 0000000..3569f89
--- /dev/null
+++ b/ci/Vagrantfile
@@ -0,0 +1,38 @@
+Vagrant.require_version ">= 1.8.6"
+
+$script = <<SCRIPT
+#!/bin/bash
+wget https://raw.githubusercontent.com/mitchellh/vagrant/master/keys/vagrant.pub -O .ssh/authorized_keys
+chmod 700 .ssh
+chmod 600 .ssh/authorized_keys
+chown -R vagrant:vagrant .ssh
+
+curl -s http://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
+cat <<EOF | tee /etc/apt/sources.list.d/kubernetes.list
+deb http://apt.kubernetes.io/ kubernetes-xenial main
+EOF
+apt-get update
+apt-get install -y --allow-downgrades docker.io kubelet=1.7.0-00 kubeadm=1.7.0-00 kubectl=1.7.0-00 kubernetes-cni=0.5.1-00
+docker pull gcr.io/google_containers/kube-proxy-amd64:v1.7.10
+docker pull gcr.io/google_containers/kube-apiserver-amd64:v1.7.10
+docker pull gcr.io/google_containers/kube-controller-manager-amd64:v1.7.10
+docker pull gcr.io/google_containers/kube-scheduler-amd64:v1.7.10
+docker pull weaveworks/weave-npc:2.0.5
+docker pull weaveworks/weave-kube:2.0.5
+docker pull gcr.io/google_containers/k8s-dns-sidecar-amd64:1.14.4
+docker pull gcr.io/google_containers/k8s-dns-kube-dns-amd64:1.14.4
+docker pull gcr.io/google_containers/k8s-dns-dnsmasq-nanny-amd64:1.14.4
+docker pull gcr.io/google_containers/etcd-amd64:3.0.17
+docker pull gcr.io/google_containers/pause-amd64:3.0
+SCRIPT
+
+Vagrant.configure("2") do |config|
+
+ config.vm.box = "bento/ubuntu-16.04"
+ config.ssh.insert_key = false
+
+ config.vm.define "container4nfv" do |config|
+ config.vm.hostname = "container4nfv"
+ config.vm.provision "shell", inline: $script
+ end
+end
diff --git a/ci/setup_vagrant.sh b/ci/setup_vagrant.sh
index cd334d5..a7427be 100755
--- a/ci/setup_vagrant.sh
+++ b/ci/setup_vagrant.sh
@@ -12,6 +12,13 @@ wget https://releases.hashicorp.com/vagrant/1.8.7/vagrant_1.8.7_x86_64.deb
sudo dpkg -i vagrant_1.8.7_x86_64.deb
rm -rf vagrant_1.8.7_x86_64.deb
+vagrant destroy -f; rm -rf package.box
+vagrant up
+VBoxManage list vms | grep container4nfv | cut -f2 -d'"' | xargs -I {} vagrant package --base {}
+vagrant box remove -f opnfv/container4nfv --all || true
+vagrant box add opnfv/container4nfv file:package.box
+vagrant destroy -f; rm -rf package.box
+
#refer to https://github.com/vagrant-libvirt/vagrant-libvirt
#sudo apt-get build-dep vagrant ruby-libvirt -y
sudo apt-get install -y qemu libvirt-bin ebtables dnsmasq