Skip to content

StorageBackend: OsmNbiBackend

Manuel Peuster edited this page Jul 4, 2018 · 2 revisions

This storage backend is able to interact with the northbound interface (NBI) of OSM rel. FOUR which is aligned to ETSI SOL005. It takes the unpackaged artifacts and checks if OSM descriptors exist among them. For each OSM descriptor it finds, it generates a OSM-compatible NS or VNF package and pushes all these packages to OSM. The endpoint of the OSM NBI is defined with the environment variable CATALOGUE_URL.

Internally the backend uses the osmclient module which has to be installed manually and is not part of the automated installation procedure of tng-sdk-package.

Installation

To upload packages we depend on osmclient which is by default installed together with OSM. However, we need it for Python 3, so we need to install it by hand.

Ubuntu

# install missing packages
sudo apt install python3-dev
sudo pip uninstall backports.ssl-match-hostname
sudo apt-get install python-backports.ssl-match-hostname
sudo apt-get install libcurl4-openssl-dev

# (may be incomplete)
pip install git+https://osm.etsi.org/gerrit/osm/osmclient

OS X

brew install libmagic
pip uninstall pycurl
export PYCURL_SSL_LIBRARY=openssl
export LDFLAGS=-L/usr/local/opt/openssl/lib;export CPPFLAGS=-I/usr/local/opt/openssl/include;pip install pycurl --compile --no-cache-dir

pip install git+https://osm.etsi.org/gerrit/osm/osmclient

Configuration

# environment to configure packager
export STORE_BACKEND=OsmNbiBackend
export CATALOGUE_URL=fgcn-osm1.cs.upb.de

# environment to configure osmclient
export OSM_HOSTNAME=fgcn-osm1.cs.upb.de
export OSM_SOL005=True

Start

# bare metal service
tng-pkg -s -v

# docker based service (use -e to pass ENV configs)
TODO

Example

# create package
tng-pkg -p demo-service-cdn/

# push package to packager, which pushes its artifacts to OSM
curl -X POST -v -H "Content-Type: multipart/form-data" \
    -F package="@de.upb.generated-project.0.1.tgo" \
    http://127.0.0.1:5099/api/v1/packages

Helper

vim-emu bare metal execution and attachment

# start emulator
sudo python vim-emu/examples/osm_default_daemon_topology_2_pop.py

# attach emulator as vim
osm vim-create --user username --password password --auth_url http://fgcn-osm1.cs.upb.de:6001/v2.0 --tenant tenantName --account_type openstack --name emu-vim1