sonata-nfv / tng-sdk-package Goto Github PK
View Code? Open in Web Editor NEWThe 5GTANGO SDK tool to create and unpack 5GTANGO packages.
Home Page: http://www.5gtango.eu
License: Apache License 2.0
The 5GTANGO SDK tool to create and unpack 5GTANGO packages.
Home Page: http://www.5gtango.eu
License: Apache License 2.0
#Example:
tng-package -h
usage: tng-package [-h] [-p PACKAGE] [-u UNPACKAGE] [--format FORMAT] [-v]
[-s] [--address SERVICE_PORT] [--port SERVICE_PORT]
5GTANGO SDK packager
optional arguments:
-h, --help show this help message and exit
-p PACKAGE, --package PACKAGE
Create package from given project.
-u UNPACKAGE, --unpackage UNPACKAGE
Unpackage given package.
--format FORMAT Package format [5GTANGO|OSM]. Default: 5GTANGO
-v, --verbose Output debug messages.
-s, --service Run packager in service mode with REST API.
--address SERVICE_PORT
Listen address of REST API when in service mode.
Default: 0.0.0.0
--port SERVICE_PORT TCP port of REST API when in service mode. Default:
5099
File gets huge. Split it into multiple files. Move helper functions to packager.__init__.py
Have different modules for different package types etc.
packager.tango.py
packager.osm.py
Maybe: packager.commons.py
etc.
Skips the validation against online schemas (e.g. NAPD.yaml).
Skips resolving of online resources.
If someone want's to unpackage a package without checking it's checksums he/she should be able to do it.
https://git.cs.upb.de/5gtango/UserStories/issues/291
endpoint: /api/v1/ping
Will allow us to stop early if artifacts vendor.name.version
are there already.
curl -H "Content-type:application/json" http://pre-int-sp-ath.5gtango.eu:4011/api/v2/packages?name=asdas&vendor=asdasd&version=0.1
Not idempotent.
tng-pkg -p misc/5gtango_ns_project_example1/
tng-pkg -u eu.5gtango.5gtango-project-sample.0.1.tgo
tng-pkg -p eu.5gtango.5gtango-project-sample.0.1
tng-pkg -u eu.5gtango.5gtango-project-sample.0.1.tgo
tng-pkg -p eu.5gtango.5gtango-project-sample.0.1
tng-pkg -u eu.5gtango.5gtango-project-sample.0.1.tgo
tree eu.5gtango.5gtango-project-sample.0.1
Do not output packaging infos on stdout. Helps if called from another tool.
Two fold:
If other packages, we might think about an automated recursive unpackaging procedure.
You can get the information in the wiki:
https://git.cs.upb.de/5gtango/deliverables/wikis/repository-that-contains-the-api-documentation
on unpackaging:
Required feature for UPB's planned NFVSDN demo.
Flow:
give transaction UUID as response since the unpackaing should be async
This one is required for tng-sdk-profile
: sonata-nfv/tng-sdk-benchmark#6
The output format should be a TANGO project folder that can be packaged again.
We should implement this as a new storage backend: TangoProjectFileSystemBackend
Inputs: destination folder
Unpackaging of example packages from tng-schema
repo and upload to tng-cat
.
End-to-end test across:
tng-schema
tng-sdk-package
tng-cat
Start implementing this test once #14 is closed.
I know we're all still building this, but I needed one already... :-)
give infos about the unpackaging status
_build_catalog_metadata
)
(400) File with {name => upb_logo.png, uuid => 2dd10810-d608-45cb-8712-4491df20fbca} not found in the Catalogue
skip_store=True
in test_unit_rest.py, re-enable!)Skip all other files in the first prototype.
ENV variable naming:
CATALOGUE_URL: http://tng-cat:4011/catalogues/api/v2
If validator is installed, use it.
tng-pkg -p misc/5gtango_ns_project_example1/
tng-pkg -p misc/5gtango_ns_project_example1_bad/
tng-pkg -u misc/5gtango-ns-package-example.tgo -o /tmp
tng-pkg -u misc/5gtango-ns-package-example-bad.tgo -o /tmp
Implement/wrap in validation.py
No temp. names when uploading the package files to tng-cat.
Lets annotate our package descriptors uploaded to the catalogue so that we do not need the mapping endpoint anymore.
Makes the design mich clearer. (We annotate UUIDs to the files anyhow. )
Automatically increase version numbers of a project when a new package is created. Makes use much more convenient (we noticed this during SONATA pilot integration).
However, feature is optional and can be disabledif needed e.g. --autoversion
(remove the old --no-autoversion
flag)
Attention: Versions come as strings "0.1" or floats 0.1 both needs to work.
We add/increment the third part of the version field.
Examples:
0.1 -> "0.1.1"
"0.1.1" -> "0.1.2" etc.
Unify data models of POST endpoint and status endpoint.
POST should also return the following structure
{
"error_msg": null,
"package_process_uuid": "e6eec600-2990-470a-87c0-dbd3d0dd11f4",
"status": "success"
}
Goal of this issue is to capture the developments needed to enable basic package creation using the 5GTANGO SDK.
Scenario: A NS/VNF/test developer has created a local project using the tng-sdk-project
tool and has added files/descriptors to it:
tng-workspace
tng-project -p test_project1
Now she wants to use tng-sdk-package
to package this project:
# minimal
tng-pkg -p misc/5gtango_ns_project_example1
# w. more options
tng-pkg -p 5gtango_ns_project_example1 \
--workspace path/to/workspace \
--format eu.5gtango
--output my_package.tgo
The resulting package can be uploaded to the SP/V&V.
Steps to be performed by the packager:
project.yml
or project.yaml
in path given by -p
project.yaml
project.yml
Definitions
(TOSCA)--output
or vender.name.version
.tgo in PWD
Automatically create packages from using the integrated 5GTANGO SDK GUI: sonata-nfv/tng-sdk-descriptorgen#45
If you do: tng-pkg -p project -o ../some/folder/
you will hit an error (21)!
The tool should notice that -o
points to a directory (and not a full file name) and use the automated name generation, combined with the dir given in -o
.
TOSCA and ETSI packages have no MIME types in their descriptors. We should have a module that tries to guess them based on file ending or descriptor content.
This will improve compatibility to legacy package formats.
TangoPackager
and EtsiPackager
IMPORTANT
implement specific unittests for 5GTANGO packager (use example package)We might create independent issues for these.
_etsi_to_napd_package_content
)We skip label
and reference
support in v0.
See ETSI:
ONAP uses ETSI SOL004 aligned CSAR packages (a ZIP file with *.csar as ending).
We want to be able to create also native OSM packages from an 5GTANGO SDK project.
OSM packages are a bit different, e.g., there are single packages for NSD, and every single VNFD. Packages are simple tar.gz files.
tng-pkg -p myproject --format osm
Documentation:
Examples:
Testing:
OSM release 5.0 instance at: http://fgcn-osm1.cs.upb.de/
2019-06-03:
see PkgSepc.
JSON can then easily opened with Swagger UI.
Users that do not want install the tng-sdk-package can still view the API specs.
Start packager in service mode: Running in a Docker container, offering a REST API
ETSI is about to release SOL007 at the end of 2018:
The first version always uses a fixed name for the ETSI manifest when a package is created.
This is still aligned to the ETSI spec but requires Entry-Manifest: etsi_manifest.mf
to be present in the TOSCA.meta (which is the case in the current implementation)
We can improve this by also dynamically naming the *.mf like the main descriptor to be even more aligned.
This is not super important.
POST to /project
Input: ZIP file with project structure/files
Processing: Extract ZIP to local FS (temp), run packaging process on it.
Return: Link to *.tgo file for download.
Document: Endpoint documentation using Swagger and Wiki
2019-05-13:
Also have a GET /project
that lists all created packages (JSON list with package names, uuids, links)
Have a tng-pkg
alias for tng-sdk-package
Having the UUIDs of the uploaded artifacts in the package descriptor (NAPD) will make re-use in the rest of the system much easier, as discussed with @jbonnet
TODO in tng-sdk-package code
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.