From: garciadeblas Date: Thu, 14 Mar 2024 18:50:59 +0000 (+0100) Subject: Update openjdk version to 19 and yang2swagger version to 2.1.0 X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FIM.git;a=commitdiff_plain;h=HEAD;hp=a5c34c218a6941c7bb8b88e3e98374ed4302d203 Update openjdk version to 19 and yang2swagger version to 2.1.0 Change-Id: I16dc02009cc61f8452f3a0787b288d9c140c4ea8 Signed-off-by: garciadeblas --- diff --git a/Dockerfile b/Dockerfile index 90b7f94..01475b0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,20 +21,28 @@ # devops-stages/stage-build.sh # -FROM ubuntu:18.04 +FROM ubuntu:22.04 + +ARG APT_PROXY +RUN if [ ! -z $APT_PROXY ] ; then \ + echo "Acquire::http::Proxy \"$APT_PROXY\";" > /etc/apt/apt.conf.d/proxy.conf ;\ + echo "Acquire::https::Proxy \"$APT_PROXY\";" >> /etc/apt/apt.conf.d/proxy.conf ;\ + fi RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get -y install \ debhelper \ + dh-python \ git \ python3 \ python3-all \ python3-dev \ - python3-setuptools + python3-setuptools \ + python3-pip \ + tox -RUN python3 -m easy_install pip==21.0.1 -RUN pip3 install tox==3.22.0 +RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get -y install wget build-essential dh-make \ + openjdk-19-jdk maven +RUN update-java-alternatives --jre-headless --set /usr/lib/jvm/java-1.19.0-openjdk-amd64 -RUN DEBIAN_FRONTEND=noninteractive apt-get -y install wget build-essential dh-make \ - openjdk-8-jdk maven -RUN update-java-alternatives --set /usr/lib/jvm/java-1.8.0-openjdk-amd64 diff --git a/Jenkinsfile b/Jenkinsfile index 3e3af2e..7c37292 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,3 +1,20 @@ +/* Copyright ETSI OSM and others + * + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + properties([ parameters([ string(defaultValue: env.BRANCH_NAME, description: '', name: 'GERRIT_BRANCH'), @@ -16,7 +33,7 @@ def devops_checkout() { } } -node { +node("stage_2") { checkout scm devops_checkout() diff --git a/Makefile b/Makefile index e7e9978..683a624 100644 --- a/Makefile +++ b/Makefile @@ -16,11 +16,16 @@ # NOTE: pyang and pyangbind are required for build -.PHONY: all clean package trees deps yang-ietf openapi_schemas yang2swagger -JAVA:=/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java -PYANG:= pyang -PYBINDPLUGIN:=$(shell /usr/bin/env python3 -c \ - 'import pyangbind; import os; print("{}/plugin".format(os.path.dirname(pyangbind.__file__)))') +.PHONY: all clean package trees yang-ietf openapi_schemas yang2swagger +JAVA := /usr/lib/jvm/java-19-openjdk-amd64/bin/java +PYANG := pyang +ifeq ($(OS),Windows_NT) # is Windows_NT on XP, 2000, 7, Vista, 10... + PYTHON_INTERPRETER := python +else + PYTHON_INTERPRETER := python3 +endif +PYBINDPLUGIN := $(shell $(PYTHON_INTERPRETER) -c \ + 'import pyangbind; import os; print(os.path.join(f"{os.path.dirname(pyangbind.__file__)}", "plugin"))') YANG_DESC_MODELS := vnfd nsd nst nsi etsi-nfv-vnfd etsi-nfv-nsd YANG_RECORD_MODELS := vnfr nsr @@ -46,7 +51,7 @@ all: models trees openapi_schemas models: sol006_deps $(PYTHON_MODELS) rename_etsi_nfv_py -trees: $(YANG_DESC_TREES) $(YANG_DESC_JSTREES) $(YANG_RECORD_TREES) $(YANG_RECORD_JSTREES) +trees: $(YANG_DESC_TREES) $(YANG_DESC_JSTREES) openapi_schemas: $(OPENAPI_SCHEMAS) @@ -57,7 +62,7 @@ $(TREES_DIR): $(Q)echo generating $@ from $*.yang $(if $(findstring etsi,$@), $(eval DIR=$(SOL006_MODEL_DIR)),$(eval DIR=$(MODEL_DIR))) $(if $(findstring etsi,$@), $(eval AUGMENTS_DIR=$(SOL006_AUGMENTS_DIR)),$(eval AUGMENTS_DIR=)) - $(Q)pyang $(PYANG_OPTIONS) --path $(DIR) --plugindir $(PYBINDPLUGIN) -f pybind -o $(OUT_DIR)/$@ $(AUGMENTS_DIR) $(DIR)/$*.yang + $(Q)pyang $(PYANG_OPTIONS) --path $(DIR) --plugindir "$(PYBINDPLUGIN)" -f pybind -o $(OUT_DIR)/$@ $(AUGMENTS_DIR) $(DIR)/$*.yang %.tree.txt: $(TREES_DIR) yang-ietf $(Q)echo generating $@ from $*.yang @@ -89,7 +94,7 @@ $(TREES_DIR): osm.yaml: yang-ietf yang2swagger $(Q)echo generating $@ - $(Q)$(JAVA) -jar ${HOME}/.m2/repository/com/mrv/yangtools/swagger-generator-cli/1.1.14/swagger-generator-cli-1.1.14-executable.jar -yang-dir $(MODEL_DIR) -output $(OUT_DIR)/$@ + $(Q)$(JAVA) -jar ${HOME}/.m2/repository/com/mrv/yangtools/swagger-generator-cli/2.1.0/swagger-generator-cli-2.1.0-executable.jar -yang-dir $(MODEL_DIR) -output $(OUT_DIR)/$@ yang-ietf: $(Q)wget -q https://raw.githubusercontent.com/YangModels/yang/master/standard/ietf/RFC/ietf-yang-types%402013-07-15.yang -O $(MODEL_DIR)/ietf-yang-types.yang @@ -100,17 +105,13 @@ yang-ietf: yang2swagger: $(Q)mkdir -p ${HOME}/.m2 $(Q)wget -q -O ${HOME}/.m2/settings.xml https://raw.githubusercontent.com/opendaylight/odlparent/master/settings.xml - git clone https://github.com/bartoszm/yang2swagger.git - git -C yang2swagger checkout tags/1.1.14 - mvn -f yang2swagger/pom.xml clean install + $(Q)git clone https://github.com/bartoszm/yang2swagger.git + $(Q)git -C yang2swagger checkout tags/2.1.0 + $(Q)mvn -f yang2swagger/pom.xml clean install package: ./build-docs.sh -deps: - $(Q)mkdir -p ${HOME}/.m2 - $(Q)cp -n ${HOME}/.m2/settings.xml ${HOME}/.m2/settings.xml.orig ; wget -q -O - https://raw.githubusercontent.com/opendaylight/odlparent/master/settings.xml > ${HOME}/.m2/settings.xml - sol006_deps: $(Q)git clone --single-branch --branch v2.6.1 https://forge.etsi.org/rep/nfv/SOL006.git sol006_model $(Q)patch -p2 < patch/deref_warnings.patch @@ -122,5 +123,6 @@ rename_etsi_nfv_py: clean: $(Q)rm -rf dist sol006_model osm_im.egg-info deb deb_dist *.gz osm-imdocs* yang2swagger $(TREES_DIR) - $(Q)rm -rf debian/osm-imdocs.install osm_im/etsi_nfv_nsd.py osm_im/etsi_nfv_vnfd.py osm_im/nsd.py - $(Q)rm -rf osm_im/nsi.py osm_im/nst.py osm_im/osm.yaml osm_im/vnfd.py + $(Q)rm -rf debian/osm-imdocs.install + $(Q)rm -rf osm_im/etsi_nfv_nsd.py osm_im/etsi_nfv_vnfd.py + $(Q)rm -rf osm_im/nsd.py osm_im/nsi.py osm_im/nst.py osm_im/osm.yaml osm_im/vnfd.py diff --git a/build-docs.sh b/build-docs.sh index 6f21939..623e98f 100755 --- a/build-docs.sh +++ b/build-docs.sh @@ -1,6 +1,6 @@ #!/bin/bash # Copyright 2018 Sandvine -# All Rights Reserved. +# Copyright ETSI Contributors and Others. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain @@ -18,8 +18,8 @@ PKG_DIRECTORIES="osm_im_trees models" MDG_NAME=im PKG_NAME=osm-${MDG_NAME}docs DEB_INSTALL=debian/${PKG_NAME}.install -export DEBEMAIL="mmarchetti@sandvine.com" -export DEBFULLNAME="Michael Marchetti" +export DEBEMAIL="OSMSupport@etsi.org" +export DEBFULLNAME="ETSI OSM" PKG_VERSION=$(git describe --match "v*" --tags --abbrev=0) PKG_VERSION_FULL=$(git describe --match "v*" --tags --long) @@ -53,5 +53,5 @@ cp -R debian $PKG_DIR/. cd $PKG_DIR dh_make -y --indep --createorig --a -c apache sed -i -e "s/${PKG_VERSION_PREFIX}${POST_UPDATE}-1/$PKG_VERSION_PREFIX${POST_UPDATE}-${PKG_VERSION_FIELDS[2]}/g" debian/changelog -dpkg-buildpackage -uc -us -tc -rfakeroot +dpkg-buildpackage -uc -us -tc -rfakeroot cd - diff --git a/debian/control b/debian/control index 10fb75b..f06583a 100644 --- a/debian/control +++ b/debian/control @@ -1,12 +1,28 @@ +####################################################################################### +# Copyright ETSI Contributors and Others. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +####################################################################################### Source: osm-imdocs Section: devel Priority: optional Maintainer: Michael Marchetti -Build-Depends: debhelper (>=9) +Build-Depends: debhelper-compat (= 13) Standards-Version: 3.9.6 -Homepage: http://osm.etsi.org +Homepage: + Package: osm-imdocs -Architecture: all +Architecture: any Depends: ${misc:Depends} Description: osm-imdocs is the Information Model package for OSM, providing base classes derived from YANG models to be used by other modules. - diff --git a/devops-stages/stage-archive.sh b/devops-stages/stage-archive.sh index 98b44a3..84e1041 100755 --- a/devops-stages/stage-archive.sh +++ b/devops-stages/stage-archive.sh @@ -1,14 +1,25 @@ #!/bin/sh +####################################################################################### +# Copyright ETSI Contributors and Others. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +####################################################################################### MDG=IM - rm -rf pool rm -rf dists mkdir -p pool/$MDG -mv deb_dist/*.deb pool/$MDG/ -mv *.deb pool/$MDG/ -mv pyangbind/deb_dist/*.deb pool/$MDG/ -mv pyang/deb_dist/*.deb pool/$MDG/ - -mkdir -p dists/unstable/$MDG/binary-amd64/ -apt-ftparchive packages pool/$MDG > dists/unstable/$MDG/binary-amd64/Packages -gzip -9fk dists/unstable/$MDG/binary-amd64/Packages +# Move python3-osm-im deb package to pool/$MDG folder +mv deb_dist/python3-osm-im*.deb pool/$MDG/ +# Move osm-imdocs deb package to pool/$MDG folder +mv osm-imdocs*.deb pool/$MDG/ diff --git a/devops-stages/stage-build.sh b/devops-stages/stage-build.sh index e8b397b..6268698 100755 --- a/devops-stages/stage-build.sh +++ b/devops-stages/stage-build.sh @@ -15,4 +15,4 @@ rm -rf dist deb_dist osm*.tar.gz *.egg-info .eggs -tox -e dist +tox -e dist --recreate diff --git a/devops-stages/stage-test.sh b/devops-stages/stage-test.sh index 067d896..eee57ff 100755 --- a/devops-stages/stage-test.sh +++ b/devops-stages/stage-test.sh @@ -16,5 +16,6 @@ # License for the specific language governing permissions and limitations # under the License. -OUTPUT=$(TOX_PARALLEL_NO_SPINNER=1 tox --parallel=auto) -printf "$OUTPUT" +echo "Launching tox" +TOX_PARALLEL_NO_SPINNER=1 tox --parallel=auto + diff --git a/models/augments/additional-info.yang b/models/augments/additional-info.yang index 2119073..6b460c1 100644 --- a/models/augments/additional-info.yang +++ b/models/augments/additional-info.yang @@ -39,4 +39,8 @@ module additional-info { augment "/vnfd:vnfd/vnfd:virtual-storage-desc" { uses common:description; } + + augment "/vnfd:vnfd/vnfd:virtual-storage-desc/vnfd:vdu-storage-requirements" { + uses common:vdu-storage-requirements; + } } diff --git a/models/augments/common-augments.yang b/models/augments/common-augments.yang index 912199c..18481a9 100644 --- a/models/augments/common-augments.yang +++ b/models/augments/common-augments.yang @@ -20,6 +20,13 @@ module common-augments { namespace "urn:etsi:osm:yang:augments"; prefix "common"; + import etsi-nfv-vnfd { + prefix vnfd; + } + import etsi-nfv-nsd { + prefix nsd; + } + typedef parameter-data-type { type enumeration { enum STRING; @@ -102,10 +109,79 @@ module common-augments { } } - grouping vnfc-relations { + grouping relations-ee { + description + "Information about the execution environment and endpoint for a relation. + The execution environment can be associated to different objects: kdu, vdu, vnf, or ns. + To select the object, the profile-id of the object might be needed: + Reference to a kdu-level execution enviroment: + in the VNFd: the kdu-resource-profile-id is needed. + in the NSd: the kdu-resource-profile-id and vnf-profile-id are needed. + Reference to a vdu-level execution enviroment: + in the VNFd: the vdu-profile-id is needed. + in the NSd: the vdu-profile-id and vnf-profile-id are needed. + Reference to a vnf-level execution enviroment: + in the VNFd: nothing is needed, implicit. + in the NSd: the vnf-profile-id is needed. + Reference to an ns-level execution enviroment: + in the VNFd: cannot be done. + in the NSd: nothing is needed, implicit. + The reference to the execution environment is only mandatory if there is more than one execution environment + in the execution-environment-list of an object. + The endpoint is always needed"; + + leaf vdu-profile-id { + description + "If the execution environment is associated to a vdu object, + this parameter is the reference to the vdu-profile id."; + type leafref { + path "/vnfd:vnfd/vnfd:df/vnfd:vdu-profile/vnfd:id"; + } + } + + leaf kdu-resource-profile-id { + description + "If the execution environment is associated to a kdu resource object, + this parameter is the reference to the kdu-resource-profile id."; + type string; + } + + leaf vnf-profile-id { + description + "If the execution environment is associated to a vnf object, + this parameter is the reference to the vnf-profile id. + Only valid in the NSd. The value is implicit in a VNFd. + To reference an execution environment associated to a vnf object + from the VNFd, none of the profile ids need to be specified."; + type leafref { + path "/nsd:nsd/nsd:nsd/nsd:df/nsd:vnf-profile/nsd:id"; + } + } + leaf execution-environment-ref { + description + "Optional reference to the execution environment id. + Only needed if there is more than one execution environment + in the execution-environment-list of an object."; + type string; + default ""; + } + leaf endpoint { + description + "Endpoint name of the execution environment."; + type string; + } + } + + grouping relations { list relation { description - "List of relations between elements in this descriptor."; + "List of relations between elements in this descriptor. + The relations are used to integrate pairs of execution environments, + that are in charge of the configuration and lifecycle management + of VDUs, VNFs, KDUs, or NSs. + Each relation is formed by a provider and a requirer. + The provider is the execution environment that provides a particular service. + The requirer is the execution environment that requires the service provided by the provider"; key "name"; leaf name { @@ -114,10 +190,20 @@ module common-augments { type string; } - + container provider { + description + "Execution environment that offers an endpoint for a particular service"; + uses relations-ee; + } + container requirer { + description + "Execution environment that uses the service provided by the provider"; + uses relations-ee; + } list entities { description - "List of two elements to be related. + "DEPRECATION NOTICE: use provider and requirer instead. + List of two elements to be related. Elements to be related are identified by a pair (id, endpoint). The relation will relate (id1, endpoint1) to (id2, endpoint2)."; key "id"; @@ -136,6 +222,9 @@ module common-augments { type string; } } + must 'not(entities) or (not(provider) and not(requirer))' { + error-message 'Cannot set both "entities" and "provider/requirer" fields.'; + } } } @@ -259,7 +348,6 @@ module common-augments { description "Helm version to use for this helm-chart, v3 by default"; type enumeration { - enum "v2"; enum "v3"; } default "v3"; @@ -474,6 +562,7 @@ module common-augments { enum GT; // greater than enum LT; // less than enum EQ; // equal + enum NE; // not equal } } @@ -636,6 +725,34 @@ module common-augments { } } + grouping vdu-storage-requirements { + list vdu-storage-requirements { + description + "Array of key-value pairs that articulate the storage + deployment requirements. + + If the storage type is persistent-storage, the following setting + holds the persistent volume upon VM deletion: + key: keep-volume + value: true + + If storage volume can be attached to several VMs, the following setting + will allow it: + key: multiattach + value: true"; + + key "key"; + + leaf key { + type string; + } + + leaf value { + type string; + } + } + } + typedef scaling-trigger { type enumeration { enum pre-scale-in { diff --git a/models/augments/day1-2.yang b/models/augments/day1-2.yang index cf3b841..dda056c 100644 --- a/models/augments/day1-2.yang +++ b/models/augments/day1-2.yang @@ -33,11 +33,11 @@ module day1-2 { key "id"; leaf id { description - "Internal identifier for the VNF/VDU/KNF/KDU configuration"; + "Internal identifier for the VNF/VDU/KDU configuration"; type string; } uses common:vnfc-configuration; - uses common:vnfc-relations; + uses common:relations; uses common:vdu-config-access; leaf-list blacklist-config-primitive { diff --git a/models/augments/epa.yang b/models/augments/epa.yang index d47d6a9..af8b7cd 100644 --- a/models/augments/epa.yang +++ b/models/augments/epa.yang @@ -90,19 +90,15 @@ module epa { "CPU thread pinning policy describes how to place the guest CPUs when the host supports hyper threads: - AVOID : Avoids placing a guest on a host - with threads. - SEPARATE: Places vCPUs on separate cores, - and avoids placing two vCPUs on - two threads of same core. + REQUIRE : Each vCPU is allocated on thread siblings + of the same core. ISOLATE : Places each vCPU on a different core, and places no vCPUs from a different guest on the same core. PREFER : Attempts to place vCPUs on threads of the same core."; type enumeration { - enum AVOID; - enum SEPARATE; + enum REQUIRE; enum ISOLATE; enum PREFER; } diff --git a/models/augments/exporters.yang b/models/augments/exporters.yang new file mode 100644 index 0000000..13651db --- /dev/null +++ b/models/augments/exporters.yang @@ -0,0 +1,49 @@ +/* + Copyright 2020 Tata Elxsi + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +module exporters { + yang-version 1.1; + namespace "urn:etsi:osm:yang:augments:exporters"; + prefix "exporters"; + + import etsi-nfv-vnfd { + prefix vnfd; + } + + grouping extended-exporters-endpoints { + container exporters-endpoints { + leaf metric-path { + type string; + description "The path to scrape metric from VNF"; + } + leaf metric-port { + type uint16; + description "Port to scrape metric from VNF"; + } + leaf external-connection-point-ref { + type leafref { + path "/vnfd:vnfd/vnfd:ext-cpd/vnfd:id"; + } + description "Representing a leafref reference to the particular external connection point"; + } + } + } + + augment "/vnfd:vnfd/vnfd:df" { + uses extended-exporters-endpoints; + } +} diff --git a/models/augments/healing.yang b/models/augments/healing.yang new file mode 100644 index 0000000..854eb55 --- /dev/null +++ b/models/augments/healing.yang @@ -0,0 +1,123 @@ +/* + Copyright ETSI Contributors and Others + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +module healing { + yang-version 1.1; + namespace "urn:etsi:osm:yang:augments:healing"; + prefix "healing"; + + import etsi-nfv-vnfd { + prefix vnfd; + } + + typedef recovery-actions { + type enumeration { + + enum REDEPLOY_ONLY { + value 1; + } + + enum REBOOT { + value 2; + } + + enum REBOOT_THEN_REDEPLOY { + value 3; + } + } + } + + + typedef recovery-type { + type enumeration { + + enum manual { + value 1; + } + + enum automatic { + value 2; + } + } + } + + grouping extended-healing { + list healing-aspect { + key "id"; + + description + "The healing aspects supported by this DF of the VNF. + healingAspect shall be present if the VNF supports + healing."; + + leaf id { + type string; + description + "Unique identifier of this aspect in the VNFD."; + } + + list healing-policy { + + key "vdu-id"; + + leaf vdu-id { + description + "Identifier of vdu"; + type string; + } + + leaf event-name { + description + "Describing the event name for healing"; + type string; + } + + leaf recovery-type { + description + "Type of healing recovery"; + type recovery-type; + } + + leaf action-on-recovery { + description + "Recovery actions for healing"; + type recovery-actions; + } + + leaf cooldown-time { + description + "The duration after a healing action has been + triggered, for which there will be no further optional"; + type uint32; + mandatory true; + } + + leaf day1 { + description + "Specifies if the day1 operations can be applied"; + type boolean; + default false; + } + } + } + + } + augment "/vnfd:vnfd/vnfd:df" { + uses extended-healing; + } + +} diff --git a/models/augments/kdu.yang b/models/augments/kdu.yang index bd8b8fb..9dc512f 100644 --- a/models/augments/kdu.yang +++ b/models/augments/kdu.yang @@ -74,7 +74,6 @@ module kdu { description "Helm version to use for this helm-chart, v3 by default"; type enumeration { - enum v2; enum v3; } default v3; @@ -94,6 +93,28 @@ module kdu { } } } + + list service { + description + "List of Kubernetes services exposed by the KDU. + If empty, all services are assumed to be exposed in the CP associated to the first network + in k8s-cluster.nets."; + key name; + + leaf name { + description "Name of the Kubernetes service exposed by he KDU model"; + type string; + } + + leaf external-connection-point-ref { + description + "String representing a leaf reference to the particular external connection point. + This field should match /etsi-nfv-vnfd:vnfd/etsi-nfv-vnfd:ext-cpd/etsi-nfv-vnfd:id + "; + type string; + } + } + } container k8s-cluster { @@ -134,39 +155,6 @@ module kdu { } } } - - list service { - description - "List of Kubernetes services exposed by the KDU. - If empty, all services are assumed to be exposed in the CP associated to the first network - in k8s-cluster.nets."; - key name; - - leaf name { - description "Name of the Kubernetes service exposed by he KDU model"; - type string; - } - - leaf mgmt-service { - description - "Flag to indicate that this Kubernetes service is a mgmt service - to be used for KDU configuration. Defaults to false (if no present). - All services with mgmt-service set to true will be passed to the execution - environment in charge of the KDU configuration."; - type boolean; - default false; - } - - leaf external-connection-point-ref { - description - "String representing a leaf reference to the particular external connection point. - This field should match /etsi-nfv-vnfd:vnfd/etsi-nfv-vnfd:ext-cpd/etsi-nfv-vnfd:id - "; - type string; - } - - } - } augment "/vnfd:vnfd" { diff --git a/models/augments/ns-configuration.yang b/models/augments/ns-configuration.yang index a4effd2..89df261 100644 --- a/models/augments/ns-configuration.yang +++ b/models/augments/ns-configuration.yang @@ -34,7 +34,7 @@ module ns-configuration { "Information about NS configuration."; uses common:vnfc-configuration; - uses common:vnfc-relations; + uses common:relations; } } diff --git a/models/augments/ns-vld.yang b/models/augments/ns-vld.yang index b85acbf..ac3cc4c 100644 --- a/models/augments/ns-vld.yang +++ b/models/augments/ns-vld.yang @@ -102,9 +102,9 @@ module ns-vld { element"; } - leaf ip-address { + leaf-list ip-address { description - "IP address assigned to the internal connection point"; + "IP address list assigned to the internal connection point"; type inet:ip-address; } } diff --git a/models/augments/persistent-storage.yang b/models/augments/persistent-storage.yang new file mode 100644 index 0000000..ed27759 --- /dev/null +++ b/models/augments/persistent-storage.yang @@ -0,0 +1,41 @@ +/* + Copyright ETSI + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +module persistent-storage { + yang-version 1.1; + namespace "urn:etsi:osm:yang:augments:persistent-storage"; + prefix "persistent-storage"; + + import etsi-nfv-descriptors { + prefix descriptors; + } + + import etsi-nfv-vnfd { + prefix vnfd; + } + + identity persistent-storage { + base descriptors:storage-type; + description + "Persistent type of storage."; + } + + augment "/vnfd:vnfd/vnfd:virtual-storage-desc" { + when 'derived-from-or-self(vnfd:type-of-storage, "persistent-storage:persistent-storage")'; + } +} + diff --git a/models/augments/vnffgd.yang b/models/augments/vnffgd.yang new file mode 100644 index 0000000..3000b3b --- /dev/null +++ b/models/augments/vnffgd.yang @@ -0,0 +1,166 @@ +/* + # Copyright ETSI Contributors and Others. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ +module vnffgd { + yang-version 1.1; + namespace "urn:etsi:osm:yang:augments:vnffgd"; + prefix "vnffgd"; + + import etsi-nfv-nsd { + prefix nsd; + } + + import ietf-inet-types { + prefix inet; + } + + grouping match { + list match-attributes { + description + "List of match attributes."; + + key "id"; + leaf id { + description + "Identifier for the classifier match attribute rule."; + type string; + } + + leaf ip-proto { + description + "IP Protocol."; + type uint8; + } + + leaf source-ip-address { + description + "Source IP address."; + type inet:ip-address; + } + + leaf destination-ip-address { + description + "Destination IP address."; + type inet:ip-address; + } + + leaf source-port { + description + "Source port number."; + type inet:port-number; + } + + leaf destination-port { + description + "Destination port number."; + type inet:port-number; + } + + leaf constituent-base-element-id { + description + "Refer to the profile of source NS constituent."; + type leafref { + path "/nsd:nsd/nsd:nsd/nsd:df/nsd:vnf-profile/nsd:id"; + } + } + + leaf constituent-cpd-id { + description + "Logical source port."; + type string; + } + //TODO: Add more match criteria + } //match-attributes + + } + + grouping extended-position-element { + + leaf-list nfp-position-element-id { + type leafref { + path "../../../nfp-position-element/id"; + } + description + "References one or a pair of CPDs or SAPDs."; + reference + "GS NFV IFA014: Section 6.4.5.2 NfpPositionDesc + information element"; + } + } + + grouping extended-nfp-position { + list nfp-position-element { + key "id"; + leaf id { + type string; + description + "Identifier of this NfpPositionElemen information + element. It uniquely identifies an + NfpPositionElement."; + reference + "GS NFV IFA014: Section 6.4.6.2 NfpPositionElement + information element"; + } + } + + } + + grouping extended-cpe { + leaf constituent-base-element-id { + type leafref { + path "/nsd:nsd/nsd:nsd/nsd:vnffgd/nsd:vnf-profile-id"; + } + } + + leaf order { + type uint8; + description + "A number that denotes the order of a VNF in a chain"; + } + + leaf ingress-constituent-cpd-id { + description + "A reference to a connection point name + in a vnfd."; + + type string; + } + + leaf egress-constituent-cpd-id { + description + "A reference to a connection point name + in a vnfd."; + + type string; + } + } + + augment "/nsd:nsd/nsd:nsd/nsd:vnffgd/nsd:nfpd/nsd:position-desc-id" { + uses match; + } + + augment "/nsd:nsd/nsd:nsd/nsd:vnffgd" { + uses extended-nfp-position; + } + + augment "/nsd:nsd/nsd:nsd/nsd:vnffgd/nsd:nfpd/nsd:position-desc-id" { + uses extended-position-element; + } + + augment "/nsd:nsd/nsd:nsd/nsd:vnffgd/nsd:nfpd/nsd:position-desc-id/nsd:cp-profile-id/nsd:constituent-profile-elements"{ + uses extended-cpe; + } +} diff --git a/models/yang/mano-types.yang b/models/yang/mano-types.yang index eb38ec2..d1cbb86 100644 --- a/models/yang/mano-types.yang +++ b/models/yang/mano-types.yang @@ -383,7 +383,6 @@ module mano-types description "Helm version to use for this helm-chart, v3 by default"; type enumeration { - enum v2; enum v3; } default v3; @@ -1937,6 +1936,7 @@ module mano-types enum GT; // greater than enum LT; // less than enum EQ; // equal + enum NE; // not equal } } diff --git a/models/yang/vnfd-base.yang b/models/yang/vnfd-base.yang index 28a4961..e38bac9 100644 --- a/models/yang/vnfd-base.yang +++ b/models/yang/vnfd-base.yang @@ -676,7 +676,6 @@ module vnfd-base description "Helm version to use for this helm-chart, v3 by default"; type enumeration { - enum v2; enum v3; } default v3; diff --git a/osm_im/im_translation.py b/osm_im/im_translation.py index 466026c..8abf942 100644 --- a/osm_im/im_translation.py +++ b/osm_im/im_translation.py @@ -269,6 +269,8 @@ def _add_im_vdus_to_sol006_vnfd(im_vnfd, sol006_vnfd): vdu_descriptor["name"] = vdu["name"] if vdu.get("cloud-init-file"): vdu_descriptor["cloud-init-file"] = vdu["cloud-init-file"] + if vdu.get("cloud-init"): + vdu_descriptor["cloud-init"] = vdu["cloud-init"] if vdu.get("supplemental-boot-data"): vdu_descriptor["supplemental-boot-data"] = vdu["supplemental-boot-data"] if vdu.get("alarm"): diff --git a/requirements-dist.in b/requirements-dist.in index 11f0a2a..28d0ce1 100644 --- a/requirements-dist.in +++ b/requirements-dist.in @@ -14,4 +14,6 @@ # limitations under the License. stdeb -setuptools-version-command \ No newline at end of file +setuptools-version-command +setuptools<60 +pyang diff --git a/requirements-dist.txt b/requirements-dist.txt index 7393626..05bfb57 100644 --- a/requirements-dist.txt +++ b/requirements-dist.txt @@ -1,10 +1,3 @@ -setuptools-version-command==2.2 - # via -r requirements-dist.in -stdeb==0.10.0 - # via -r requirements-dist.in - -# The following packages are considered to be unsafe in a requirements file: -# setuptools ####################################################################################### # Copyright ETSI Contributors and Others. # @@ -21,3 +14,17 @@ stdeb==0.10.0 # See the License for the specific language governing permissions and # limitations under the License. ####################################################################################### +lxml==4.9.3 + # via pyang +pyang==2.5.3 + # via -r requirements-dist.in +setuptools-version-command==99.9 + # via -r requirements-dist.in +stdeb==0.10.0 + # via -r requirements-dist.in + +# The following packages are considered to be unsafe in a requirements file: +setuptools==59.8.0 + # via + # -r requirements-dist.in + # setuptools-version-command diff --git a/requirements-test.txt b/requirements-test.txt index decfef2..77ae576 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,11 +1,3 @@ -coverage==5.5 - # via - # -r requirements-test.in - # nose2 -nose2==0.10.0 - # via -r requirements-test.in -six==1.15.0 - # via nose2 ####################################################################################### # Copyright ETSI Contributors and Others. # @@ -22,3 +14,7 @@ six==1.15.0 # See the License for the specific language governing permissions and # limitations under the License. ####################################################################################### +coverage==7.3.1 + # via -r requirements-test.in +nose2==0.13.0 + # via -r requirements-test.in diff --git a/requirements.in b/requirements.in index 24f4c58..128194b 100644 --- a/requirements.in +++ b/requirements.in @@ -15,4 +15,4 @@ pyang pyangbind -pyyaml \ No newline at end of file +pyyaml>6 \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 002200e..da4aa3a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,23 +1,3 @@ -bitarray==1.8.1 - # via pyangbind -enum34==1.1.10 - # via pyangbind -lxml==4.6.3 - # via - # pyang - # pyangbind -pyang==2.4.0 - # via - # -r requirements.in - # pyangbind -pyangbind==0.8.1 - # via -r requirements.in -pyyaml==5.4.1 - # via -r requirements.in -regex==2021.3.17 - # via pyangbind -six==1.15.0 - # via pyangbind ####################################################################################### # Copyright ETSI Contributors and Others. # @@ -34,3 +14,21 @@ six==1.15.0 # See the License for the specific language governing permissions and # limitations under the License. ####################################################################################### +enum34==1.1.10 + # via pyangbind +lxml==4.9.3 + # via + # pyang + # pyangbind +pyang==2.5.3 + # via + # -r requirements.in + # pyangbind +pyangbind==0.8.3.post1 + # via -r requirements.in +pyyaml==6.0.1 + # via -r requirements.in +regex==2023.8.8 + # via pyangbind +six==1.16.0 + # via pyangbind diff --git a/setup.py b/setup.py index ec75988..4cd2be2 100644 --- a/setup.py +++ b/setup.py @@ -30,8 +30,8 @@ class Install_osm_im(install): subprocess.call([sys.executable, "-m", "pip", "install", package]) def run(self): - self.pipinstall('pyang') - self.pipinstall('pyangbind') + self.pipinstall('pyang==2.5.3') + self.pipinstall('pyangbind==0.8.3.post1') import pyangbind print("Using dir {}/{} for python artifacts".format(os.getcwd(), self.im_dir)) path = "{}/{}".format(os.getcwd(), self.im_dir) diff --git a/tests/examples/cirros_heal_vnfd_sol006.yaml b/tests/examples/cirros_heal_vnfd_sol006.yaml new file mode 100644 index 0000000..c32691c --- /dev/null +++ b/tests/examples/cirros_heal_vnfd_sol006.yaml @@ -0,0 +1,80 @@ +# Copyright ETSI Contributors and Others +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +vnfd: + id: cirros_heal_vnfd + product-name: cirros_heal_vnf + description: Simple heal VNF example with a cirros + provider: OSM + version: "1.0" + mgmt-cp: eth0-ext + + virtual-compute-desc: + - id: cirros_heal_vnfd-VM-compute + virtual-cpu: + num-virtual-cpu: 1 + virtual-memory: + size: 0.25 # Memory size in GB + + virtual-storage-desc: + - id: cirros_heal_vnfd-VM-storage + size-of-storage: 2 + + sw-image-desc: + - id: cirros034 + name: cirros034 + image: cirros034 + + vdu: + - id: cirros_heal_vnfd-VM + name: cirros_heal_vnfd-VM + description: cirros_heal_vnfd-VM + virtual-compute-desc: cirros_heal_vnfd-VM-compute + virtual-storage-desc: + - cirros_heal_vnfd-VM-storage + sw-image-desc: cirros034 + int-cpd: + - id: eth0-int + virtual-network-interface-requirement: + - name: eth0 + virtual-interface: + type: VIRTIO + bandwidth: "0" + vpci: 0000:00:0a.0 + + df: + - id: default-df + vdu-profile: + - id: cirros_heal_vnfd-VM + min-number-of-instances: 1 + instantiation-level: + - id: default-instantiation-level + vdu-level: + - vdu-id: cirros_heal_vnfd-VM + number-of-instances: 1 + healing-aspect: + - id: cirros_heal_vnfd-VM_autoheal + healing-policy: + - vdu-id: cirros_heal_vnfd-VM + event-name: heal-alarm + recovery-type: automatic + action-on-recovery: REDEPLOY_ONLY + cooldown-time: 180 + day1: false + ext-cpd: + - id: eth0-ext + int-cpd: # Connection to int-cpd + vdu-id: cirros_heal_vnfd-VM + cpd: eth0-int diff --git a/tests/examples/dest_vnfd.yaml b/tests/examples/dest_vnfd.yaml new file mode 100644 index 0000000..4ee94e9 --- /dev/null +++ b/tests/examples/dest_vnfd.yaml @@ -0,0 +1,79 @@ +# Copyright ETSI Contributors and Others +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +vnfd: + description: Destination vnf descriptor + df: + - id: default-df + instantiation-level: + - id: default-instantiation-level + vdu-level: + - number-of-instances: 1 + vdu-id: dest_vnf-VM + vdu-profile: + - id: dest_vnf-VM + min-number-of-instances: 1 + ext-cpd: + - id: eth0-ext + int-cpd: + cpd: eth0-int + vdu-id: dest_vnf-VM + id: dest_vnf + mgmt-cp: eth0-ext + product-name: dest_vnf + provider: OSM + sw-image-desc: + - id: bionic + image: bionic + name: bionic + - id: ubuntu20.04-aws + name: ubuntu20.04-aws + image: ubuntu/images/hvm-ssd/ubuntu-artful-17.10-amd64-server-20180509 + vim-type: aws + - id: ubuntu20.04-azure + name: ubuntu20.04-azure + image: Canonical:0001-com-ubuntu-server-focal:20_04-lts:latest + vim-type: azure + vdu: + - id: dest_vnf-VM + cloud-init-file: cloud-config + description: dest_vnf-VM + int-cpd: + - id: eth0-int + virtual-network-interface-requirement: + - name: eth0 + virtual-interface: + bandwidth: 0 + type: VIRTIO + vpci: 0000:00:0a.0 + name: dest_vnf-VM + sw-image-desc: bionic + alternative-sw-image-desc: + - ubuntu20.04-aws + - ubuntu20.04-azure + virtual-compute-desc: dest_vnf-VM-compute + virtual-storage-desc: + - dest_vnf-VM-storage + version: '1.0' + software-version: 1.2 + virtual-compute-desc: + - id: dest_vnf-VM-compute + virtual-cpu: + num-virtual-cpu: 1 + virtual-memory: + size: 2 + virtual-storage-desc: + - id: dest_vnf-VM-storage + size-of-storage: 10 diff --git a/tests/examples/mid_vnfd.yaml b/tests/examples/mid_vnfd.yaml new file mode 100644 index 0000000..f1ddf8c --- /dev/null +++ b/tests/examples/mid_vnfd.yaml @@ -0,0 +1,79 @@ +# Copyright ETSI Contributors and Others +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +vnfd: + description: SFC Middle VNF descriptor + df: + - id: default-df + instantiation-level: + - id: default-instantiation-level + vdu-level: + - number-of-instances: 1 + vdu-id: mid_vnf-VM + vdu-profile: + - id: mid_vnf-VM + min-number-of-instances: 1 + ext-cpd: + - id: eth0-ext + int-cpd: + cpd: eth0-int + vdu-id: mid_vnf-VM + id: mid_vnf + mgmt-cp: eth0-ext + product-name: mid_vnf + provider: OSM + sw-image-desc: + - id: bionic + image: bionic + name: bionic + - id: ubuntu20.04-aws + name: ubuntu20.04-aws + image: ubuntu/images/hvm-ssd/ubuntu-artful-17.10-amd64-server-20180509 + vim-type: aws + - id: ubuntu20.04-azure + name: ubuntu20.04-azure + image: Canonical:0001-com-ubuntu-server-focal:20_04-lts:latest + vim-type: azure + vdu: + - id: mid_vnf-VM + cloud-init-file: cloud-config + description: mid_vnf-VM + int-cpd: + - id: eth0-int + virtual-network-interface-requirement: + - name: eth0 + virtual-interface: + bandwidth: 0 + type: VIRTIO + vpci: 0000:00:0a.0 + name: mid_vnf-VM + sw-image-desc: bionic + alternative-sw-image-desc: + - ubuntu20.04-aws + - ubuntu20.04-azure + virtual-compute-desc: mid_vnf-VM-compute + virtual-storage-desc: + - mid_vnf-VM-storage + version: '1.0' + software-version: 1.2 + virtual-compute-desc: + - id: mid_vnf-VM-compute + virtual-cpu: + num-virtual-cpu: 1 + virtual-memory: + size: 2 + virtual-storage-desc: + - id: mid_vnf-VM-storage + size-of-storage: 10 diff --git a/tests/examples/sfc_nsd.yaml b/tests/examples/sfc_nsd.yaml new file mode 100644 index 0000000..746d87f --- /dev/null +++ b/tests/examples/sfc_nsd.yaml @@ -0,0 +1,86 @@ +# Copyright ETSI Contributors and Others +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +nsd: + nsd: + - description: sfc_nsd Network Service + designer: TATA ELXSI + df: + - id: default-df + vnf-profile: + - id: vnf1 + vnfd-id: src_vnf + virtual-link-connectivity: + - constituent-cpd-id: + - constituent-base-element-id: vnf1 + constituent-cpd-id: eth0-ext + ip-address: 20.20.20.10 + virtual-link-profile-id: private + - id: vnf2 + vnfd-id: mid_vnf + virtual-link-connectivity: + - constituent-cpd-id: + - constituent-base-element-id: vnf2 + constituent-cpd-id: eth0-ext + ip-address: 20.20.20.20 + virtual-link-profile-id: private + - id: vnf3 + vnfd-id: dest_vnf + virtual-link-connectivity: + - constituent-cpd-id: + - constituent-base-element-id: vnf3 + constituent-cpd-id: eth0-ext + ip-address: 20.20.20.30 + virtual-link-profile-id: private + vnffgd: + - id: vnffg1 + vnf-profile-id: + - vnf2 + nfp-position-element: + - id: test + nfpd: + - id: forwardingpath1 + position-desc-id: + - id: position1 + nfp-position-element-id: + - test + match-attributes: + - id: rule1_80 + ip-proto: 6 + source-ip-address: 20.20.20.10 + destination-ip-address: 20.20.20.30 + source-port: 0 + destination-port: 80 + constituent-base-element-id: vnf1 + constituent-cpd-id: eth0-ext + cp-profile-id: + - id: cpprofile2 + constituent-profile-elements: + - id: cp1 + order: 0 + constituent-base-element-id: vnf2 + ingress-constituent-cpd-id: eth0-ext + egress-constituent-cpd-id: eth0-ext + id: sfc_nsd + name: sfc_nsd + version: '1.0' + virtual-link-desc: + - id: private + mgmt-network: 'true' + vim-network-name: private + vnfd-id: + - src_vnf + - mid_vnf + - dest_vnf diff --git a/tests/examples/src_vnfd.yaml b/tests/examples/src_vnfd.yaml new file mode 100644 index 0000000..33ca97a --- /dev/null +++ b/tests/examples/src_vnfd.yaml @@ -0,0 +1,80 @@ +# Copyright ETSI Contributors and Others +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +vnfd: + description: Source vnf descriptor + df: + - id: default-df + instantiation-level: + - id: default-instantiation-level + vdu-level: + - number-of-instances: 1 + vdu-id: src_vnf-VM + vdu-profile: + - id: src_vnf-VM + min-number-of-instances: 1 + ext-cpd: + - id: eth0-ext + int-cpd: + cpd: eth0-int + vdu-id: src_vnf-VM + id: src_vnf + mgmt-cp: eth0-ext + product-name: src_vnf + provider: OSM + sw-image-desc: + - id: bionic + image: bionic + name: bionic + - id: ubuntu20.04-aws + name: ubuntu20.04-aws + image: ubuntu/images/hvm-ssd/ubuntu-artful-17.10-amd64-server-20180509 + vim-type: aws + - id: ubuntu20.04-azure + name: ubuntu20.04-azure + image: Canonical:0001-com-ubuntu-server-focal:20_04-lts:latest + vim-type: azure + vdu: + - id: src_vnf-VM + cloud-init-file: cloud-config + description: src_vnf-VM + id: src_vnf-VM + int-cpd: + - id: eth0-int + virtual-network-interface-requirement: + - name: eth0 + virtual-interface: + bandwidth: 0 + type: VIRTIO + vpci: 0000:00:0a.0 + name: src_vnf_vnfd-VM + sw-image-desc: bionic + alternative-sw-image-desc: + - ubuntu20.04-aws + - ubuntu20.04-azure + virtual-compute-desc: src_vnf-VM-compute + virtual-storage-desc: + - src_vnf-VM-storage + version: '1.0' + software-version: 1.2 + virtual-compute-desc: + - id: src_vnf-VM-compute + virtual-cpu: + num-virtual-cpu: 1 + virtual-memory: + size: 2 + virtual-storage-desc: + - id: src_vnf-VM-storage + size-of-storage: 10 diff --git a/tox.ini b/tox.ini index 54128a0..1109b9c 100644 --- a/tox.ini +++ b/tox.ini @@ -23,12 +23,13 @@ toxworkdir = /tmp/.tox [testenv] usedevelop = True -basepython = python3 +basepython = python3.10 setenv = VIRTUAL_ENV={envdir} PYTHONDONTWRITEBYTECODE = 1 passenv = HOME deps = -r{toxinidir}/requirements.txt skip_install = true +parallel_show_output = true ####################################################################################### @@ -50,7 +51,7 @@ commands = coverage report --omit='*tests*' coverage html -d ./cover --omit='*tests*' coverage xml -o coverage.xml --omit=*tests* -whitelist_externals = sh +allowlist_externals = sh ####################################################################################### @@ -76,13 +77,18 @@ commands = ####################################################################################### [testenv:pip-compile] -deps = pip-tools==5.5.0 +deps = pip-tools==6.13.0 +skip_install = true +allowlist_externals = bash + [ commands = - - sh -c 'for file in requirements*.in ; do pip-compile -rU --no-header $file ;\ - out=`echo $file | sed "s/.in/.txt/"` ; \ - head -16 tox.ini >> $out ;\ - done' -whitelist_externals = sh + - bash -c "for file in requirements*.in ; do \ + UNSAFE="" ; \ + if [[ $file =~ 'dist' ]] ; then UNSAFE='--allow-unsafe' ; fi ; \ + pip-compile --resolver=backtracking -rU --no-header $UNSAFE $file ;\ + out=`echo $file | sed 's/.in/.txt/'` ; \ + sed -i -e '1 e head -16 tox.ini' $out ;\ + done" ####################################################################################### @@ -99,7 +105,7 @@ commands = python3 setup.py --command-packages=stdeb.command sdist_dsc sh -c 'cd deb_dist/osm-im*/ && dpkg-buildpackage -rfakeroot -uc -us' sh -c 'rm osm_im/requirements.txt' -whitelist_externals = sh +allowlist_externals = sh ####################################################################################### [flake8]