From c2761c8bc55e90c772d4113edb11b734324e58ea Mon Sep 17 00:00:00 2001 From: Dario Faccin Date: Wed, 24 May 2023 16:55:30 +0200 Subject: [PATCH] Update from master Squashed commit of the following: commit e01365213b22d5c26d3b750d3a0f12d1f3b57b86 Author: k4.rahul Date: Wed Apr 19 17:04:06 2023 +0530 Feature 10945: Service KPI of VNF using exporter endpoint This change has to be merged with this LCM change https://osm.etsi.org/gerrit/#/c/osm/LCM/+/13236/ Change-Id: Id1851a4f3dceddefc6c50d8f8d5335c64e01da99 Signed-off-by: k4.rahul commit 215c0ca1d541a7ee7da0b6452615f6bd48ccbdef Author: elumalai Date: Tue Apr 25 16:12:06 2023 +0530 Feature 10979: Static IPv6 Dual Stack Assignment Added support to modify ip-address type from leaf to leaf-list Change-Id: I5b4d4d662802a6816f7879362de42bf3bd99f17e Signed-off-by: elumalai commit beff3a1d931816e07c2bef2e02964951892ba472 Author: garciadeblas Date: Wed May 10 17:41:51 2023 +0200 Update IM requirements Change-Id: I7cb28c3262a4d52f2565a8656b52c39cb759222e Signed-off-by: garciadeblas commit 9a62007a1e370259856cf85422321f43a3bda55b Author: garciadeblas Date: Tue Apr 25 01:14:45 2023 +0200 Support of Python 3.10 Adds a patch to pyangbind to continue to work with updated packages Change-Id: I0b33375ddbb96734ae72669baaef744bf2152bb1 Signed-off-by: garciadeblas Signed-off-by: Mark Beierl commit b6023a8098d5e98dd5aa2fc7fd9e123406fb6561 Author: garciadeblas Date: Tue Apr 25 09:27:34 2023 +0200 Fix stage-test.sh to properly enable it Change-Id: Id1746db909a3aed9f90badf66f77c70307c11987 Signed-off-by: garciadeblas commit a91e2254326f90c082106fa9f27b3e08f06ec288 Author: garciadeblas Date: Tue Apr 18 16:04:20 2023 +0200 Clean stage-archive.sh and use allowlist_extenals in tox.ini Change-Id: I3a09df53487b8dd3c30bed8036647633dfe010d6 Signed-off-by: garciadeblas commit 72ef227544b795ad947b81e690f7149fbd184c6e Author: Gulsum Atici Date: Sun Jan 22 23:56:58 2023 +0300 Arranging the description of vcpu thread policy according to current Cloud API. Change-Id: I7ca500e85d1f8e3e480bebce2f8d6b997e8a0e38 Signed-off-by: Gulsum Atici Change-Id: I4acf8ae284f3f0d6c48e734a40cb688e6fcb0135 Signed-off-by: Dario Faccin --- Dockerfile | 14 +++++----- devops-stages/stage-archive.sh | 24 +++++++++++------ devops-stages/stage-build.sh | 2 +- devops-stages/stage-test.sh | 5 ++-- models/augments/exporters.yang | 49 ++++++++++++++++++++++++++++++++++ models/augments/ns-vld.yang | 4 +-- pyangbind.patch | 46 +++++++++++++++++++++++++++++++ requirements-test.txt | 4 +-- requirements.txt | 4 +-- tox.ini | 15 ++++++----- 10 files changed, 138 insertions(+), 29 deletions(-) create mode 100644 models/augments/exporters.yang create mode 100644 pyangbind.patch diff --git a/Dockerfile b/Dockerfile index 3ca4992..9623f7f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,7 +21,7 @@ # devops-stages/stage-build.sh # -FROM ubuntu:20.04 +FROM ubuntu:22.04 ARG APT_PROXY RUN if [ ! -z $APT_PROXY ] ; then \ @@ -34,13 +34,15 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ debhelper \ dh-python \ git \ - python3.8 \ + python3 \ python3-all \ - python3.8-dev \ - python3-setuptools + python3-dev \ + python3-setuptools \ + python3-pip \ + tox -RUN python3 -m easy_install pip==21.3.1 -RUN pip install tox==3.24.5 +ENV LC_ALL C.UTF-8 +ENV LANG C.UTF-8 RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get -y install wget build-essential dh-make \ diff --git a/devops-stages/stage-archive.sh b/devops-stages/stage-archive.sh index 98b44a3..2e7a6fd 100755 --- a/devops-stages/stage-archive.sh +++ b/devops-stages/stage-archive.sh @@ -1,14 +1,22 @@ #!/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 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/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/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/pyangbind.patch b/pyangbind.patch new file mode 100644 index 0000000..3077299 --- /dev/null +++ b/pyangbind.patch @@ -0,0 +1,46 @@ +####################################################################################### +# 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. +####################################################################################### + +*** .tox/cover/lib/python3.10/site-packages/pyangbind/lib/yangtypes.py 2023-05-10 06:50:57.876027148 -0400 +--- .tox/cover/lib/python3.10/site-packages/pyangbind/lib/yangtypes.py 2023-05-10 06:51:11.772022417 -0400 +*************** limitations under the License. +*** 22,27 **** +--- 22,28 ---- + from __future__ import unicode_literals + + import collections ++ from six.moves import collections_abc + import copy + import uuid + from decimal import Decimal +*************** def TypedListType(*args, **kwargs): +*** 372,378 **** + if not isinstance(allowed_type, list): + allowed_type = [allowed_type] + +! class TypedList(collections.MutableSequence): + _pybind_generated_by = "TypedListType" + _list = list() + +--- 373,379 ---- + if not isinstance(allowed_type, list): + allowed_type = [allowed_type] + +! class TypedList(collections_abc.MutableSequence): + _pybind_generated_by = "TypedListType" + _list = list() + diff --git a/requirements-test.txt b/requirements-test.txt index 464774a..6006e33 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. ####################################################################################### -coverage==7.1.0 +coverage==7.2.5 # via -r requirements-test.in -nose2==0.12.0 +nose2==0.13.0 # via -r requirements-test.in diff --git a/requirements.txt b/requirements.txt index 99695f7..fb24668 100644 --- a/requirements.txt +++ b/requirements.txt @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. ####################################################################################### -bitarray==2.6.2 +bitarray==2.7.3 # via pyangbind enum34==1.1.10 # via pyangbind @@ -30,7 +30,7 @@ pyangbind==0.8.1 # via -r requirements.in pyyaml==5.4.1 # via -r requirements.in -regex==2022.10.31 +regex==2023.5.5 # via pyangbind six==1.16.0 # via pyangbind diff --git a/tox.ini b/tox.ini index 4a2494a..d6ce5d5 100644 --- a/tox.ini +++ b/tox.ini @@ -23,12 +23,13 @@ toxworkdir = /tmp/.tox [testenv] usedevelop = True -basepython = python3.8 +basepython = python3.10 setenv = VIRTUAL_ENV={envdir} PYTHONDONTWRITEBYTECODE = 1 passenv = HOME deps = -r{toxinidir}/requirements.txt skip_install = true +parallel_show_output = true ####################################################################################### @@ -42,6 +43,7 @@ skip_install = false deps = {[testenv]deps} -r{toxinidir}/requirements-test.txt commands = + sh -c "patch {toxworkdir}/cover/lib/python3.10/site-packages/pyangbind/lib/yangtypes.py < pyangbind.patch" sh -c 'make clean' sh -c 'make models Q=""' sh -c 'rm -f nosetests.xml' @@ -50,7 +52,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,15 +78,15 @@ commands = ####################################################################################### [testenv:pip-compile] -deps = pip-tools==6.6.2 +deps = pip-tools==6.13.0 skip_install = true -whitelist_externals = bash +allowlist_externals = bash [ commands = - bash -c "for file in requirements*.in ; do \ UNSAFE="" ; \ if [[ $file =~ 'dist' ]] ; then UNSAFE='--allow-unsafe' ; fi ; \ - pip-compile -rU --no-header $UNSAFE $file ;\ + 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" @@ -98,13 +100,14 @@ deps = {[testenv]deps} # In the commands, we copy the requirements.txt to be presented as a source file (.py) # so it gets included in the .deb package for others to consume commands = + sh -c "patch {toxworkdir}/dist/lib/python3.10/site-packages/pyangbind/lib/yangtypes.py < pyangbind.patch" sh -c 'make clean' sh -c 'make Q=""' sh -c 'cp requirements.txt osm_im/requirements.txt' 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] -- 2.25.1