# acknowledge the contributions of their colleagues of the SONATA
# partner consortium (www.sonata-nfv.eu).
-FROM ubuntu:xenial
+FROM ubuntu:bionic
ENV SON_EMU_IN_DOCKER 1
ENV PIP_DEFAULT_TIMEOUT=100
&& apt-get install -y git \
net-tools \
aptitude \
+ apt-utils \
build-essential \
- python-setuptools \
- python-dev \
- python-pip \
+ libevent-dev \
software-properties-common \
ansible \
curl \
iptables \
iputils-ping \
sudo \
- vim
+ wget \
+ python \
+ python-pip \
+ python3 \
+ python3-dev \
+ python3-venv \
+ python3-pip
# install containernet (using its Ansible playbook)
-#RUN git clone https://github.com/containernet/containernet.git && \
-# (cd containernet && git checkout 6fcee82e192c8c0e6447650d6f512842185529ee)
RUN git clone https://github.com/containernet/containernet.git
+
WORKDIR /containernet/ansible
RUN ansible-playbook -i "localhost," -c local --skip-tags "notindocker" install.yml
# install emulator (using its Ansible playbook)
-COPY . /son-emu
-WORKDIR /son-emu/ansible
+COPY . /vim-emu
+WORKDIR /vim-emu/ansible
RUN ansible-playbook -i "localhost," -c local --skip-tags "notindocker" install.yml
-WORKDIR /son-emu
-RUN python setup.py develop
+WORKDIR /vim-emu
+RUN python3 setup.py develop
# Hotfix: https://github.com/pytest-dev/pytest/issues/4770
-RUN pip2 install "more-itertools<=5.0.0"
+RUN pip3 install "more-itertools<=5.0.0"
# Hotfix: Do not use latest tinyrpc lib, since it breaks Ryu
-RUN pip2 install "tinyrpc==1.0.3"
+RUN pip3 install "tinyrpc==1.0.3"
+
+RUN pip3 install wheel --upgrade
# Important: This entrypoint is required to start the OVS service
-ENTRYPOINT ["/son-emu/utils/docker/entrypoint.sh"]
-CMD ["python", "examples/default_single_dc_topology.py"]
+ENTRYPOINT ["/vim-emu/utils/docker/entrypoint.sh"]
+CMD ["python3", "examples/default_single_dc_topology.py"]
# open ports for emulator APIs
# SONATA GK
+++ /dev/null
-# Copyright (c) 2017 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, Paderborn University
-# 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).
-
-FROM ubuntu:xenial
-
-ENV SON_EMU_IN_DOCKER 1
-ENV PIP_DEFAULT_TIMEOUT=100
-
-# install required packages
-RUN apt-get clean
-RUN apt-get update \
- && apt-get install -y git \
- net-tools \
- aptitude \
- apt-utils \
- build-essential \
- libevent-dev \
- software-properties-common \
- ansible \
- curl \
- iptables \
- iputils-ping \
- sudo \
- vim \
- nano \
- wget
-
-RUN add-apt-repository ppa:jonathonf/python-3.6
-RUN apt-get update
-RUN apt install -y python3.6
-RUN apt install -y python3.6-dev
-RUN apt install -y python3.6-venv
-RUN wget https://bootstrap.pypa.io/get-pip.py
-RUN python3.6 get-pip.py
-RUN ln -s /usr/bin/python3.6 /usr/local/bin/python3
-
-# install containernet (using its Ansible playbook)
-#RUN git clone https://github.com/containernet/containernet.git && \
-# (cd containernet && git checkout 6fcee82e192c8c0e6447650d6f512842185529ee)
-RUN git clone https://github.com/RafaelSche/containernet.git
-WORKDIR /containernet/ansible
-RUN ansible-playbook -i "localhost," -c local --skip-tags "notindocker" install_py3.yml
-
-# install emulator (using its Ansible playbook)
-COPY . /son-emu
-WORKDIR /son-emu/ansible
-RUN ansible-playbook -i "localhost," -c local --skip-tags "notindocker" install_py3.yml
-WORKDIR /son-emu
-RUN python3 setup.py develop
-
-# Hotfix: https://github.com/pytest-dev/pytest/issues/4770
-RUN pip3 install "more-itertools<=5.0.0"
-
-# Hotfix: Do not use latest tinyrpc lib, since it breaks Ryu
-RUN pip3 install "tinyrpc==1.0.3"
-
-RUN pip3 install wheel --upgrade
-
-# Important: This entrypoint is required to start the OVS service
-ENTRYPOINT ["/son-emu/utils/docker/entrypoint.sh"]
-CMD ["python3", "examples/default_single_dc_topology.py"]
-
-# open ports for emulator APIs
-# SONATA GK
-EXPOSE 5000
-# EMU REST API
-EXPOSE 5001
-# Monitoring (Prometheus)
-EXPOSE 8081
-# Monitoring (GW)
-EXPOSE 9091
-# OpenStack-fake
-EXPOSE 4000
-# OpenStack-fake
-EXPOSE 10243
-# OpenStack-fake
-EXPOSE 9005
-# OpenStack-fake (Keystone)
-EXPOSE 6001
-# OpenStack-fake
-EXPOSE 9775
-# OpenStack-fake
-EXPOSE 10697
// files owned by root that could not be cleaned up.
stage("Post-Test") {
sh "docker images"
- sh "docker run --rm --privileged --pid='host' -v /var/run/docker.sock:/var/run/docker.sock -u 0:0 osm/vim-emu-master pip list"
+ sh "docker run --rm --privileged --pid='host' -v /var/run/docker.sock:/var/run/docker.sock -u 0:0 osm/vim-emu-master pip3 list"
sh "docker run --rm --privileged --pid='host' -v /var/run/docker.sock:/var/run/docker.sock -u 0:0 osm/vim-emu-master pytest -v"
sh "docker run --rm --privileged --pid='host' -v /var/run/docker.sock:/var/run/docker.sock -u 0:0 osm/vim-emu-master flake8 --exclude=.eggs,devops,build,examples/charms --ignore=E501,W605,W504 ."
sh "echo 'done'"
The emulation platform `vim-emu` is developed as part of OSM's DevOps MDG.
-### Acknowledgments
+---
+## Acknowledgments
-This software was originally developed by the [SONATA project](http://www.sonata-nfv.eu), funded by the European Commission under grant number 671517 through the Horizon 2020 and 5G-PPP programs.
+This software was originally developed by the [SONATA project](http://www.sonata-nfv.eu) and the [5GTANGO project](https://5gtango.eu/), funded by the European Commission under grant number 671517 and 761493 through the Horizon 2020 and 5G-PPP programs.
-### Cite this work
+## Cite this work
If you use the emulation platform for your research and/or other publications, please cite the following paper to reference our work:
}
```
+---
## Installation
-There are multiple ways to install and use the emulation platform. The easiest way is the automated installation using the OSM installer. The bare-metal installation requires a freshly installed Ubuntu 16.04 LTS and is done by an ansible playbook. Another option is to use a nested Docker environment to run the emulator inside a Docker container.
+There are multiple ways to install and use the emulation platform. The easiest way is the automated installation using the OSM installer. The bare-metal installation requires a freshly installed **Ubuntu 18.04 LTS** and is done by an Ansible playbook. Another option is to use a nested Docker environment to run the emulator inside a Docker container.
-### Automated installation (recommended)
+### Automated OSM installation
+
+This installation option applies if you want to use vim-emu in combination with OSM.
```sh
-./install_osm.sh --lxdimages --vimemu
+./install_osm.sh --vimemu
```
-This command will install OSM (as LXC containers) as well as the emulator (as a Docker container) on a local machine. It is recommended to use a machine with Ubuntu 16.04.
+This command will install OSM as well as the emulator (as a Docker container) on a local machine. It is recommended to use a machine with Ubuntu 18.04 LTS. More details about this installation option can be found in the [OSM wiki](https://osm.etsi.org/wikipub/index.php/VIM_emulator).
-### Manual installation
+### Standalone installation
#### Option 1: Bare-metal installation
cd ~/containernet/ansible
sudo ansible-playbook -i "localhost," -c local install.yml
cd ..
-sudo python setup.py install
+sudo make develop
```
##### Step 2. vim-emu installation
cd ~/vim-emu/ansible
sudo ansible-playbook -i "localhost," -c local install.yml
cd ..
-sudo python setup.py install
+sudo python3 setup.py develop
```
#### Option 2: Nested Docker Deployment
This option requires a Docker installation on the host machine on which the emulator should be deployed.
+Build:
```sh
-git clone https://osm.etsi.org/gerrit/osm/vim-emu.git</code>
-cd ~/vim-emu</code>
+git clone https://osm.etsi.org/gerrit/osm/vim-emu.git
+cd ~/vim-emu
# build the container:
docker build -t vim-emu-img .
+```
+
+Run:
+```sh
# run the (interactive) container:
docker run --name vim-emu -it --rm --privileged --pid='host' -v /var/run/docker.sock:/var/run/docker.sock vim-emu-img /bin/bash
```
-
+---
## Usage
### Example
This simple example shows how to start the emulator with a simple topology (terminal 1) and how to start (terminal 2) some empty VNF containers in the emulated datacenters (PoPs) by using the vim-emu CLI.
-* First terminal (start the emulation platform):
- * `sudo python examples/default_single_dc_topology.py`
-* Second terminal (use `docker exec vim-emu <command>` for nested Docker deployment):
- * `vim-emu compute start -d dc1 -n vnf1`
- * `vim-emu compute start -d dc1 -n vnf2`
- * `vim-emu compute list`
-* First terminal:
- * `containernet> vnf1 ifconfig`
- * `containernet> vnf1 ping -c 2 vnf2`
+First terminal:
+```sh
+# start the emulation platform with a single NFV data center
+sudo python3 examples/default_single_dc_topology.py
+```
+
+Second terminal (use `docker exec vim-emu <command>` for nested Docker deployment):
+```sh
+# start two simple VNFs
+vim-emu compute start -d dc1 -n vnf1
+vim-emu compute start -d dc1 -n vnf2
+vim-emu compute list
+```
+
+First terminal:
+```sh
+# check the connectivity between the two VNFs
+# press <ENTER> <ENTER>
+containernet> vnf1 ifconfig
+containernet> vnf1 ping -c2 vnf2
+```
+
A more advanced example that includes OSM can be found in the [official vim-emu documentation in the OSM wiki](https://osm.etsi.org/wikipub/index.php/VIM_emulator).
-### Further documentation and useful links
+---
+## Documentation
+* [Official vim-emu repository mirror on GitHub](https://github.com/containernet/vim-emu)
* [Official vim-emu documentation in the OSM wiki](https://osm.etsi.org/wikipub/index.php/VIM_emulator)
* [Full vim-emu documentation on GitHub](https://github.com/containernet/vim-emu)
* [Mininet](http://mininet.org)
* [Containernet](https://containernet.github.io)
* [Maxinet](https://maxinet.github.io)
+---
## Development
### How to contribute?
### Testing
-To run the unit tests do:
-
-* `cd ~/vim-emu`
-* `sudo pytest -v`
-* (To force Python2: `sudo python2 -m pytest -v`)
-
-## Seed code contributors:
-
-### Lead:
-
-* Manuel Peuster (https://github.com/mpeuster)
-* Steven Van Rossem (https://github.com/stevenvanrossem)
+```sh
+sudo pytest -v
+```
-### Contributors
+---
+## Contributors
-* Hadi Razzaghi Kouchaksaraei (https://github.com/hadik3r)
-* Wouter Tavernier (https://github.com/wtaverni)
-* Geoffroy Chollon (https://github.com/cgeoffroy)
-* Eduard Maas (https://github.com/edmaas)
-* Malte Splietker (https://github.com/splietker)
-* Johannes Kampmeyer (https://github.com/xschlef)
-* Stefan Schneider (https://github.com/StefanUPB)
+* [Manuel Peuster (lead developer)](https://github.com/mpeuster)
+* [Hadi Razzaghi Kouchaksaraei](https://github.com/hadik3r)
+* [Wouter Tavernier](https://github.com/wtaverni)
+* [Geoffroy Chollon](https://github.com/cgeoffroy)
+* [Eduard Maas](https://github.com/edmaas)
+* [Malte Splietker](https://github.com/splietker)
+* [Johannes Kampmeyer](https://github.com/xschlef)
+* [Stefan Schneider](https://github.com/StefanUPB)
+* [Erik Schilling](https://github.com/Ablu)
+* [Rafael Schellenberg](https://github.com/RafaelSche)
## License
## Contact
-Manuel Peuster (Paderborn University) <manuel@peuster.de>
+Manuel Peuster
+* Mail: <manuel (at) peuster (dot) de>
+* Twitter: [@ManuelPeuster](https://twitter.com/ManuelPeuster)
+* GitHub: [@mpeuster](https://github.com/mpeuster)
+* Website: [https://peuster.de](https://peuster.de)
+
- name: updates apt
apt: update_cache=yes
- - name: install python-dev
- apt: pkg=python-dev state=installed
+ - name: install python3-dev
+ apt: pkg=python3-dev state=installed
- name: install libffi-dev
apt: pkg=libffi-dev state=installed
- name: install libssl-dev
apt: pkg=libssl-dev state=installed
- - name: install pip
- apt: pkg=python-pip state=installed
+ - name: install pip3
+ apt: pkg=python3-pip state=installed
- name: install libevent-dev
apt: pkg=libevent-dev state=installed
apt: pkg=python-all-dev state=installed
- name: find pip executable
- shell: "which pip"
+ shell: "which pip3"
register: pip_path
- name: install setuptools
pip: name=gevent executable={{pip_path.stdout}}
+
+
+++ /dev/null
-# 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, Paderborn University
-# 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).
-
-- hosts: localhost
- tasks:
- - name: updates apt
- apt: update_cache=yes
-
- - name: install python3-dev
- apt: pkg=python3-dev state=installed
-
- - name: install libffi-dev
- apt: pkg=libffi-dev state=installed
-
- - name: install libssl-dev
- apt: pkg=libssl-dev state=installed
-
- - name: install pip3
- apt: pkg=python3-pip state=installed
-
- - name: install libevent-dev
- apt: pkg=libevent-dev state=installed
-
- - name: install libevent-dev
- apt: pkg=python-all-dev state=installed
-
- - name: find pip executable
- shell: "which pip3"
- register: pip_path
-
- - name: install setuptools
- pip: name=setuptools state=latest executable={{pip_path.stdout}}
-
- - name: install tabulate
- pip: name=tabulate state=latest executable={{pip_path.stdout}}
-
- - name: install argparse
- pip: name=argparse state=latest executable={{pip_path.stdout}}
-
- - name: install networkx
- pip: name=networkx version=1.11 executable={{pip_path.stdout}}
-
- - name: install six
- pip: name=six state=latest executable={{pip_path.stdout}}
-
- - name: install tinyrpc (fixed version to not break ryu)
- pip: name=tinyrpc version=1.0.3 executable={{pip_path.stdout}}
-
- - name: install ryu
- pip: name=ryu state=latest executable={{pip_path.stdout}}
-
- - name: install oslo.config
- pip: name=oslo.config state=latest executable={{pip_path.stdout}}
-
- - name: install pytest
- pip: name=pytest version=4.6.4 executable={{pip_path.stdout}}
-
- - name: install Flask
- pip: name=Flask executable={{pip_path.stdout}}
-
- - name: install flask_restful
- pip: name=flask_restful state=latest executable={{pip_path.stdout}}
-
- - name: install requests
- pip: name=requests state=latest executable={{pip_path.stdout}}
-
- - name: install docker
- pip: name=docker version=2.0.2 executable={{pip_path.stdout}}
-
- - name: install prometheus_client
- pip: name=prometheus_client state=latest executable={{pip_path.stdout}}
-
- - name: install latest urllib3 (fix error urllib3.connection.match_hostname = match_hostname)
- pip: name=urllib3 version=1.21.1 executable={{pip_path.stdout}}
-
- - name: install iptc
- pip: name=python-iptables state=latest executable={{pip_path.stdout}}
-
- - name: install ipaddress
- pip: name=ipaddress state=latest executable={{pip_path.stdout}}
-
- - name: install gevent
- pip: name=gevent executable={{pip_path.stdout}}
-
-
-
-
# the vim-emu Docker container by user "root". It requires the container
# to be started in privileged mode.
#
-echo "vim-emu stage archive: Not implemented. See stage-pre-test.sh instead."
+echo "vim-emu stage archive: Not implemented. See Post-test stage in Jenkinsfile instead."
sudo pytest -v
# do everything in Docker, like it is done by Jenkins
docker build -t vim-emu-loc-test .
-docker run --rm --privileged --pid='host' -v /var/run/docker.sock:/var/run/docker.sock vim-emu-loc-test pip list
+docker run --rm --privileged --pid='host' -v /var/run/docker.sock:/var/run/docker.sock vim-emu-loc-test pip3 list
docker run --rm --privileged --pid='host' -v /var/run/docker.sock:/var/run/docker.sock vim-emu-loc-test pytest -v
docker run --rm --privileged --pid='host' -v /var/run/docker.sock:/var/run/docker.sock vim-emu-loc-test flake8 --exclude=.eggs,devopsi,build,examples/charms --ignore=E501,W605,W504 .
echo "done."
from setuptools import setup, find_packages
setup(name='emuvim',
- version='6.0',
+ version='7.0',
license='Apache 2.0',
description='vim-emu: A NFV multi-PoP emulation platform',
url='https://osm.etsi.org/gitweb/?p=osm/vim-emu.git',
r = list()
for net in range(base, base + subnet_size):
subnet = "{0}.{1}.0/{2}".format(prefix, net, mask)
- try:
- r.append(ipaddress.ip_network(subnet))
- except ValueError:
- r.append(ipaddress.ip_network(unicode(subnet)))
+ r.append(ipaddress.ip_network(subnet))
return r
+++ /dev/null
-# Copyright (c) 2017 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, Paderborn University
-# 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).
-
-************************************************************
-** Welcome to SONATA's son-emu VM **
-** http://sonata-nfv.eu **
-** **
-** To run the emulator with a simple example topology **
-** and its fake-gatekeeper run the following commands. **
-** **
-** Switch to example folder: **
-** - cd son-emu/src/emuvim/examples **
-** **
-** Start the emulator with SONATA's example topology: **
-** - sudo python sonata_y1_demo_topology_1.py **
-** **
-** The emulator will be started and the fake-gatekeeper **
-** API will be accessible on port 5000 from both the **
-** VM and your host machine. **
-************************************************************
\ No newline at end of file