sonata-nfv / tng-sdk-package

The 5GTANGO SDK tool to create and unpack 5GTANGO packages.
http://www.5gtango.eu
Apache License 2.0
7 stars 9 forks source link

Automated compression of arbitrary subfolders #179

Closed mpeuster closed 5 years ago

mpeuster commented 5 years ago

Problem: Some VNFs have folders with hundrets of small files, e.g., OSM charms. No way to put all of them into the project.yml and even if we can do this, it would mean hundreds of interactions with tng-cat. That won't scale!

Solution: Zip those folders and include a single Zip file into the package. This allows seamless integration into the existing tng-cat infrastructure etc. The component that then downloads this Zip file needs to unpack it.

Implementation:

We use a defined MIME type application/vnd.folder.compressed.zip to indicate such folders.

# project.yml
source: '/my/ugly/folder'
type: 'application/vnd.folder.compressed.zip'

If the packager sees this upon packaging, it will must automatically compress this folder and change put the path to the ZIP into the NAPD.yml (package descriptor)

# NAPD.yml
source: '/my/ugly/folder.zip'  # note the .zip
type: 'application/vnd.folder.compressed.zip'

This feature is a kind of "preprocessing" happening before packaging. It should be optional and can be disabled with --no-subfolder-compression.