Update RPM build Vagrant env to official Cent7 20/31220/2
authorDaniel Farrell <dfarrell@redhat.com>
Fri, 11 Dec 2015 21:27:05 +0000 (16:27 -0500)
committerGerrit Code Review <gerrit@opendaylight.org>
Mon, 14 Dec 2015 17:24:56 +0000 (17:24 +0000)
Use official (latest) CentOS 7 Vagrant base box for the RPM building
Vagrant environment.

Make box more robust by just using rsync vs NFS for sync.

Allocate more RAM to prevent ODL OOM errors.

Change-Id: I37b5a89af3b7617425075fea17a73e4447a0cab9
Signed-off-by: Daniel Farrell <dfarrell@redhat.com>
rpm/Vagrantfile

index bdeea9116a1e142efd1dfea8ebf12c6c76b9e2ca..0d400b1cbbd8caa7c43f13d4d4251f84c808a05d 100644 (file)
@@ -6,7 +6,17 @@ VAGRANTFILE_API_VERSION = "2"
 
 Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
   # RPM build environment is CentOS 7
-  config.vm.box = "boxcutter/centos71"
+  config.vm.box = "centos/7"
+
+  # We run out of RAM once ODL starts with default 500MB
+  config.vm.provider :libvirt do |libvirt|
+    libvirt.memory = 2048
+    libvirt.cpus = 1
+  end
+
+  # NFS is fragile, use rsync
+  config.vm.synced_folder ".", "/vagrant", type: "rsync"
+  config.vm.synced_folder ".", "/home/vagrant/sync", disabled: true
 
   # Add EPEL for access to fedora-packager and maybe others
   config.vm.provision "shell", inline: "yum install -y epel-release"
@@ -21,7 +31,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
 
   # Install Python dependences system-wide via pip
   # NB: Could use a venv here, but since we're already in a Vagrant box and
-  # don't need any isolation it seem worth the extra complexity.
+  # don't need any isolation more, it doesn't seem worth the extra complexity.
   config.vm.provision "shell", inline: "pip install -r /vagrant/requirements.txt"
 
   # Add vagrant user to mock group for rpmbuild