# 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
+/* 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'),
}
}
-node {
+node("stage_2") {
checkout scm
devops_checkout()
# 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
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)
$(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
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
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
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
#!/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
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)
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 -
+#######################################################################################
+# 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 <mmarchetti@sandvine.com>
-Build-Depends: debhelper (>=9)
+Build-Depends: debhelper-compat (= 13)
Standards-Version: 3.9.6
-Homepage: http://osm.etsi.org
+Homepage: <http://osm.etsi.org>
+
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.
-
#!/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/
rm -rf dist deb_dist osm*.tar.gz *.egg-info .eggs
-tox -e dist
+tox -e dist --recreate
# 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
+
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;
+ }
}
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;
}
}
- 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 {
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";
type string;
}
}
+ must 'not(entities) or (not(provider) and not(requirer))' {
+ error-message 'Cannot set both "entities" and "provider/requirer" fields.';
+ }
}
}
description
"Helm version to use for this helm-chart, v3 by default";
type enumeration {
- enum "v2";
enum "v3";
}
default "v3";
enum GT; // greater than
enum LT; // less than
enum EQ; // equal
+ enum NE; // not equal
}
}
}
}
+ 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 {
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 {
"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;
}
--- /dev/null
+/*
+ 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;
+ }
+}
--- /dev/null
+/*
+ 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;
+ }
+
+}
description
"Helm version to use for this helm-chart, v3 by default";
type enumeration {
- enum v2;
enum v3;
}
default v3;
}
}
}
+
+ 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 {
}
}
}
-
- 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" {
"Information about NS configuration.";
uses common:vnfc-configuration;
- uses common:vnfc-relations;
+ uses common:relations;
}
}
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;
}
}
--- /dev/null
+/*
+ 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")';
+ }
+}
+
--- /dev/null
+/*
+ # 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;
+ }
+}
description
"Helm version to use for this helm-chart, v3 by default";
type enumeration {
- enum v2;
enum v3;
}
default v3;
enum GT; // greater than
enum LT; // less than
enum EQ; // equal
+ enum NE; // not equal
}
}
description
"Helm version to use for this helm-chart, v3 by default";
type enumeration {
- enum v2;
enum v3;
}
default v3;
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"):
# limitations under the License.
stdeb
-setuptools-version-command
\ No newline at end of file
+setuptools-version-command
+setuptools<60
+pyang
-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.
#
# 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
-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.
#
# 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
pyang
pyangbind
-pyyaml
\ No newline at end of file
+pyyaml>6
\ No newline at end of file
-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.
#
# 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
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)
--- /dev/null
+# 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
--- /dev/null
+# 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
--- /dev/null
+# 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
--- /dev/null
+# 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
--- /dev/null
+# 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
[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
#######################################################################################
coverage report --omit='*tests*'
coverage html -d ./cover --omit='*tests*'
coverage xml -o coverage.xml --omit=*tests*
-whitelist_externals = sh
+allowlist_externals = sh
#######################################################################################
#######################################################################################
[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"
#######################################################################################
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]