X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2Fvim-emu.git;a=blobdiff_plain;f=Vagrantfile;h=7c9c68f50bfd00a799674b82dc6dc804008f7ec7;hp=7cba18e48a77fcb81941b6711d1484ad22dcd9a2;hb=9cc7360bf2c0dacb869d8ed0674d9d9e269a1082;hpb=2ddea652655c654d69a8f8aff835555520776fb9 diff --git a/Vagrantfile b/Vagrantfile old mode 100644 new mode 100755 index 7cba18e..7c9c68f --- a/Vagrantfile +++ b/Vagrantfile @@ -1,3 +1,29 @@ +# Copyright (c) 2015 SONATA-NFV and Paderborn University +# ALL RIGHTS RESERVED. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Neither the name of the SONATA-NFV [, ANY ADDITIONAL AFFILIATION] +# nor the names of its contributors may be used to endorse or promote +# products derived from this software without specific prior written +# permission. +# +# This work has been performed in the framework of the SONATA project, +# funded by the European Commission under Grant number 671517 through +# the Horizon 2020 and 5G-PPP programmes. The authors would like to +# acknowledge the contributions of their colleagues of the SONATA +# partner consortium (www.sonata-nfv.eu). + # -*- mode: ruby -*- # vi: set ft=ruby : @@ -32,7 +58,10 @@ Vagrant.configure(2) do |config| # Create a forwarded port mapping which allows access to a specific port # within the machine from a port on the host machine. In the example below, # accessing "localhost:8080" will access port 80 on the guest machine. - config.vm.network "forwarded_port", guest: 5000, host: 5000 + config.vm.network "forwarded_port", guest: 5000, host: 5000 # dummy gatekeeper + config.vm.network "forwarded_port", guest: 5001, host: 5001 # REST API + config.vm.network "forwarded_port", guest: 8081, host: 8081 # cAdvisor + config.vm.network "forwarded_port", guest: 9091, host: 9091 # push gateway # Create a private network, which allows host-only access to the machine # using a specific IP. @@ -82,7 +111,7 @@ Vagrant.configure(2) do |config| sudo apt-get install -y git ansible aptitude sudo echo "localhost ansible_connection=local" >> /etc/ansible/hosts # install containernet - git clone https://github.com/mpeuster/containernet.git + git clone https://github.com/containernet/containernet.git echo "Installing containernet (will take some time ~30 minutes) ..." cd /home/vagrant/containernet/ansible sudo ansible-playbook install.yml @@ -96,10 +125,42 @@ Vagrant.configure(2) do |config| echo "Running son-emu unit tests to validate installation" cd /home/vagrant/son-emu sudo python setup.py develop - sudo py.test -v + sudo py.test -v src/emuvim/test/unittests + + # install son-cli + sudo apt-get install -y python-pip python-dev + sudo apt-get install -y python3.4 python3-dev libffi-dev libssl-dev libyaml-dev build-essential + sudo pip install virtualenv + cd /home/vagrant + git clone https://github.com/sonata-nfv/son-cli.git + cd son-cli + virtualenv -p /usr/bin/python3.4 venv + source venv/bin/activate + python bootstrap.py + bin/buildout + + # clone son-examples (disabled until repo goes public) + cd /home/vagrant + git clone https://github.com/sonata-nfv/son-examples.git + + # prepare VM for some special containers (PF_RING) + cd /home/vagrant/son-examples/vnfs/sonata-vtc-vnf-docker/ + chmod +x prepare_host.sh + sudo ./prepare_host.sh # place motd + cd /home/vagrant/son-emu sudo cp utils/vagrant/motd /etc/motd + + # pre-fetch sonata example vnfs from DockerHub + echo "Fetching SONATA example VNF container from DockerHub/sonatanfv" + sudo docker pull sonatanfv/sonata-empty-vnf + sudo docker pull sonatanfv/sonata-iperf3-vnf + sudo docker pull sonatanfv/sonata-snort-ids-vnf + sudo docker pull sonatanfv/sonata-ovs1-vnf + sudo docker pull sonatanfv/sonata-ryu-vnf + sudo docker pull sonatanfv/sonata-vtc-vnf + sudo docker pull sonatanfv/son-emu-sap SHELL # TODO the native ansible provisioner does not work so we directly call the shell commands