This repository contains the tng-sdk-package
component that is part of the European H2020 project 5GTANGO NFV SDK. This component is responsible to create and unpack 5GTANGO service, VNF, and test packages. The seed code of this component is based on the son-cli
toolbox that was developed as part of the European H2020 project SONATA.
To simplify the creation and extraction of 5GTANGO packages, we develop this packager tool as part of 5GTANGO's SDK. This tool is a complete rewrite of the SONATA packaging tool. The reason for this rewrite is that the 5GANGO packaging tool does not only support and simplifies the package creation but can also be used to unpack packages. For this, the packaging tool can be deployed as a micro service and used, e.g., by the service platform to unpack packages. The clear benefit of this design, compared to the SONATA design in which we used different tools for this, is that only one common codebase needs to be maintained that deals with packages. Thus, code changes, which may be a result of a change in the package format, need only be done in a single component of 5GTANGO. The architecture and design of the packaging tools is described in 5GTANGO D4.1 First open-source release of the SDK toolset in more detail.
Besides this README file, more documentation is available in the wiki belonging to this repository. Additional information are available in the project's deliverables:
This component is implemented in Python3. Its requirements are specified here.
The automated installation requires pip
(more specifically pip3
).
$ pip install git+https://github.com/sonata-nfv/tng-sdk-package
$ git clone git@github.com:sonata-nfv/tng-sdk-package.git
$ cd tng-sdk-package
$ python setup.py install
It is a good practice to first create a new virtual environment in which all 5GTANGO SDK tools can be installed. You can do this as follows:
# get the path to your Python3 installation
which python3
# create a new virtualenv
virtualenv -p <path/to/python3> venv
# activate the virtualenv
source venv/bin/activate
The packager can either be used as command line tool (CLI mode) or deployed as a micro service which offers a REST API.
Runs the packager locally from the command line. Details about all possible parameters can be shown using:
tng-pkg -h
# package a 5GTANGO SDK project
tng-pkg -p misc/5gtango_ns_project_example1
# unpack a 5GTANGO package to a local 5GTANGO SDK project
tng-pkg -u misc/5gtango-ns-package-example.tgo
Runs the packager as a micro service that exposes a REST API.
Note:
Currently only unpackaging is supported in this mode.
tng-pkg -s
# build Docker container
pipeline/build/build.sh
# run Docker container
docker run --rm -d -p 5099:5099 --name tng-sdk-package registry.sonata-nfv.eu:5000/tng-sdk-package
# terminal 1 (run tng-sdk-package service)
tng-pkg -s
# terminal 2 (client that sends a package to be unpacked using REST API)
curl -X POST -v -H "Content-Type: multipart/form-data" \
-F package="@misc/5gtango-ns-package-example.tgo" \
http://127.0.0.1:5099/api/v1/packages
# get status of all known packageing processes
curl -X GET http://127.0.0.1:5099/api/v1/packages/status
To contribute to the development of this 5GTANGO component, you may use the very same development workflow as for any other 5GTANGO Github project. That is, you have to fork the repository and create pull requests.
$ python setup.py develop
All pull requests are automatically tested by Jenkins and will only be accepted if no test is broken.
You can also run the test manually on your local machine. To do so, you need to do:
$ pytest -v
$ ./pipeline_local.sh
This 5GTANGO component is published under Apache 2.0 license. Please see the LICENSE file for more details.
The following lead developers are responsible for this repository and have admin rights. They can, for example, merge pull requests.
- Manuel Peuster (@mpeuster)
- Stefan Schneider (@StefanUPB)
- Please use the GitHub issues to report bugs.