-
Notifications
You must be signed in to change notification settings - Fork 9
Automated Subfolder Compression
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
.