Skip to content
Snippets Groups Projects
user avatar
limon authored
Signed-off-by: default avatarlimon <alimonj@indra.es>
f2d2cc9e
Name Last commit Last update
charm-packages
cirros_alarm_ns
cirros_alarm_vnf
epa_1vm_passthrough_ns
epa_1vm_passthrough_vnf
epa_1vm_sriov_ns
epa_1vm_sriov_vnf
epa_2vm_sriov_ns
epa_2vm_sriov_vnf
epa_quota_ns
epa_quota_vnf
hackfest_basic_metrics_ns
hackfest_basic_metrics_vnf
hackfest_basic_ns
hackfest_basic_sriov_ns
hackfest_basic_sriov_vnf
hackfest_basic_vnf
hackfest_cloudinit_ns
hackfest_cloudinit_vnf
hackfest_epasriov_ns
hackfest_epasriov_vnf
hackfest_firewall_pnf
hackfest_firewall_pnf_ns
hackfest_k8sproxycharm_ns
hackfest_k8sproxycharm_vnf
hackfest_multivdu_ns
hackfest_multivdu_vnf
hackfest_proxycharm_ns
hackfest_proxycharm_vnf
hackfest_simple_k8s_ns
hackfest_simple_k8s_vnf
hackfest_virtual-pc_ns
hackfest_virtual-pc_vnfd
hackfest_vyos_ns
hackfest_vyos_vnf
ipprofile_2vm_ns
ipprofile_2vm_vnf
k8s_juju_ns
k8s_jujucontroller_vnf
k8s_jujumachine_vnf
magma
nscharm_ns
nscharm_policy_vnf
nscharm_user_vnf
openldap_knf
openldap_ns
several_volumes_ns
several_volumes_vnf
simple_2vm_ns
simple_2vm_vnf
simple_ee_ns
simple_ee_vnf
simple_nopasswd_ns
simple_nopasswd_vnf
slice_basic_middle_ns
slice_basic_middle_vnf
slice_basic_ns
slice_basic_nst
slice_basic_vnf
snmp_ee_ns
snmp_ee_vnf
snmp_setcomm_ee_ns
snmp_setcomm_ee_vnf
squid_metrics_cnf
squid_metrics_cnf_ns
ubuntu_4ifaces_ns
ubuntu_4ifaces_vnf
ubuntu_cloudinit_ns
ubuntu_cloudinit_vnf
vdu_replicas_ns
vdu_replicas_vnf
wiki_webserver_autoscale_nsd
wiki_webserver_autoscale_vnfd
.gitignore
.gitlab-ci.yml
.gitmodules
LICENSE
README.md
config.yaml
generate-packages.sh
squid_cnf.zip

README

Cloning the repo

You need to clone the repo with the option "--recursive" to fetch all the dependent git modules:

# Clone with SSH
git clone --recursive ssh://git@osm.etsi.org:29419/vnf-onboarding/osm-packages.git
# Clone with HTTPS
git clone --recursive https://osm.etsi.org/gitlab/vnf-onboarding/osm-packages.git

Structure of the repo

This repo contains OSM packages used for testing and for the hackfest.

There is typically a folder for each VNF under test and NS to run the test, for instance:

  • hackfest_basic_vnf: the VNF package to run the hackfest basic test
  • hackfest_basic_ns: the NS package to run the hackfest basic test

Please use the following conventions:

  • VNF folders should end with "_vnf"
  • NS folders should end with "_ns"

Charm sources must be stored in the folder of the package, in charms/layers folder. If relations are in place, the charm interfaces must be stored in charms/interfaces folder.

Thanks to the new way for building and generating packages, charms sources can be placed directly in the package folder, under charms/layers/ folder, thus simplifying the structure. When building the package, the charm will be built and only the binaries will be placed in the tar.gz file.

Working with packages

Osmclient has been improved so that all utilities required to validate and build the packages have been added. Now the single osm command line client is able to do everything you need to work with VNF and NS packages.

Uploading a package from a folder

This is by far the simplest way of working. The following command will validate the package, build the charm from source if it exists under PKGFOLDER/charms/layers, build the tar.gz, and onboard/upload it to OSM.

osm nfpkg-create PKGFOLDER

For NS packages, the same applies.

osm nspkg-create PKGFOLDER

Full help for both commands is show below:

$ osm nfpkg-create --help
Usage: osm nfpkg-create [OPTIONS] FILENAME

  onboards a new NFpkg (alias of nfpkg-create)

  FILENAME: NF Package tar.gz file, NF Descriptor YAML file or NF Package folder
            If FILENAME is a file (NF Package tar.gz or NF Descriptor YAML), it is onboarded.
            If FILENAME is an NF Package folder, it is built and then onboarded.

Options:
  --overwrite TEXT     Deprecated. Use override
  --override TEXT      overrides fields in descriptor, format: "key1.key2...=value[;key3...=value;...]"
  --skip-charm-build   The charm will not be compiled, it is assumed to already exist
  --override-epa       adds guest-epa parameters to all VDU
  --override-nonepa    removes all guest-epa parameters from all VDU
  --override-paravirt  overrides all VDU interfaces to PARAVIRT
  -h, --help           Show this message and exit.
$ osm nspkg-create --help
Usage: osm nspkg-create [OPTIONS] FILENAME

  onboards a new NSpkg

  FILENAME: NF Package tar.gz file, NF Descriptor YAML file or NF Package folder
            If FILENAME is a file (NF Package tar.gz or NF Descriptor YAML), it is onboarded.
            If FILENAME is an NF Package folder, it is built and then onboarded.

Options:
  --overwrite TEXT    Deprecated. Use override
  --override TEXT     overrides fields in descriptor, format: "key1.key2...=value[;key3...=value;...]"
  --skip-charm-build  The charm will not be compiled, it is assumed to already exist
  -h, --help          Show this message and exit.

Validating a descriptor

The following command will look for all the descriptor files in a folder and validate them

osm package-validate PKGFOLDER

Some relevant options are shown below:

$ osm package-validate --help
Usage: osm package-validate [OPTIONS] [BASE_DIRECTORY]

  Validate descriptors given a base directory.

  BASE_DIRECTORY: Stub folder for NS, VNF or NST package.

Options:
  --recursive / --no-recursive  The activated recursive option will validate the yaml files within the indicated directory and in its subdirectories
  -h, --help                    Show this message and exit.

Building a package

The following command will validate and build the tar.gz file. It will als

osm package-build PKGFOLDER

Some relevant options are shown below:

$ osm package-build --help
Usage: osm package-build [OPTIONS] PACKAGE_FOLDER

  Build the package NS, VNF given the package_folder.

  PACKAGE_FOLDER: Folder of the NS, VNF or NST to be packaged

Options:
  --skip-validation   skip package validation
  --skip-charm-build  the charm will not be compiled, it is assumed to already exist
  -h, --help          Show this message and exit.

Creating a package structure

The best way to work is by copying a previous one that is up-to-date. But you can also create a first skeleton using this command:

Usage: osm package-create [OPTIONS] PACKAGE_TYPE PACKAGE_NAME

  Creates an OSM NS, VNF, NST package

  PACKAGE_TYPE: Package to be created: NS, VNF or NST.
  PACKAGE_NAME: Name of the package to create the folder with the content.

Options:
  --base-directory TEXT       (NS/VNF/NST) Set the location for package creation. Default: "."
  --image TEXT                (VNF) Set the name of the vdu image. Default "image-name"
  --vdus INTEGER              (VNF) Set the number of vdus in a VNF. Default 1
  --vcpu INTEGER              (VNF) Set the number of virtual CPUs in a vdu. Default 1
  --memory INTEGER            (VNF) Set the memory size (MB) of the vdu. Default 1024
  --storage INTEGER           (VNF) Set the disk size (GB) of the vdu. Default 10
  --interfaces INTEGER        (VNF) Set the number of additional interfaces apart from the management interface. Default 0
  --vendor TEXT               (NS/VNF) Set the descriptor vendor. Default "OSM"
  --override                  (NS/VNF/NST) Flag for overriding the package if exists.
  --detailed                  (NS/VNF/NST) Flag for generating descriptor .yaml with all possible commented options
  --netslice-subnets INTEGER  (NST) Number of netslice subnets. Default 1
  --netslice-vlds INTEGER     (NST) Number of netslice vlds. Default 1
  -h, --help                  Show this message and exit.