From abb1ad98e2e36dbe1a2f5c39de0e6f5861370e37 Mon Sep 17 00:00:00 2001 From: gifrerenom Date: Wed, 1 Feb 2023 15:10:01 +0000 Subject: [PATCH 1/4] Common: - Removed unused ORM - Removed old tutorial folder - Commented out unfinished unitary tests --- src/common/orm/Database.py | 52 -- src/common/orm/Exceptions.py | 19 - src/common/orm/Factory.py | 46 -- src/common/orm/HighLevel.py | 84 --- src/common/orm/__init__.py | 14 - src/common/orm/backend/BackendEnum.py | 22 - src/common/orm/backend/Tools.py | 19 - src/common/orm/backend/_Backend.py | 67 -- src/common/orm/backend/__init__.py | 14 - .../orm/backend/inmemory/InMemoryBackend.py | 161 ----- src/common/orm/backend/inmemory/Tools.py | 45 -- src/common/orm/backend/inmemory/__init__.py | 14 - src/common/orm/backend/redis/Mutex.py | 136 ---- src/common/orm/backend/redis/RedisBackend.py | 131 ---- src/common/orm/backend/redis/__init__.py | 14 - src/common/orm/fields/BooleanField.py | 31 - src/common/orm/fields/EnumeratedField.py | 38 - src/common/orm/fields/Field.py | 63 -- src/common/orm/fields/FloatField.py | 34 - src/common/orm/fields/ForeignKeyField.py | 34 - src/common/orm/fields/IntegerField.py | 34 - src/common/orm/fields/PrimaryKeyField.py | 29 - src/common/orm/fields/StringField.py | 39 -- src/common/orm/fields/__init__.py | 22 - src/common/orm/model/Model.py | 308 -------- src/common/orm/model/Tools.py | 31 - src/common/orm/model/__init__.py | 14 - src/common/orm/tests/__init__.py | 14 - src/common/orm/tests/test_unitary.py | 656 ------------------ .../connector/tests/PrepareTestScenario.py | 190 ++--- src/dlt/connector/tests/test_unitary.py | 81 +-- tutorial/1-0-deployment.md | 14 - tutorial/1-1-1-create-vm-oracle-virtualbox.md | 94 --- tutorial/1-1-2-create-vm-vmware-fusion.md | 54 -- tutorial/1-1-create-vm.md | 17 - tutorial/1-2-install-microk8s.md | 165 ----- tutorial/1-3-deploy-tfs.md | 84 --- tutorial/1-4-access-webui.md | 26 - tutorial/1-5-deploy-logs-troubleshooting.md | 35 - tutorial/2-0-run-experiments.md | 19 - tutorial/2-1-python-environment.md | 131 ---- tutorial/2-2-ofc22.md | 200 ------ tutorial/2-3-oeccpsc22.md | 8 - tutorial/2-4-ecoc22.md | 132 ---- tutorial/2-5-nfvsdn22.md | 1 - tutorial/3-0-development.md | 18 - tutorial/3-1-configure-vscode.md | 98 --- tutorial/3-2-develop-new-component.md | 132 ---- tutorial/3-3-debug-comp.md | 55 -- tutorial/3-4-develop-cth.md | 50 -- tutorial/README.md | 45 -- 51 files changed, 136 insertions(+), 3698 deletions(-) delete mode 100644 src/common/orm/Database.py delete mode 100644 src/common/orm/Exceptions.py delete mode 100644 src/common/orm/Factory.py delete mode 100644 src/common/orm/HighLevel.py delete mode 100644 src/common/orm/__init__.py delete mode 100644 src/common/orm/backend/BackendEnum.py delete mode 100644 src/common/orm/backend/Tools.py delete mode 100644 src/common/orm/backend/_Backend.py delete mode 100644 src/common/orm/backend/__init__.py delete mode 100644 src/common/orm/backend/inmemory/InMemoryBackend.py delete mode 100644 src/common/orm/backend/inmemory/Tools.py delete mode 100644 src/common/orm/backend/inmemory/__init__.py delete mode 100644 src/common/orm/backend/redis/Mutex.py delete mode 100644 src/common/orm/backend/redis/RedisBackend.py delete mode 100644 src/common/orm/backend/redis/__init__.py delete mode 100644 src/common/orm/fields/BooleanField.py delete mode 100644 src/common/orm/fields/EnumeratedField.py delete mode 100644 src/common/orm/fields/Field.py delete mode 100644 src/common/orm/fields/FloatField.py delete mode 100644 src/common/orm/fields/ForeignKeyField.py delete mode 100644 src/common/orm/fields/IntegerField.py delete mode 100644 src/common/orm/fields/PrimaryKeyField.py delete mode 100644 src/common/orm/fields/StringField.py delete mode 100644 src/common/orm/fields/__init__.py delete mode 100644 src/common/orm/model/Model.py delete mode 100644 src/common/orm/model/Tools.py delete mode 100644 src/common/orm/model/__init__.py delete mode 100644 src/common/orm/tests/__init__.py delete mode 100644 src/common/orm/tests/test_unitary.py delete mode 100644 tutorial/1-0-deployment.md delete mode 100644 tutorial/1-1-1-create-vm-oracle-virtualbox.md delete mode 100644 tutorial/1-1-2-create-vm-vmware-fusion.md delete mode 100644 tutorial/1-1-create-vm.md delete mode 100644 tutorial/1-2-install-microk8s.md delete mode 100644 tutorial/1-3-deploy-tfs.md delete mode 100644 tutorial/1-4-access-webui.md delete mode 100644 tutorial/1-5-deploy-logs-troubleshooting.md delete mode 100644 tutorial/2-0-run-experiments.md delete mode 100644 tutorial/2-1-python-environment.md delete mode 100644 tutorial/2-2-ofc22.md delete mode 100644 tutorial/2-3-oeccpsc22.md delete mode 100644 tutorial/2-4-ecoc22.md delete mode 100644 tutorial/2-5-nfvsdn22.md delete mode 100644 tutorial/3-0-development.md delete mode 100644 tutorial/3-1-configure-vscode.md delete mode 100644 tutorial/3-2-develop-new-component.md delete mode 100644 tutorial/3-3-debug-comp.md delete mode 100644 tutorial/3-4-develop-cth.md delete mode 100644 tutorial/README.md diff --git a/src/common/orm/Database.py b/src/common/orm/Database.py deleted file mode 100644 index e5ec7b0a9..000000000 --- a/src/common/orm/Database.py +++ /dev/null @@ -1,52 +0,0 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) -# -# 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. - -import logging -from typing import List, Set, Tuple -from .backend._Backend import _Backend - -LOGGER = logging.getLogger(__name__) - -class Database: - def __init__(self, backend : _Backend): - if not isinstance(backend, _Backend): - str_class_path = '{}.{}'.format(_Backend.__module__, _Backend.__name__) - raise AttributeError('backend must inherit from {}'.format(str_class_path)) - self._backend = backend - - @property - def backend(self) -> _Backend: return self._backend - - def clear_all(self, keep_keys : Set[str] = set()) -> None: - for key in self._backend.keys(): - if key in keep_keys: continue - self._backend.delete(key) - - def dump(self) -> List[Tuple[str, str, str]]: - entries = self._backend.dump() - entries.sort() - _entries = [] - for str_key, str_type, value in entries: - if isinstance(value, list): - str_value = ', '.join(map("'{:s}'".format, sorted(list(value)))) - str_value = '[' + str_value + ']' - elif isinstance(value, set): - str_value = ', '.join(map("'{:s}'".format, sorted(list(value)))) - str_value = '{' + str_value + '}' - elif isinstance(value, dict): - sorted_keys = sorted(value.keys()) - str_value = ', '.join(["'{}': '{}'".format(key, value[key]) for key in sorted_keys]) - str_value = '{' + str_value + '}' - _entries.append((str_type, str_key, str_value)) - return _entries diff --git a/src/common/orm/Exceptions.py b/src/common/orm/Exceptions.py deleted file mode 100644 index cf91bd2f7..000000000 --- a/src/common/orm/Exceptions.py +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) -# -# 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. - -class ConstraintException(Exception): - pass - -class MutexException(Exception): - pass diff --git a/src/common/orm/Factory.py b/src/common/orm/Factory.py deleted file mode 100644 index 15940ce7c..000000000 --- a/src/common/orm/Factory.py +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) -# -# 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. - -import logging, os -from typing import Optional, Union -from .backend._Backend import _Backend -from .backend.BackendEnum import BackendEnum -from .backend.inmemory.InMemoryBackend import InMemoryBackend -from .backend.redis.RedisBackend import RedisBackend - -LOGGER = logging.getLogger(__name__) - -BACKENDS = { - BackendEnum.INMEMORY.value: InMemoryBackend, - BackendEnum.REDIS.value: RedisBackend, - #BackendEnum.MONGODB.value: MongoDBBackend, - #BackendEnum.RETHINKDB.value: RethinkDBBackend, - #BackendEnum.ETCD.value: EtcdBackend, -} - -DEFAULT_DB_BACKEND = BackendEnum.INMEMORY - -def get_database_backend(backend : Optional[Union[str, BackendEnum]] = None, **settings) -> _Backend: - # return an instance of Database initialized with selected backend. - # The backend is selected using following criteria (first that is not None is selected): - # 1. user selected by parameter (backend=...) - # 2. environment variable DB_BACKEND - # 3. default backend: INMEMORY - if backend is None: backend = os.environ.get('DB_BACKEND', DEFAULT_DB_BACKEND) - if backend is None: raise Exception('Database Backend not specified') - if isinstance(backend, BackendEnum): backend = backend.value - backend_class = BACKENDS.get(backend) - if backend_class is None: raise Exception('Unsupported DatabaseBackend({:s})'.format(backend)) - LOGGER.info('Selected Database Backend: {:s}'.format(backend)) - return backend_class(**settings) diff --git a/src/common/orm/HighLevel.py b/src/common/orm/HighLevel.py deleted file mode 100644 index 3a4b0d661..000000000 --- a/src/common/orm/HighLevel.py +++ /dev/null @@ -1,84 +0,0 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) -# -# 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. - -from typing import Any, Dict, List, Optional, Set, Tuple -from common.method_wrappers.ServiceExceptions import NotFoundException -from common.orm.Database import Database -from common.orm.backend.Tools import key_to_str -from common.orm.fields.ForeignKeyField import ForeignKeyField -from common.orm.model.Model import Model, MetaModel - -def get_all_objects(database : Database, model_class : MetaModel) -> List[Model]: - db_pks = sorted(list(model_class.get_primary_keys(database))) - return [model_class(database, db_pk) for db_pk in db_pks] - -def get_object( - database : Database, model_class : Model, key_parts : List[str], raise_if_not_found : bool = True - ) -> Optional[Model]: - - str_key = key_to_str(key_parts) - db_object = model_class(database, str_key, auto_load=False) - found = db_object.load() - if found: return db_object - if raise_if_not_found: raise NotFoundException(model_class.__name__.replace('Model', ''), str_key) - return None - -def get_related_objects( - source_instance : Model, reference_model_class : MetaModel, navigation_field_name : str = None) -> Set[Model]: - - database = source_instance.database - db_target_instances = set() - - if navigation_field_name is not None: - navigation_fk_field : Optional[ForeignKeyField] = getattr(reference_model_class, navigation_field_name, None) - if navigation_fk_field is None or not isinstance(navigation_fk_field, ForeignKeyField): - msg = 'navigation_field_name({:s}) must be a ForeignKeyField in reference_model_class({:s})' - raise AttributeError(msg.format(navigation_field_name, reference_model_class.__name__)) - target_model_class = navigation_fk_field.foreign_model - - for db_reference_pk,_ in source_instance.references(reference_model_class): - db_reference = reference_model_class(database, db_reference_pk) - if navigation_field_name is not None: - target_fk_field = getattr(db_reference, navigation_field_name, None) - if target_fk_field is None: continue - db_reference = target_model_class(database, target_fk_field) - db_target_instances.add(db_reference) - return db_target_instances - -def update_or_create_object( - database : Database, model_class : Model, key_parts : List[str], attributes : Dict[str, Any] - ) -> Tuple[Model, bool]: - - str_key = key_to_str(key_parts) - db_object : Model = model_class(database, str_key, auto_load=False) - found = db_object.load() - for attr_name, attr_value in attributes.items(): - setattr(db_object, attr_name, attr_value) - db_object.save() - updated = found # updated if found, else created - return db_object, updated - -def get_or_create_object( - database : Database, model_class : Model, key_parts : List[str], defaults : Dict[str, Any] = {} - ) -> Tuple[Model, bool]: - - str_key = key_to_str(key_parts) - db_object : Model = model_class(database, str_key, auto_load=False) - found = db_object.load() - if not found: - for attr_name, attr_value in defaults.items(): - setattr(db_object, attr_name, attr_value) - db_object.save() - created = not found # created if not found, else loaded - return db_object, created diff --git a/src/common/orm/__init__.py b/src/common/orm/__init__.py deleted file mode 100644 index 70a332512..000000000 --- a/src/common/orm/__init__.py +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) -# -# 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. - diff --git a/src/common/orm/backend/BackendEnum.py b/src/common/orm/backend/BackendEnum.py deleted file mode 100644 index 0297ca7be..000000000 --- a/src/common/orm/backend/BackendEnum.py +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) -# -# 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. - -from enum import Enum - -class BackendEnum(Enum): - INMEMORY = 'inmemory' - REDIS = 'redis' - #MONGODB = 'mongodb' - #RETHINKDB = 'rethinkdb' - #ETCD = 'etcd' diff --git a/src/common/orm/backend/Tools.py b/src/common/orm/backend/Tools.py deleted file mode 100644 index 30223feac..000000000 --- a/src/common/orm/backend/Tools.py +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) -# -# 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. - -from typing import List, Union - -def key_to_str(key : Union[str, List[str]], separator : str = '/') -> str: - if isinstance(key, str): return key - return separator.join(map(str, key)) diff --git a/src/common/orm/backend/_Backend.py b/src/common/orm/backend/_Backend.py deleted file mode 100644 index 08b346ea7..000000000 --- a/src/common/orm/backend/_Backend.py +++ /dev/null @@ -1,67 +0,0 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) -# -# 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. - -from typing import Any, Dict, List, Optional, Set, Tuple - -class _Backend: - def __init__(self, **settings) -> None: - raise NotImplementedError() - - def lock(self, keys : List[List[str]], owner_key : Optional[str] = None) -> Tuple[bool, str]: - raise NotImplementedError() - - def unlock(self, keys : List[List[str]], owner_key : str) -> bool: - raise NotImplementedError() - - def keys(self) -> list: - raise NotImplementedError() - - def exists(self, key : List[str]) -> bool: - raise NotImplementedError() - - def delete(self, key : List[str]) -> bool: - raise NotImplementedError() - - def dict_get(self, key : List[str], fields : List[str] = []) -> Dict[str, str]: - raise NotImplementedError() - - def dict_update(self, key : List[str], fields : Dict[str, str] = {}) -> None: - raise NotImplementedError() - - def dict_delete(self, key : List[str], fields : List[str] = []) -> None: - raise NotImplementedError() - - def list_get_all(self, key : List[str]) -> List[str]: - raise NotImplementedError() - - def list_push_last(self, key : List[str], item : str) -> None: - raise NotImplementedError() - - def list_remove_first_occurrence(self, key : List[str], item: str) -> None: - raise NotImplementedError() - - def set_add(self, key : List[str], item : str) -> None: - raise NotImplementedError() - - def set_has(self, key : List[str], item : str) -> bool: - raise NotImplementedError() - - def set_get_all(self, key : List[str]) -> Set[str]: - raise NotImplementedError() - - def set_remove(self, key : List[str], item : str) -> None: - raise NotImplementedError() - - def dump(self) -> List[Tuple[str, str, Any]]: - raise NotImplementedError() diff --git a/src/common/orm/backend/__init__.py b/src/common/orm/backend/__init__.py deleted file mode 100644 index 70a332512..000000000 --- a/src/common/orm/backend/__init__.py +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) -# -# 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. - diff --git a/src/common/orm/backend/inmemory/InMemoryBackend.py b/src/common/orm/backend/inmemory/InMemoryBackend.py deleted file mode 100644 index 4930d5957..000000000 --- a/src/common/orm/backend/inmemory/InMemoryBackend.py +++ /dev/null @@ -1,161 +0,0 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) -# -# 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. - -# InMemeory Database Backend -# -------------------------- -# - Concurrency is limited to 1 operation at a time -# - All operations are strictly sequential by means of locks -# - WARNING: DESIGNED AND BUILT FOR UNIT TESTING AND INTEGRATION TESTING PURPOSES ONLY !!! -# USE ANOTHER BACKEND IN PRODUCTION ENVIRONMENTS. - -import copy, logging, threading, uuid -from typing import Any, Dict, List, Optional, Set, Tuple, Union -from .._Backend import _Backend -from ..Tools import key_to_str -from .Tools import get_dict, get_list, get_or_create_dict, get_or_create_list, get_or_create_set, get_set - -LOGGER = logging.getLogger(__name__) - -class InMemoryBackend(_Backend): - def __init__(self, **settings): # pylint: disable=super-init-not-called - self._lock = threading.Lock() - self._keys : Dict[str, Union[Set[str], List[str], Dict[str, str], str]]= {} # key => set/list/dict/string - - def lock(self, keys : List[List[str]], owner_key : Optional[str] = None) -> Tuple[bool, str]: - # InMemoryBackend uses a database where all operations are atomic. Locks are implemented by assigning the lock - # owner key into a string variable. If the field is empty and enables to - owner_key = str(uuid.uuid4()) if owner_key is None else owner_key - str_keys = {key_to_str(key) for key in keys} - with self._lock: - acquired_lock_keys : Dict[str, str] = {} - for str_key in str_keys: - if (str_key in self._keys) and (len(self._keys[str_key]) > 0) and (self._keys[str_key] != owner_key): - # lock already acquired, cannot acquire all locks atomically - for str_key_acquired in acquired_lock_keys: - if str_key_acquired not in self._keys: continue - del self._keys[str_key_acquired] - return False, None - - # lock available, temporarily acquire it; locks will be released if some of them for a requested - # key is not available - self._keys[str_key] = owner_key - acquired_lock_keys[str_key] = owner_key - return True, owner_key - - def unlock(self, keys : List[List[str]], owner_key : str) -> bool: - str_keys = {key_to_str(key) for key in keys} - with self._lock: - for str_key in str_keys: - if str_key not in self._keys: return False - if self._keys[str_key] != owner_key: return False - # Up to here, we own all the keys we want to release - for str_key in str_keys: - del self._keys[str_key] - return True - - def keys(self) -> list: - with self._lock: - return copy.deepcopy(list(self._keys.keys())) - - def exists(self, key : List[str]) -> bool: - str_key = key_to_str(key) - with self._lock: - return str_key in self._keys - - def delete(self, key : List[str]) -> bool: - str_key = key_to_str(key) - with self._lock: - if str_key not in self._keys: return False - del self._keys[str_key] - return True - - def dict_get(self, key : List[str], fields : List[str] = []) -> Dict[str, str]: - str_key = key_to_str(key) - with self._lock: - container = get_dict(self._keys, str_key) - if container is None: return {} - if len(fields) == 0: fields = container.keys() - return copy.deepcopy({ - field_name : field_value for field_name,field_value in container.items() if field_name in fields - }) - - def dict_update(self, key : List[str], fields : Dict[str,str] = {}) -> None: - str_key = key_to_str(key) - with self._lock: - container = get_or_create_dict(self._keys, str_key) - container.update(fields) - - def dict_delete(self, key : List[str], fields : List[str] = []) -> None: - str_key = key_to_str(key) - with self._lock: - if len(fields) == 0: - if str_key not in self._keys: return False - del self._keys[str_key] - else: - container = get_or_create_dict(self._keys, str_key) - for field in list(fields): container.pop(field, None) - if len(container) == 0: self._keys.pop(str_key) - - def list_get_all(self, key : List[str]) -> List[str]: - str_key = key_to_str(key) - with self._lock: - container = get_list(self._keys, str_key) - if container is None: return [] - return copy.deepcopy(container) - - def list_push_last(self, key : List[str], item : str) -> None: - str_key = key_to_str(key) - with self._lock: - container = get_or_create_list(self._keys, str_key) - container.append(item) - - def list_remove_first_occurrence(self, key : List[str], item: str) -> None: - str_key = key_to_str(key) - with self._lock: - container = get_or_create_list(self._keys, str_key) - container.remove(item) - if len(container) == 0: self._keys.pop(str_key) - - def set_add(self, key : List[str], item : str) -> None: - str_key = key_to_str(key) - with self._lock: - container = get_or_create_set(self._keys, str_key) - container.add(item) - - def set_has(self, key : List[str], item : str) -> bool: - str_key = key_to_str(key) - with self._lock: - container = get_or_create_set(self._keys, str_key) - return item in container - - def set_get_all(self, key : List[str]) -> Set[str]: - str_key = key_to_str(key) - with self._lock: - container = get_set(self._keys, str_key) - if container is None: return {} - return copy.deepcopy(container) - - def set_remove(self, key : List[str], item : str) -> None: - str_key = key_to_str(key) - with self._lock: - container = get_or_create_set(self._keys, str_key) - container.discard(item) - if len(container) == 0: self._keys.pop(str_key) - - def dump(self) -> List[Tuple[str, str, Any]]: - with self._lock: - entries = [] - for str_key,key_value in self._keys.items(): - entries.append((str_key, type(key_value).__name__, key_value)) - return entries diff --git a/src/common/orm/backend/inmemory/Tools.py b/src/common/orm/backend/inmemory/Tools.py deleted file mode 100644 index 9f8e2b5c9..000000000 --- a/src/common/orm/backend/inmemory/Tools.py +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) -# -# 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. - -from typing import Dict, List, Set, Union - -def get_dict(keys : Dict[str, Union[Dict, List, Set]], str_key : str) -> Dict: - return keys.get(str_key, None) - -def get_or_create_dict(keys : Dict[str, Union[Dict, List, Set]], str_key : str) -> Dict: - container = keys.get(str_key, None) - if container is None: container = keys.setdefault(str_key, dict()) - if not isinstance(container, dict): - raise Exception('Key({:s}, {:s}) is not a dict'.format(str(type(container).__name__), str(str_key))) - return container - -def get_list(keys : Dict[str, Union[Dict, List, Set]], str_key : str) -> List: - return keys.get(str_key, None) - -def get_or_create_list(keys : Dict[str, Union[Dict, List, Set]], str_key : str) -> List: - container = keys.get(str_key, None) - if container is None: container = keys.setdefault(str_key, list()) - if not isinstance(container, list): - raise Exception('Key({:s}, {:s}) is not a list'.format(str(type(container).__name__), str(str_key))) - return container - -def get_set(keys : Dict[str, Union[Dict, List, Set]], str_key : str) -> Set: - return keys.get(str_key, None) - -def get_or_create_set(keys : Dict[str, Union[Dict, List, Set]], str_key : str) -> Set: - container = keys.get(str_key, None) - if container is None: container = keys.setdefault(str_key, set()) - if not isinstance(container, set): - raise Exception('Key({:s}, {:s}) is not a set'.format(str(type(container).__name__), str(str_key))) - return container diff --git a/src/common/orm/backend/inmemory/__init__.py b/src/common/orm/backend/inmemory/__init__.py deleted file mode 100644 index 70a332512..000000000 --- a/src/common/orm/backend/inmemory/__init__.py +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) -# -# 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. - diff --git a/src/common/orm/backend/redis/Mutex.py b/src/common/orm/backend/redis/Mutex.py deleted file mode 100644 index 6424b7a79..000000000 --- a/src/common/orm/backend/redis/Mutex.py +++ /dev/null @@ -1,136 +0,0 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) -# -# 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. - -import random, time, uuid -from typing import Set, Tuple, Union -from redis.client import Redis - -KEY_LOCK = '{}/lock' -MIN_WAIT_TIME = 0.01 - -class Mutex: - def __init__(self, client: Redis) -> None: - if not isinstance(client, Redis): - str_class_path = '{}.{}'.format(Redis.__module__, Redis.__name__) - raise AttributeError('client must be an instance of {}'.format(str_class_path)) - self._client = client - self._script_release = None - self._script_refresh_expire = None - self._register_scripts() - - def _register_scripts(self) -> None: - # Script mutex_release - # Description: atomic script to release a set of mutex keys, only if all mutex keys are owned by the caller. - # if owner_key matches key stored in all mutexes, remove all mutexes and return 1. if some key - # does not match, do nothing and return 0. - # Keys: set of entity_keys to be released - # Args: owner_key - # Ret : 1 if all keys have been released, 0 otherwise (no action performed) - # Use : acquired = (int(self._script_release(keys=['mutex1', 'mutex2'], args=[owner_key])) == 1) - self._script_release = self._client.register_script('\n'.join([ - "for _,key in ipairs(KEYS) do", - " local owner_key = redis.call('get', key)", - " if owner_key ~= ARGV[1] then return 0 end", - "end", - "for _,key in ipairs(KEYS) do", - " redis.call('del', key)", - "end", - "return 1", - ])) - - # Script mutex_refresh_expire - # Description: atomic script to refresh expiracy of a set of mutex keys, only if all of them are owned by the - # caller. if owner_key matches key stored in all mutexes, refresh expiracy on all mutexes and - # return 1. if some key does not match, do nothing and return 0. - # Keys: set of entity_keys to be refreshed - # Args: owner_key, expiracy_seconds - # Ret : 1 if all keys have been refreshed, 0 otherwise (no action performed) - # Use : done = (int(self._script_refresh_expire(keys=['mutex1', 'mutex2'], args=[owner_key, seconds])) == 1) - self._script_refresh_expire = self._client.register_script('\n'.join([ - "for _,key in ipairs(KEYS) do", - " local owner_key = redis.call('get', key)", - " if owner_key ~= ARGV[1] then return 0 end", - "end", - "for _,key in ipairs(KEYS) do", - " redis.call('expire', key, ARGV[2])", - "end", - "return 1", - ])) - - def acquire(self, entity_key_or_keys : Union[str, Set[str]], owner_key : Union[str, None] = None, - blocking : bool = True, timeout : Union[float, int] = 5, - expiracy_seconds : Union[float, int, None] = None) -> Tuple[bool, str]: - # Atomically set all entity_keys or none of them. - # entity_key_or_keys contains either a string with a specific entity key or a set with all entity keys to be - # set atomically. - # owner_key enables to specify the desired key to use to mark the mutex. When releasing, the owner_key must be - # correct, otherwise, the key will not be released. It can also be used to check if mutex is still owned by - # oneself or was lost and acquired by another party. If set to None, a random key is generated and returned - # together with the acquired boolean value. - # blocking defines wether the acquisition should be blocking, meaning that acquisition will be retired with - # random increments until timeout timeout is elapsed. - # Optionally, an expiracy_seconds period can be specified in expiracy_seconds. If mutex is not released after - # that period of time, the mutex will be released automatically. - # If mutex(es) is(are) acquired, the method returns True and the owner_key used to create the lock; otherwise, - # False and None owner_key are returned. - - owner_key = owner_key or str(uuid.uuid4()) - entity_keys = entity_key_or_keys if isinstance(entity_key_or_keys, set) else {str(entity_key_or_keys)} - entity_key_map = {KEY_LOCK.format(entity_key):owner_key for entity_key in entity_keys} - acquired = False - if blocking: - remaining_wait_time = timeout - while not acquired: - acquired = (self._client.msetnx(entity_key_map) == 1) - if acquired: break - if remaining_wait_time < MIN_WAIT_TIME: return False, None - wait_time = remaining_wait_time * random.random() - remaining_wait_time -= wait_time - time.sleep(wait_time) - else: - acquired = (self._client.msetnx(entity_key_map) == 1) - - if not acquired: return False, None - - if expiracy_seconds is not None: - pipeline = self._client.pipeline() - for entity_key in entity_key_map.keys(): pipeline.expire(entity_key, expiracy_seconds) - pipeline.execute() - - return True, owner_key - - def release(self, entity_key_or_keys : Union[str, Set[str]], owner_key : str) -> bool: - # release mutex keys only if all of them are owned by the caller - # return True if succeeded, False (nothing changed) otherwise - entity_keys = entity_key_or_keys if isinstance(entity_key_or_keys, set) else {str(entity_key_or_keys)} - entity_keys = {KEY_LOCK.format(entity_key) for entity_key in entity_keys} - return int(self._script_release(keys=list(entity_keys), args=[owner_key])) == 1 - - def acquired(self, entity_key : str, owner_key : str) -> bool: - # check if a mutex is owned by the owner with owner_key - value = self._client.get(KEY_LOCK.format(entity_key)) - if(value is None): return(False) - return str(value) == owner_key - - def get_ttl(self, entity_key : str) -> float: - # check a mutex's time to live - return self._client.ttl(KEY_LOCK.format(entity_key)) - - def refresh_expiracy(self, entity_key_or_keys : Union[str, Set[str]], owner_key : str, - expiracy_seconds : Union[float, int]) -> bool: - # refresh expiracy on specified mutex keys only if all of them are owned by the caller - # return True if succeeded, False (nothing changed) otherwise - entity_keys = entity_key_or_keys if isinstance(entity_key_or_keys, set) else {str(entity_key_or_keys)} - entity_keys = {KEY_LOCK.format(entity_key) for entity_key in entity_keys} - return int(self._script_refresh_expire(keys=entity_keys, args=[owner_key, expiracy_seconds])) == 1 diff --git a/src/common/orm/backend/redis/RedisBackend.py b/src/common/orm/backend/redis/RedisBackend.py deleted file mode 100644 index 30225eaa2..000000000 --- a/src/common/orm/backend/redis/RedisBackend.py +++ /dev/null @@ -1,131 +0,0 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) -# -# 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. - -import os, uuid -from typing import Any, Dict, List, Optional, Set, Tuple -from redis.client import Redis -from .._Backend import _Backend -from ..Tools import key_to_str -from .Mutex import Mutex - -DEFAULT_SERVICE_HOST = '127.0.0.1' -DEFAULT_SERVICE_PORT = 6379 -DEFAULT_DATABASE_ID = 0 - -def get_setting(settings : Dict[str, Any], name : str, default : Any) -> Any: - value = settings.get(name, os.environ.get(name)) - return default if value is None else value - -class RedisBackend(_Backend): - def __init__(self, **settings) -> None: # pylint: disable=super-init-not-called - host = get_setting(settings, 'REDIS_SERVICE_HOST', DEFAULT_SERVICE_HOST) - port = get_setting(settings, 'REDIS_SERVICE_PORT', DEFAULT_SERVICE_PORT) - dbid = get_setting(settings, 'REDIS_DATABASE_ID', DEFAULT_DATABASE_ID ) - self._client = Redis.from_url('redis://{host}:{port}/{dbid}'.format(host=host, port=port, dbid=dbid)) - self._mutex = Mutex(self._client) - - def lock(self, keys : List[List[str]], owner_key : Optional[str] = None) -> Tuple[bool, str]: - str_keys = {key_to_str(key) for key in keys} - owner_key = str(uuid.uuid4()) if owner_key is None else owner_key - return self._mutex.acquire(str_keys, owner_key=owner_key, blocking=True) - - def unlock(self, keys : List[List[str]], owner_key : str) -> bool: - str_keys = {key_to_str(key) for key in keys} - return self._mutex.release(str_keys, owner_key) - - def keys(self) -> list: - return [k.decode('UTF-8') for k in self._client.keys()] - - def exists(self, key : List[str]) -> bool: - str_key = key_to_str(key) - return self._client.exists(str_key) == 1 - - def delete(self, key : List[str]) -> bool: - str_key = key_to_str(key) - return self._client.delete(str_key) == 1 - - def dict_get(self, key : List[str], fields : List[str] = []) -> Dict[str, str]: - str_key = key_to_str(key) - if len(fields) == 0: - keys_values = self._client.hgetall(str_key).items() - else: - fields = list(fields) - keys_values = zip(fields, self._client.hmget(str_key, fields)) - - attributes = {} - for key,value in keys_values: - str_key = key.decode('UTF-8') if isinstance(key, bytes) else key - attributes[str_key] = value.decode('UTF-8') if isinstance(value, bytes) else value - return attributes - - def dict_update(self, key : List[str], fields : Dict[str, str] = {}) -> None: - str_key = key_to_str(key) - if len(fields) > 0: - self._client.hset(str_key, mapping=fields) - - def dict_delete(self, key : List[str], fields : List[str] = []) -> None: - str_key = key_to_str(key) - if len(fields) == 0: - self._client.delete(str_key) - else: - self._client.hdel(str_key, set(fields)) - - def list_get_all(self, key : List[str]) -> List[str]: - str_key = key_to_str(key) - return list(map(lambda m: m.decode('UTF-8'), self._client.lrange(str_key, 0, -1))) - - def list_push_last(self, key : List[str], item : str) -> None: - str_key = key_to_str(key) - self._client.rpush(str_key, item) - - def list_remove_first_occurrence(self, key : List[str], item: str) -> None: - str_key = key_to_str(key) - self._client.lrem(str_key, 1, item) - - def set_add(self, key : List[str], item : str) -> None: - str_key = key_to_str(key) - self._client.sadd(str_key, item) - - def set_has(self, key : List[str], item : str) -> bool: - str_key = key_to_str(key) - return self._client.sismember(str_key, item) == 1 - - def set_get_all(self, key : List[str]) -> Set[str]: - str_key = key_to_str(key) - return set(map(lambda m: m.decode('UTF-8'), self._client.smembers(str_key))) - - def set_remove(self, key : List[str], item : str) -> None: - str_key = key_to_str(key) - self._client.srem(str_key, item) - - def dump(self) -> List[Tuple[str, str, Any]]: - entries = [] - for str_key in self._client.keys(): - str_key = str_key.decode('UTF-8') - key_type = self._client.type(str_key) - if key_type is not None: key_type = key_type.decode('UTF-8') - key_type = { - 'hash' : 'dict', - 'list' : 'list', - 'set' : 'set', - 'string': 'str', - }.get(key_type) - key_content = { - 'dict': lambda key: {k.decode('UTF-8'):v.decode('UTF-8') for k,v in self._client.hgetall(key).items()}, - 'list': lambda key: [m.decode('UTF-8') for m in self._client.lrange(key, 0, -1)], - 'set' : lambda key: {m.decode('UTF-8') for m in self._client.smembers(key)}, - 'str' : lambda key: self._client.get(key).decode('UTF-8'), - }.get(key_type, lambda key: 'UNSUPPORTED_TYPE') - entries.append((str_key, key_type, key_content(str_key))) - return entries diff --git a/src/common/orm/backend/redis/__init__.py b/src/common/orm/backend/redis/__init__.py deleted file mode 100644 index 70a332512..000000000 --- a/src/common/orm/backend/redis/__init__.py +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) -# -# 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. - diff --git a/src/common/orm/fields/BooleanField.py b/src/common/orm/fields/BooleanField.py deleted file mode 100644 index ae9ac8eaf..000000000 --- a/src/common/orm/fields/BooleanField.py +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) -# -# 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. - -from __future__ import annotations -from typing import Union -from common.type_checkers.Checkers import chk_boolean -from .Field import Field - -BOOL_TRUE_VALUES = {'TRUE', 'T', '1'} - -class BooleanField(Field): - def __init__(self, *args, **kwargs) -> None: - super().__init__(*args, type_=bool, **kwargs) - - def validate(self, value : Union[bool, str], try_convert_type=False) -> bool: - value = self.is_required(value) - if value is None: return None - if try_convert_type and isinstance(value, str): - return value.upper() in BOOL_TRUE_VALUES - return chk_boolean(self.name, value) diff --git a/src/common/orm/fields/EnumeratedField.py b/src/common/orm/fields/EnumeratedField.py deleted file mode 100644 index f684649e1..000000000 --- a/src/common/orm/fields/EnumeratedField.py +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) -# -# 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. - -from __future__ import annotations -from enum import Enum -from typing import Union -from common.orm.fields.Field import Field -from common.type_checkers.Checkers import chk_issubclass, chk_options, chk_type -from .Field import Field - -class EnumeratedField(Field): - def __init__(self, enumeration_class : 'Enum', *args, required : bool = True, **kwargs) -> None: - self.enumeration_class : Enum = chk_issubclass('EnumeratedField.enumeration_class', enumeration_class, Enum) - super().__init__(*args, type_=self.enumeration_class, required=required, **kwargs) - - def validate(self, value : Union['Enum', str], try_convert_type=False) -> 'Enum': - value = super().is_required(value) - if value is None: return None - if try_convert_type and isinstance(value, str): - chk_options(self.name, value, self.enumeration_class.__members__.keys()) - value = self.enumeration_class.__members__[value] - return chk_type(self.name, value, self.enumeration_class) - - def serialize(self, value: 'Enum') -> str: - value = self.validate(value, try_convert_type=True) - if value is None: return None - return str(value.name) diff --git a/src/common/orm/fields/Field.py b/src/common/orm/fields/Field.py deleted file mode 100644 index 68d868cf7..000000000 --- a/src/common/orm/fields/Field.py +++ /dev/null @@ -1,63 +0,0 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) -# -# 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. - -from __future__ import annotations -import logging -from typing import TYPE_CHECKING, Any, List, Set, Tuple, Union -from common.type_checkers.Checkers import chk_boolean, chk_not_none, chk_string, chk_type - -if TYPE_CHECKING: - from ..model.Model import Model - -LOGGER = logging.getLogger(__name__) - -# Ref: https://docs.python.org/3.9/howto/descriptor.html - -class Field: - def __init__( - self, name : str = None, type_ : Union[type, Set[type], Tuple[type], List[type]] = object, - required : bool = False) -> None: - - self.name = None if name is None else chk_string('Field.name', name) - self.type_ = chk_type('Field.type', type_, (type, set, tuple, list)) - self.required = chk_boolean('Field.required', required) - - def __get__(self, instance : 'Model', objtype=None): - if instance is None: return self - return instance.__dict__.get(self.name) - - def __set__(self, instance : 'Model', value : Any) -> None: - instance.__dict__[self.name] = self.validate(value) - - def __delete__(self, instance : 'Model'): - raise AttributeError('Attribute "{:s}" cannot be deleted'.format(self.name)) - - def is_required(self, value): - if self.required: - chk_not_none(self.name, value, reason='is required. It cannot be None.') - return value - - def validate(self, value, try_convert_type=False): - value = self.is_required(value) - if value is None: return None - if try_convert_type: value = self.type_(value) - return value - - def serialize(self, value : Any) -> str: - value = self.validate(value) - if value is None: return None - return str(value) - - def deserialize(self, value : str) -> Any: - return self.validate(value, try_convert_type=True) diff --git a/src/common/orm/fields/FloatField.py b/src/common/orm/fields/FloatField.py deleted file mode 100644 index 8d006e773..000000000 --- a/src/common/orm/fields/FloatField.py +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) -# -# 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. - -from __future__ import annotations -from typing import Optional, Union -from common.type_checkers.Checkers import chk_float -from .Field import Field - -class FloatField(Field): - def __init__( - self, *args, min_value : Optional[float] = None, max_value : Optional[float] = None, **kwargs) -> None: - - super().__init__(*args, type_=float, **kwargs) - self._min_value = None if min_value is None else \ - chk_float('FloatField.min_value', min_value) - self._max_value = None if max_value is None else \ - chk_float('FloatField.max_value', max_value, min_value=self._min_value) - - def validate(self, value : Union[float, str], try_convert_type=False) -> float: - value = super().validate(value) - if value is None: return None - if try_convert_type and isinstance(value, str): value = float(value) - return chk_float(self.name, value, min_value=self._min_value, max_value=self._max_value) diff --git a/src/common/orm/fields/ForeignKeyField.py b/src/common/orm/fields/ForeignKeyField.py deleted file mode 100644 index 12e720d17..000000000 --- a/src/common/orm/fields/ForeignKeyField.py +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) -# -# 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. - -from __future__ import annotations -from typing import TYPE_CHECKING -from common.type_checkers.Checkers import chk_issubclass, chk_type -from .StringField import StringField - -if TYPE_CHECKING: - from ..model.Model import Model - -class ForeignKeyField(StringField): - def __init__(self, foreign_model : 'Model', *args, required : bool = True, **kwargs) -> None: - from ..model.Model import Model - self.foreign_model : Model = chk_issubclass('ForeignKeyField.foreign_model', foreign_model, Model) - super().__init__(*args, required=required, allow_empty=not required, **kwargs) - - def __set__(self, instance : 'Model', value : 'Model') -> None: - model_instance : 'Model' = chk_type('value', value, self.foreign_model) - super().__set__(instance, self.validate(model_instance.instance_key)) - - def __delete__(self, instance: 'Model'): - super().__set__(instance, self.validate(None)) diff --git a/src/common/orm/fields/IntegerField.py b/src/common/orm/fields/IntegerField.py deleted file mode 100644 index 87ddab464..000000000 --- a/src/common/orm/fields/IntegerField.py +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) -# -# 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. - -from __future__ import annotations -from typing import Optional, Union -from common.type_checkers.Checkers import chk_integer -from .Field import Field - -class IntegerField(Field): - def __init__( - self, *args, min_value : Optional[int] = None, max_value : Optional[int] = None, **kwargs) -> None: - - super().__init__(*args, type_=int, **kwargs) - self._min_value = None if min_value is None else \ - chk_integer('IntegerField.min_value', min_value) - self._max_value = None if max_value is None else \ - chk_integer('IntegerField.max_value', max_value, min_value=self._min_value) - - def validate(self, value : Union[int, str], try_convert_type=False) -> int: - value = super().validate(value) - if value is None: return None - if try_convert_type and isinstance(value, str): value = int(value) - return chk_integer(self.name, value, min_value=self._min_value, max_value=self._max_value) diff --git a/src/common/orm/fields/PrimaryKeyField.py b/src/common/orm/fields/PrimaryKeyField.py deleted file mode 100644 index 86fdc7e24..000000000 --- a/src/common/orm/fields/PrimaryKeyField.py +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) -# -# 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. - -from __future__ import annotations -from typing import TYPE_CHECKING -from .StringField import StringField - -if TYPE_CHECKING: - from ..model.Model import Model - -class PrimaryKeyField(StringField): - def __init__(self, *args, **kwargs) -> None: - super().__init__(*args, required=True, allow_empty=False, min_length=1, **kwargs) - - def __set__(self, instance : 'Model', value : str) -> None: - if (self.name in instance.__dict__) and (instance.__dict__[self.name] is not None): - raise ValueError('PrimaryKeyField cannot be modified') - super().__set__(instance, self.validate(value)) diff --git a/src/common/orm/fields/StringField.py b/src/common/orm/fields/StringField.py deleted file mode 100644 index ead8487ea..000000000 --- a/src/common/orm/fields/StringField.py +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) -# -# 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. - -from __future__ import annotations -import re -from typing import Optional, Pattern, Union -from common.type_checkers.Checkers import chk_boolean, chk_integer, chk_string -from .Field import Field - -class StringField(Field): - def __init__( - self, *args, allow_empty : bool = False, min_length : Optional[int] = None, max_length : Optional[int] = None, - pattern : Optional[Union[Pattern, str]] = None, **kwargs) -> None: - - super().__init__(*args, type_=str, **kwargs) - self._allow_empty = chk_boolean('StringField.allow_empty', allow_empty) - self._min_length = None if min_length is None else \ - chk_integer('StringField.min_length', min_length, min_value=0) - self._max_length = None if max_length is None else \ - chk_integer('StringField.max_length', max_length, min_value=self._min_length) - self._pattern = None if pattern is None else re.compile(pattern) - - def validate(self, value : str, try_convert_type=False) -> str: - value = super().validate(value, try_convert_type=try_convert_type) - if value is None: return None - return chk_string( - self.name, value, allow_empty=self._allow_empty, min_length=self._min_length, max_length=self._max_length, - pattern=self._pattern) diff --git a/src/common/orm/fields/__init__.py b/src/common/orm/fields/__init__.py deleted file mode 100644 index 2a4cccb63..000000000 --- a/src/common/orm/fields/__init__.py +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) -# -# 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. - -from .BooleanField import BooleanField -from .Field import Field -from .FloatField import FloatField -from .ForeignKeyField import ForeignKeyField -from .IntegerField import IntegerField -from .PrimaryKeyField import PrimaryKeyField -from .StringField import StringField -__all__ = ['BooleanField', 'Field', 'FloatField', 'ForeignKeyField', 'IntegerField', 'PrimaryKeyField', 'StringField'] diff --git a/src/common/orm/model/Model.py b/src/common/orm/model/Model.py deleted file mode 100644 index ffb957114..000000000 --- a/src/common/orm/model/Model.py +++ /dev/null @@ -1,308 +0,0 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) -# -# 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. - -from __future__ import annotations -import logging, re -from typing import Any, Dict, List, Mapping, Optional, Set, Tuple, Union -from common.orm.Database import Database -from common.orm.backend.Tools import key_to_str -from common.orm.fields.ForeignKeyField import ForeignKeyField -from ..Exceptions import ConstraintException, MutexException -from ..fields.Field import Field -from ..fields.PrimaryKeyField import PrimaryKeyField -from .Tools import NoDupOrderedDict - -LOGGER = logging.getLogger(__name__) -DEFAULT_PRIMARY_KEY_NAME = 'pk_auto' - -class MetaModel(type): - @classmethod - def __prepare__(cls, name : str, bases : Tuple[type, ...], **attrs : Any) -> Mapping[str, Any]: - return NoDupOrderedDict() - - def __new__(cls, name : str, bases : Tuple[type, ...], attrs : NoDupOrderedDict[str, Any]): - field_names = list() - pk_field_name = None - for key, value in attrs.items(): - if not isinstance(value, Field): continue - value.name = key - field_names.append(key) - if not isinstance(value, PrimaryKeyField): continue - if pk_field_name is None: - pk_field_name = key - continue - raise AttributeError('PrimaryKeyField for Model({:s}) already set to attribute({:s})'.format( - str(name), str(pk_field_name))) - if pk_field_name is None: - if DEFAULT_PRIMARY_KEY_NAME in attrs.keys(): - msg = 'PrimaryKeyField for Model({:s}) not defined and attribute "{:s}" already used. '\ - 'Leave attribute name "{:s}" for automatic PrimaryKeyField, or set a PrimaryKeyField.' - raise AttributeError(msg.format(str(name), DEFAULT_PRIMARY_KEY_NAME, DEFAULT_PRIMARY_KEY_NAME)) - pk_field_name = DEFAULT_PRIMARY_KEY_NAME - attrs[pk_field_name] = PrimaryKeyField(name=pk_field_name) - field_names.append(pk_field_name) - cls_obj = super().__new__(cls, name, bases, dict(attrs)) - setattr(cls_obj, '_pk_field_name', pk_field_name) - setattr(cls_obj, '_field_names_list', field_names) - setattr(cls_obj, '_field_names_set', set(field_names)) - return cls_obj - -KEYWORD_INSTANCES = 'instances' -KEYWORD_LOCK = 'lock' -KEYWORD_REFERENCES = 'references' -KEYWORD_STORED = '_stored' - -class Model(metaclass=MetaModel): - @classmethod - def get_backend_key_instances(cls) -> str: - return key_to_str(['{:s}'.format(cls.__name__), KEYWORD_INSTANCES]) - - @classmethod - def get_backend_key_instance(cls, primary_key : str) -> str: - return '{:s}[{:s}]'.format(cls.__name__, primary_key) - - @classmethod - def get_backend_key_references(cls, primary_key : str) -> str: - match = re.match(r'^[a-zA-Z0-9\_]+\[([^\]]*)\]', primary_key) - if not match: primary_key = cls.get_backend_key_instance(primary_key) - return key_to_str([primary_key, KEYWORD_REFERENCES]) - - @staticmethod - def get_backend_key_lock(backend_key : str) -> str: - if backend_key.endswith(KEYWORD_LOCK): return backend_key - return key_to_str([backend_key, KEYWORD_LOCK]) - - @staticmethod - def get_backend_key_locks(backend_keys : List[str]) -> List[str]: - return [Model.get_backend_key_lock(backend_key) for backend_key in backend_keys] - - @classmethod - def backend_key__to__instance_key(cls, backend_key : str) -> str: - class_name = cls.__name__ - if backend_key.startswith(class_name): - match = re.match(r'^{:s}\[([^\]]*)\]'.format(class_name), backend_key) - if match: return match.group(1) - return backend_key - - def __init__(self, database : Database, primary_key : str, auto_load : bool = True) -> None: - if not isinstance(database, Database): - str_class_path = '{}.{}'.format(Database.__module__, Database.__name__) - raise AttributeError('database must inherit from {}'.format(str_class_path)) - self._model_class = type(self) - self._class_name = self._model_class.__name__ - pk_field_name = self._pk_field_name # pylint: disable=no-member - pk_field_instance : 'PrimaryKeyField' = getattr(self._model_class, pk_field_name) - primary_key = pk_field_instance.validate(primary_key) - primary_key = self.backend_key__to__instance_key(primary_key) - setattr(self, pk_field_name, primary_key) - self._database = database - self._backend = database.backend - self._instance_key : str = self.get_backend_key_instance(primary_key) - self._instances_key : str = self.get_backend_key_instances() - self._references_key : str = self.get_backend_key_references(primary_key) - self._owner_key : Optional[str] = None - if auto_load: self.load() - - @property - def database(self) -> Database: return self._database - - @property - def instance_key(self) -> str: return self._instance_key - - def lock(self, extra_keys : List[List[str]] = [], blocking : bool = True): - while True: - lock_keys = Model.get_backend_key_locks( - [self._instance_key, self._instances_key, self._references_key] + extra_keys) - acquired,self._owner_key = self._backend.lock(lock_keys, owner_key=self._owner_key) - if acquired: return - if not blocking: break - raise MutexException('Unable to lock keys {:s} using owner_key {:s}'.format( - str(lock_keys), str(self._owner_key))) - - def unlock(self, extra_keys : List[List[str]] = []): - lock_keys = Model.get_backend_key_locks( - [self._instance_key, self._instances_key, self._references_key] + extra_keys) - released = self._backend.unlock(lock_keys, self._owner_key) - if released: return - raise MutexException('Unable to unlock keys {:s} using owner_key {:s}'.format( - str(lock_keys), str(self._owner_key))) - - def load(self) -> bool: - pk_field_name = self._pk_field_name # pylint: disable=no-member - - try: - self.lock() - - attributes = self._backend.dict_get(self._instance_key) - if attributes is None or len(attributes) == 0: return False - for field_name in self._field_names_list: # pylint: disable=no-member - if field_name == pk_field_name: continue - if field_name not in attributes: continue - raw_field_value = attributes[field_name] - field_instance : 'Field' = getattr(self._model_class, field_name) - field_value = field_instance.deserialize(raw_field_value) - if isinstance(field_instance, ForeignKeyField): - setattr(self, field_name + KEYWORD_STORED, field_value) - field_value = field_instance.foreign_model(self._database, field_value, auto_load=True) - setattr(self, field_name, field_value) - return True - finally: - self.unlock() - - def save(self) -> None: - attributes : Dict[str, Any] = dict() - required_keys : Set[str] = set() - foreign_additions : Dict[str, str] = dict() - foreign_removals : Dict[str, str] = dict() - for field_name in self._field_names_list: # pylint: disable=no-member - field_value = getattr(self, field_name) - field_instance : 'Field' = getattr(self._model_class, field_name) - serialized_field_value = field_instance.serialize(field_value) - if (serialized_field_value is None) and (not field_instance.required): continue - if isinstance(field_instance, ForeignKeyField): - foreign_reference = '{:s}:{:s}'.format(self._instance_key, field_name) - field_value_stored = getattr(self, field_name + KEYWORD_STORED, None) - if field_value_stored is not None: - foreign_removals[self.get_backend_key_references(field_value_stored)] = foreign_reference - foreign_additions[self.get_backend_key_references(serialized_field_value)] = foreign_reference - required_keys.add(serialized_field_value) - attributes[field_name] = serialized_field_value - - extra_keys = [] - extra_keys.extend(list(foreign_removals.keys())) - extra_keys.extend(list(foreign_additions.keys())) - - try: - self.lock(extra_keys=extra_keys) - - not_exists = [ - str(required_key) - for required_key in required_keys - if not self._backend.exists(required_key)] - if len(not_exists) > 0: - raise ConstraintException('Required Keys ({:s}) does not exist'.format(', '.join(sorted(not_exists)))) - - self._backend.dict_update(self._instance_key, attributes) - self._backend.set_add(self._instances_key, self._instance_key) - - for serialized_field_value,foreign_reference in foreign_removals.items(): - self._backend.set_remove(serialized_field_value, foreign_reference) - - for serialized_field_value,foreign_reference in foreign_additions.items(): - self._backend.set_add(serialized_field_value, foreign_reference) - finally: - self.unlock(extra_keys=extra_keys) - - for serialized_field_value,foreign_reference in foreign_additions.items(): - setattr(self, (foreign_reference.rsplit(':', 1)[-1]) + KEYWORD_STORED, field_value_stored) - - def delete(self) -> None: - foreign_removals : Dict[str, str] = {} - for field_name in self._field_names_list: # pylint: disable=no-member - field_instance : 'Field' = getattr(self._model_class, field_name) - if not isinstance(field_instance, ForeignKeyField): continue - foreign_reference = '{:s}:{:s}'.format(self._instance_key, field_name) - field_value_stored = getattr(self, field_name + KEYWORD_STORED, None) - if field_value_stored is None: continue - foreign_removals[self.get_backend_key_references(field_value_stored)] = foreign_reference - - extra_keys = [] - extra_keys.extend(list(foreign_removals.keys())) - - try: - self.lock(extra_keys=extra_keys) - - if self._backend.exists(self._references_key): - references = self._backend.set_get_all(self._references_key) - raise ConstraintException('Instance is used by Keys ({:s})'.format(', '.join(sorted(references)))) - - self._backend.delete(self._instance_key) - self._backend.set_remove(self._instances_key, self._instance_key) - - for serialized_field_value,foreign_reference in foreign_removals.items(): - self._backend.set_remove(serialized_field_value, foreign_reference) - finally: - self.unlock(extra_keys=extra_keys) - - @staticmethod - def get_model_name(model_or_str) -> str: - if isinstance(model_or_str, str): - return model_or_str - if (type(model_or_str).__name__ == 'MetaModel') and issubclass(model_or_str, Model): - return model_or_str.__name__ - raise Exception() - - def references( - self, filter_by_models : Optional[Union[type, List[type], Set[type], Tuple[type]]] = None - ) -> Set[Tuple[str, str]]: - - try: - self.lock() - if not self._backend.exists(self._references_key): return {} - references = self._backend.set_get_all(self._references_key) - try: - if filter_by_models is None: - pass - elif isinstance(filter_by_models, str): - filter_by_models = {filter_by_models} - elif isinstance(filter_by_models, (list, set, tuple)): - filter_by_models = {Model.get_model_name(model_or_str) for model_or_str in filter_by_models} - elif (type(filter_by_models).__name__ == 'MetaModel') and issubclass(filter_by_models, Model): - filter_by_models = {Model.get_model_name(filter_by_models)} - else: - raise Exception() - except Exception as e: - msg = 'filter_by_models({:s}) unsupported. Expected a type or a list/set of types. Optionally, keep '\ - 'it as None to retrieve all the references pointing to this instance.' - raise AttributeError(msg.format(str(filter_by_models))) from e - if filter_by_models: - references = filter(lambda instance_key: instance_key.split('[', 1)[0] in filter_by_models, references) - return {tuple(reference.rsplit(':', 1)) for reference in references} - finally: - self.unlock() - - @classmethod - def get_primary_keys(cls, database : Database): - backend = database.backend - key_model_instances = cls.get_backend_key_instances() - key_model_instances_lock = cls.get_backend_key_lock(key_model_instances) - - acquired,owner_key = backend.lock(key_model_instances_lock) - if not acquired: - raise MutexException('Unable to lock keys {:s}'.format( - str(key_model_instances_lock))) - - instance_keys = backend.set_get_all(key_model_instances) - - released = backend.unlock(key_model_instances_lock, owner_key) - if not released: - raise MutexException('Unable to unlock keys {:s} using owner_key {:s}'.format( - str(key_model_instances_lock), str(owner_key))) - - return instance_keys - - def dump_id(self) -> Dict: - raise NotImplementedError() - - def dump(self) -> Dict: - raise NotImplementedError() - - def __repr__(self) -> str: - pk_field_name = self._pk_field_name # pylint: disable=no-member - arguments = ', '.join( - '{:s}={:s}{:s}'.format( - name, repr(getattr(self, name)), '(PK)' if name == pk_field_name else '') - for name in self._field_names_list # pylint: disable=no-member - ) - return '{:s}({:s})'.format(self._class_name, arguments) diff --git a/src/common/orm/model/Tools.py b/src/common/orm/model/Tools.py deleted file mode 100644 index aed6a14bc..000000000 --- a/src/common/orm/model/Tools.py +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) -# -# 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. - -from collections import OrderedDict - -class NoDupOrderedDict(OrderedDict): - def __setitem__(self, key, value): - if key in self: raise NameError('{:s} already defined'.format(str(key))) - super().__setitem__(key, value) - -def format_key(key_pattern, instance, **kwargs): - attributes = {} - for attribute_name in instance.__dir__(): - if attribute_name[0] == '_': continue - attribute_obj = getattr(instance, attribute_name, None) - if attribute_obj is None: continue - if type(attribute_obj).__name__ == 'method': continue - attributes[attribute_name] = attribute_obj - attributes.update(kwargs) - return key_pattern.format(**attributes) diff --git a/src/common/orm/model/__init__.py b/src/common/orm/model/__init__.py deleted file mode 100644 index 70a332512..000000000 --- a/src/common/orm/model/__init__.py +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) -# -# 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. - diff --git a/src/common/orm/tests/__init__.py b/src/common/orm/tests/__init__.py deleted file mode 100644 index 70a332512..000000000 --- a/src/common/orm/tests/__init__.py +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) -# -# 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. - diff --git a/src/common/orm/tests/test_unitary.py b/src/common/orm/tests/test_unitary.py deleted file mode 100644 index 586a96235..000000000 --- a/src/common/orm/tests/test_unitary.py +++ /dev/null @@ -1,656 +0,0 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) -# -# 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. - -import logging, pytest -from enum import Enum -from common.orm.Exceptions import ConstraintException -from common.orm.Database import Database -from common.orm.Factory import get_database_backend -from common.orm.backend.BackendEnum import BackendEnum -from common.orm.backend._Backend import _Backend -from common.orm.fields.BooleanField import BooleanField -from common.orm.fields.EnumeratedField import EnumeratedField -from common.orm.fields.FloatField import FloatField -from common.orm.fields.ForeignKeyField import ForeignKeyField -from common.orm.fields.IntegerField import IntegerField -from common.orm.fields.PrimaryKeyField import PrimaryKeyField -from common.orm.fields.StringField import StringField -from common.orm.model.Model import DEFAULT_PRIMARY_KEY_NAME, Model - -logging.basicConfig(level=logging.INFO) -LOGGER = logging.getLogger(__name__) - -def test_database_instantiation(): - with pytest.raises(AttributeError) as e: - Database(None) - str_class_path = '{}.{}'.format(_Backend.__module__, _Backend.__name__) - assert str(e.value) == 'backend must inherit from {}'.format(str_class_path) - - assert Database(get_database_backend(BackendEnum.INMEMORY)) is not None - -def test_model_without_attributes(): - with pytest.raises(AttributeError) as e: - Model(None, 'valid-uuid') - str_class_path = '{}.{}'.format(Database.__module__, Database.__name__) - assert str(e.value) == 'database must inherit from {}'.format(str_class_path) - - database = Database(get_database_backend(BackendEnum.INMEMORY)) - - with pytest.raises(ValueError) as e: - Model(database, '') - msg = '{:s}() is out of range: allow_empty(False).' - assert str(e.value) == msg.format(DEFAULT_PRIMARY_KEY_NAME) - - with pytest.raises(TypeError) as e: - Model(database, 23) - msg = '{:s}(23) is of a wrong type(int). Accepted type_or_types().' - assert str(e.value) == msg.format(DEFAULT_PRIMARY_KEY_NAME) - - with pytest.raises(TypeError) as e: - Model(database, 23.5) - msg = '{:s}(23.5) is of a wrong type(float). Accepted type_or_types().' - assert str(e.value) == msg.format(DEFAULT_PRIMARY_KEY_NAME) - - with pytest.raises(TypeError) as e: - Model(database, True) - msg = '{:s}(True) is of a wrong type(bool). Accepted type_or_types().' - assert str(e.value) == msg.format(DEFAULT_PRIMARY_KEY_NAME) - - with pytest.raises(TypeError) as e: - Model(database, ['a']) - msg = '{:s}([\'a\']) is of a wrong type(list). Accepted type_or_types().' - assert str(e.value) == msg.format(DEFAULT_PRIMARY_KEY_NAME) - - Model(database, 'valid-primary-key') - -def test_model_with_primarykey(): - database = Database(get_database_backend(BackendEnum.INMEMORY)) - - with pytest.raises(AttributeError) as e: - class WrongTestModel(Model): # pylint: disable=unused-variable - pk = PrimaryKeyField() - name = StringField(min_length=1) - age = IntegerField(min_value=0) - salary = FloatField(min_value=0.0) - active = BooleanField() - pk2 = PrimaryKeyField() - assert str(e.value) == 'PrimaryKeyField for Model(WrongTestModel) already set to attribute(pk)' - - class GenderEnum(Enum): - FEMALE = 'female' - MALE = 'male' - - class TestModel(Model): - pk = PrimaryKeyField() - name = StringField(min_length=1) - age = IntegerField(min_value=0) - salary = FloatField(min_value=0.0) - active = BooleanField() - gender = EnumeratedField(GenderEnum) - - backend_key_instances = TestModel.get_backend_key_instances() - backend_key_instance = TestModel.get_backend_key_instance('pk') - backend_key_references = TestModel.get_backend_key_references('pk') - - assert backend_key_instances == 'TestModel/instances' - assert backend_key_instance == 'TestModel[pk]' - assert backend_key_references == 'TestModel[pk]/references' - - assert TestModel.get_backend_key_lock(backend_key_instances ) == 'TestModel/instances/lock' - assert TestModel.get_backend_key_lock(backend_key_instance ) == 'TestModel[pk]/lock' - assert TestModel.get_backend_key_lock(backend_key_references) == 'TestModel[pk]/references/lock' - - with pytest.raises(ValueError) as e: - TestModel(database, None) - assert str(e.value) == 'pk(None) is required. It cannot be None.' - - with pytest.raises(ValueError) as e: - TestModel(database, '') - assert str(e.value) == 'pk() is out of range: allow_empty(False).' - - obj = TestModel(database, 'valid-pk') - assert obj is not None - - with pytest.raises(ValueError) as e: - obj.pk = 'another-valid-pk' - assert str(e.value) == 'PrimaryKeyField cannot be modified' - -def test_model_with_primarykey_and_attributes(): - database = Database(get_database_backend(BackendEnum.INMEMORY)) - - class GenderEnum(Enum): - FEMALE = 'female' - MALE = 'male' - - with pytest.raises(AttributeError) as e: - class BadTestModel(Model): - pk_auto = StringField() # field using default name of primary key - name = StringField(min_length=5, max_length=10) - age = IntegerField(min_value=0) - salary = FloatField(min_value=0.0) - active = BooleanField() - gender = EnumeratedField(GenderEnum) - - msg = 'PrimaryKeyField for Model(BadTestModel) not defined and attribute "pk_auto" already used. '\ - 'Leave attribute name "pk_auto" for automatic PrimaryKeyField, or set a PrimaryKeyField.' - assert str(e.value) == msg - - class TestModel(Model): - pk = PrimaryKeyField() - name = StringField(min_length=5, max_length=10) - age = IntegerField(min_value=0) - salary = FloatField(min_value=0.0) - active = BooleanField() - gender = EnumeratedField(GenderEnum) - - obj = TestModel(database, 'valid-pk') - assert obj is not None - - with pytest.raises(AttributeError) as e: - del obj.name - assert str(e.value) == 'Attribute "name" cannot be deleted' - - with pytest.raises(TypeError) as e: - obj.name = 55 - assert str(e.value) == "name(55) is of a wrong type(int). Accepted type_or_types()." - - with pytest.raises(TypeError) as e: - obj.name = 55.5 - assert str(e.value) == "name(55.5) is of a wrong type(float). Accepted type_or_types()." - - with pytest.raises(TypeError) as e: - obj.name = True - assert str(e.value) == "name(True) is of a wrong type(bool). Accepted type_or_types()." - - with pytest.raises(TypeError) as e: - obj.age = 'too old' - assert str(e.value) == "age(too old) is of a wrong type(str). Accepted type_or_types()." - - with pytest.raises(TypeError) as e: - obj.age = 37.5 - assert str(e.value) == "age(37.5) is of a wrong type(float). Accepted type_or_types()." - - with pytest.raises(TypeError) as e: - obj.salary = 'too high' - msg = "salary(too high) is of a wrong type(str). Accepted type_or_types((, ))." - assert str(e.value) == msg - - with pytest.raises(TypeError) as e: - obj.active = 'active' - assert str(e.value) == "active(active) is of a wrong type(str). Accepted type_or_types()." - - with pytest.raises(TypeError) as e: - obj.active = 27 - assert str(e.value) == "active(27) is of a wrong type(int). Accepted type_or_types()." - - with pytest.raises(TypeError) as e: - obj.active = 92.5 - assert str(e.value) == "active(92.5) is of a wrong type(float). Accepted type_or_types()." - - with pytest.raises(ValueError) as e: - obj.name = '' - assert str(e.value) == 'name() is out of range: allow_empty(False).' - - with pytest.raises(ValueError) as e: - obj.name = 'John' - assert str(e.value) == 'name(John) is out of range: min_length(5).' - - with pytest.raises(ValueError) as e: - obj.name = 'John Smith Willson' - assert str(e.value) == 'name(John Smith Willson) is out of range: max_value(10).' - - with pytest.raises(TypeError) as e: - obj.gender = 51 - assert str(e.value) == "gender(51) is of a wrong type(int). Accepted type_or_types()." - - with pytest.raises(TypeError) as e: - obj.gender = 55.5 - assert str(e.value) == "gender(55.5) is of a wrong type(float). Accepted type_or_types()." - - with pytest.raises(TypeError) as e: - obj.gender = False - assert str(e.value) == "gender(False) is of a wrong type(bool). Accepted type_or_types()." - - with pytest.raises(TypeError) as e: - obj.gender = 'male' - assert str(e.value) == "gender(male) is of a wrong type(str). Accepted type_or_types()." - - obj.name = 'John Smith' - obj.age = 37 - obj.salary = 5023.52 - obj.active = True - obj.gender = GenderEnum.MALE - assert repr(obj) == "TestModel(pk='valid-pk'(PK), name='John Smith', age=37, salary=5023.52, active=True, "\ - "gender=)" - -def test_model_database_operations(): - database = Database(get_database_backend(BackendEnum.INMEMORY)) - - class GenderEnum(Enum): - FEMALE = 'female' - MALE = 'male' - - class TestModel(Model): - pk = PrimaryKeyField() - name = StringField(min_length=5, max_length=30) - age = IntegerField(min_value=0, required=True) - salary = FloatField(min_value=0.0) - active = BooleanField() - gender = EnumeratedField(GenderEnum) - - obj_john = TestModel(database, 'john') - assert obj_john is not None - - obj_john.name = 'John Smith' - obj_john.salary = 5023.52 - obj_john.active = True - assert repr(obj_john) == "TestModel(pk='john'(PK), name='John Smith', age=None, salary=5023.52, active=True, "\ - "gender=None)" - - with pytest.raises(ValueError) as e: - obj_john.save() - assert str(e.value) == 'age(None) is required. It cannot be None.' - - obj_john.age = 37 - assert repr(obj_john) == "TestModel(pk='john'(PK), name='John Smith', age=37, salary=5023.52, active=True, "\ - "gender=None)" - - with pytest.raises(ValueError) as e: - obj_john.save() - assert str(e.value) == 'gender(None) is required. It cannot be None.' - - obj_john.gender = GenderEnum.MALE - obj_john.save() - - db_entries = database.dump() - assert len(db_entries) == 2 - assert db_entries[0] == ( - 'set', 'TestModel/instances', - "{'TestModel[john]'}") - assert db_entries[1] == ( - 'dict', 'TestModel[john]', - "{'active': 'True', 'age': '37', 'gender': 'MALE', 'name': 'John Smith', 'pk': 'john', "\ - "'salary': '5023.52'}") - - obj_john2 = TestModel(database, 'john', auto_load=False) - assert obj_john2 is not None - assert repr(obj_john2) == "TestModel(pk='john'(PK), name=None, age=None, salary=None, active=None, gender=None)" - obj_john2.load() - assert repr(obj_john2) == "TestModel(pk='john'(PK), name='John Smith', age=37, salary=5023.52, active=True, "\ - "gender=)" - - obj_john2 = TestModel(database, 'john', auto_load=True) - assert obj_john2 is not None - assert repr(obj_john2) == "TestModel(pk='john'(PK), name='John Smith', age=37, salary=5023.52, active=True, "\ - "gender=)" - - obj_john2.delete() - assert len(database.dump()) == 0 - - obj_john2.save() - - db_entries = database.dump() - LOGGER.info('----- Database Dump [{:3d} entries] -------------------------'.format(len(db_entries))) - for db_entry in db_entries: - LOGGER.info(' [{:>4s}] {:40s} :: {:s}'.format(*db_entry)) - LOGGER.info('-----------------------------------------------------------') - assert len(db_entries) == 2 - assert db_entries[0] == ( - 'set', 'TestModel/instances', - "{'TestModel[john]'}") - assert db_entries[1] == ( - 'dict', 'TestModel[john]', - "{'active': 'True', 'age': '37', 'gender': 'MALE', 'name': 'John Smith', 'pk': 'john', "\ - "'salary': '5023.52'}") - - - obj_jane = TestModel(database, 'jane', auto_load=True) - obj_jane.name = 'Jane Willson' - obj_jane.age = 26 - obj_jane.salary = 6071.72 - obj_jane.active = True - obj_jane.gender = GenderEnum.FEMALE - assert repr(obj_jane) == "TestModel(pk='jane'(PK), name='Jane Willson', age=26, salary=6071.72, active=True, "\ - "gender=)" - obj_jane.save() - - obj_julia = TestModel(database, 'julia', auto_load=True) - obj_julia.name = 'Julia Simons' - obj_julia.age = 42 - obj_julia.salary = 5451.13 - obj_julia.active = True - obj_julia.gender = GenderEnum.FEMALE - assert repr(obj_julia) == "TestModel(pk='julia'(PK), name='Julia Simons', age=42, salary=5451.13, active=True, "\ - "gender=)" - obj_julia.save() - - db_entries = database.dump() - LOGGER.info('----- Database Dump [{:3d} entries] -------------------------'.format(len(db_entries))) - for db_entry in db_entries: - LOGGER.info(' [{:>4s}] {:40s} :: {:s}'.format(*db_entry)) - LOGGER.info('-----------------------------------------------------------') - - test_model_pks = sorted(TestModel.get_primary_keys(database)) - assert len(test_model_pks) == 3 - assert test_model_pks[0] == 'TestModel[jane]' - assert test_model_pks[1] == 'TestModel[john]' - assert test_model_pks[2] == 'TestModel[julia]' - - database.clear_all() - assert len(database.dump()) == 0 - -def test_model_foreignkeys(): - database = Database(get_database_backend(BackendEnum.INMEMORY)) - - class GenderEnum(Enum): - FEMALE = 'female' - MALE = 'male' - - class Team(Model): - pk = PrimaryKeyField() - name = StringField(max_length=10, required=True) - - class Workplace(Model): - pk = PrimaryKeyField() - name = StringField(max_length=10, required=True) - - class Member(Model): - pk = PrimaryKeyField() - team = ForeignKeyField(Team) - place = ForeignKeyField(Workplace, required=False) - name = StringField(max_length=10, required=True) - gender = EnumeratedField(GenderEnum) - - team_dev_ops = Team(database, 'dev-ops') - team_dev_ops.name = 'Dev Ops' - assert team_dev_ops is not None - assert repr(team_dev_ops) == "Team(pk='dev-ops'(PK), name='Dev Ops')" - - workplace_bcn = Workplace(database, 'bcn') - workplace_bcn.name = 'Barcelona' - assert workplace_bcn is not None - assert repr(workplace_bcn) == "Workplace(pk='bcn'(PK), name='Barcelona')" - - member_john = Member(database, 'john') - member_john.name = 'John' - member_john.team = team_dev_ops - member_john.place = workplace_bcn - assert member_john is not None - assert repr(member_john) == "Member(pk='john'(PK), team='Team[dev-ops]', place='Workplace[bcn]', name='John', "\ - "gender=None)" - - with pytest.raises(ValueError) as e: - member_john.save() - assert str(e.value) == 'gender(None) is required. It cannot be None.' - - member_john.gender = GenderEnum.MALE - - with pytest.raises(ConstraintException) as e: - member_john.save() - assert str(e.value) == 'Required Keys (Team[dev-ops], Workplace[bcn]) does not exist' - - workplace_bcn.save() - assert repr(Workplace(database, workplace_bcn.pk)) == "Workplace(pk='bcn'(PK), name='Barcelona')" - - with pytest.raises(ConstraintException) as e: - member_john.save() - assert str(e.value) == 'Required Keys (Team[dev-ops]) does not exist' - - team_dev_ops.save() - assert repr(Team(database, team_dev_ops.pk)) == "Team(pk='dev-ops'(PK), name='Dev Ops')" - - member_john.save() - assert repr(Member(database, member_john.pk)) == \ - "Member(pk='john'(PK), team='Team[dev-ops]', place='Workplace[bcn]', name='John', "\ - "gender=)" - - with pytest.raises(ConstraintException) as e: - workplace_bcn.delete() - assert str(e.value) == 'Instance is used by Keys (Member[john]:place)' - - with pytest.raises(ConstraintException) as e: - team_dev_ops.delete() - assert str(e.value) == 'Instance is used by Keys (Member[john]:team)' - - workplace_mad = Workplace(database, 'mad') - workplace_mad.name = 'Madrid' - assert workplace_mad is not None - assert repr(workplace_mad) == "Workplace(pk='mad'(PK), name='Madrid')" - - member_john = Member(database, 'john') - member_john.name = 'John' - member_john.place = workplace_mad - assert member_john is not None - assert repr(member_john) == \ - "Member(pk='john'(PK), team='Team[dev-ops]', place='Workplace[mad]', name='John', "\ - "gender=)" - - with pytest.raises(ConstraintException) as e: - member_john.save() - assert str(e.value) == 'Required Keys (Workplace[mad]) does not exist' - - workplace_mad.save() - assert repr(Workplace(database, workplace_mad.pk)) == "Workplace(pk='mad'(PK), name='Madrid')" - - member_john.save() - - member_john = Member(database, 'john') - - with pytest.raises(ValueError) as e: - del member_john.place - del member_john.team - assert str(e.value) == 'team(None) is required. It cannot be None.' - - - member_jane = Member(database, 'jane') - member_jane.name = 'Jane' - member_jane.place = workplace_mad - assert member_jane is not None - assert repr(member_jane) == "Member(pk='jane'(PK), team=None, place='Workplace[mad]', name='Jane', gender=None)" - - with pytest.raises(ValueError) as e: - member_jane.save() - assert str(e.value) == 'team(None) is required. It cannot be None.' - - member_jane.team = team_dev_ops - - with pytest.raises(ValueError) as e: - member_jane.save() - assert str(e.value) == 'gender(None) is required. It cannot be None.' - - member_jane.gender = GenderEnum.FEMALE - - member_jane.save() - assert repr(Member(database, member_jane.pk)) == \ - "Member(pk='jane'(PK), team='Team[dev-ops]', place='Workplace[mad]', name='Jane', "\ - "gender=)" - - member_brad = Member(database, 'brad') - assert member_brad is not None - assert repr(member_brad) == "Member(pk='brad'(PK), team=None, place=None, name=None, gender=None)" - - with pytest.raises(ValueError) as e: - member_brad.save() - assert str(e.value) == 'team(None) is required. It cannot be None.' - - member_brad.team = team_dev_ops - - with pytest.raises(ValueError) as e: - member_brad.save() - assert str(e.value) == 'name(None) is required. It cannot be None.' - - member_brad.name = 'Brad' - assert repr(member_brad) == "Member(pk='brad'(PK), team=\'Team[dev-ops]\', place=None, name='Brad', gender=None)" - - with pytest.raises(ValueError) as e: - member_brad.save() - assert str(e.value) == 'gender(None) is required. It cannot be None.' - - member_brad.gender = GenderEnum.MALE - - member_brad.save() - assert repr(Member(database, member_brad.pk)) == \ - "Member(pk='brad'(PK), team='Team[dev-ops]', place=None, name='Brad', gender=)" - - team_admin = Team(database, 'admin') - team_admin.name = 'Admin' - team_admin.save() - assert repr(Team(database, team_admin.pk)) == "Team(pk='admin'(PK), name='Admin')" - - member_brad = Member(database, member_brad.pk) - assert repr(member_brad) == \ - "Member(pk='brad'(PK), team='Team[dev-ops]', place=None, name='Brad', gender=)" - member_brad.team = team_admin - assert repr(member_brad) == \ - "Member(pk='brad'(PK), team='Team[admin]', place=None, name='Brad', gender=)" - member_brad.save() - assert repr(Member(database, member_brad.pk)) == \ - "Member(pk='brad'(PK), team='Team[admin]', place=None, name='Brad', gender=)" - - references = sorted(team_dev_ops.references()) - assert len(references) == 2 - assert references[0] == ('Member[jane]', 'team') - assert references[1] == ('Member[john]', 'team') - - references = sorted(workplace_bcn.references()) - assert len(references) == 0 - - references = sorted(workplace_mad.references()) - assert len(references) == 2 - assert references[0] == ('Member[jane]', 'place') - assert references[1] == ('Member[john]', 'place') - - references = sorted(workplace_mad.references('Member')) - assert len(references) == 2 - assert references[0] == ('Member[jane]', 'place') - assert references[1] == ('Member[john]', 'place') - - references = sorted(workplace_mad.references({'Member'})) - assert len(references) == 2 - assert references[0] == ('Member[jane]', 'place') - assert references[1] == ('Member[john]', 'place') - - references = sorted(workplace_mad.references(['Member'])) - assert len(references) == 2 - assert references[0] == ('Member[jane]', 'place') - assert references[1] == ('Member[john]', 'place') - - references = sorted(workplace_mad.references(('Member',))) - assert len(references) == 2 - assert references[0] == ('Member[jane]', 'place') - assert references[1] == ('Member[john]', 'place') - - references = sorted(workplace_mad.references(Member)) - assert len(references) == 2 - assert references[0] == ('Member[jane]', 'place') - assert references[1] == ('Member[john]', 'place') - - references = sorted(workplace_mad.references({Member})) - assert len(references) == 2 - assert references[0] == ('Member[jane]', 'place') - assert references[1] == ('Member[john]', 'place') - - references = sorted(workplace_mad.references([Member])) - assert len(references) == 2 - assert references[0] == ('Member[jane]', 'place') - assert references[1] == ('Member[john]', 'place') - - references = sorted(workplace_mad.references((Member,))) - assert len(references) == 2 - assert references[0] == ('Member[jane]', 'place') - assert references[1] == ('Member[john]', 'place') - - references = sorted(workplace_mad.references({'non-existing-model'})) - assert len(references) == 0 - - with pytest.raises(AttributeError) as e: - references = sorted(workplace_mad.references(7)) - assert str(e.value) == 'filter_by_models(7) unsupported. Expected a type or a list/set of types. '\ - 'Optionally, keep it as None to retrieve all the references pointing to this instance.' - - with pytest.raises(AttributeError) as e: - references = sorted(workplace_mad.references({7})) - assert str(e.value) == 'filter_by_models({7}) unsupported. Expected a type or a list/set of types. '\ - 'Optionally, keep it as None to retrieve all the references pointing to this instance.' - - db_entries = database.dump() - LOGGER.info('----- Database Dump [{:3d} entries] -------------------------'.format(len(db_entries))) - for db_entry in db_entries: - LOGGER.info(' [{:>4s}] {:40s} :: {:s}'.format(*db_entry)) - LOGGER.info('-----------------------------------------------------------') - - assert len(db_entries) == 13 - assert db_entries[ 0] == ('set', "Member/instances", - "{'Member[brad]', 'Member[jane]', 'Member[john]'}") - assert db_entries[ 1] == ('dict', "Member[brad]", - "{'gender': 'MALE', 'name': 'Brad', 'pk': 'brad', 'team': 'Team[admin]'}") - assert db_entries[ 2] == ('dict', "Member[jane]", - "{'gender': 'FEMALE', 'name': 'Jane', 'pk': 'jane', 'place': 'Workplace[mad]', "\ - "'team': 'Team[dev-ops]'}") - assert db_entries[ 3] == ('dict', "Member[john]", - "{'gender': 'MALE', 'name': 'John', 'pk': 'john', 'place': 'Workplace[mad]', "\ - "'team': 'Team[dev-ops]'}") - assert db_entries[ 4] == ('set', "Team/instances", - "{'Team[admin]', 'Team[dev-ops]'}") - assert db_entries[ 5] == ('dict', "Team[admin]", - "{'name': 'Admin', 'pk': 'admin'}") - assert db_entries[ 6] == ('set' , "Team[admin]/references", - "{'Member[brad]:team'}") - assert db_entries[ 7] == ('dict', "Team[dev-ops]", - "{'name': 'Dev Ops', 'pk': 'dev-ops'}") - assert db_entries[ 8] == ('set' , "Team[dev-ops]/references", - "{'Member[jane]:team', 'Member[john]:team'}") - assert db_entries[ 9] == ('set', "Workplace/instances", - "{'Workplace[bcn]', 'Workplace[mad]'}") - assert db_entries[10] == ('dict', "Workplace[bcn]", - "{'name': 'Barcelona', 'pk': 'bcn'}") - assert db_entries[11] == ('dict', "Workplace[mad]", - "{'name': 'Madrid', 'pk': 'mad'}") - assert db_entries[12] == ('set' , "Workplace[mad]/references", - "{'Member[jane]:place', 'Member[john]:place'}") - - Member(database, member_john.pk).delete() - - db_entries = database.dump() - LOGGER.info('----- Database Dump [{:3d} entries] -------------------------'.format(len(db_entries))) - for db_entry in db_entries: - LOGGER.info(' [{:>4s}] {:40s} :: {:s}'.format(*db_entry)) - LOGGER.info('-----------------------------------------------------------') - - assert len(db_entries) == 12 - assert db_entries[ 0] == ('set', "Member/instances", - "{'Member[brad]', 'Member[jane]'}") - assert db_entries[ 1] == ('dict', 'Member[brad]', - "{'gender': 'MALE', 'name': 'Brad', 'pk': 'brad', 'team': 'Team[admin]'}") - assert db_entries[ 2] == ('dict', 'Member[jane]', - "{'gender': 'FEMALE', 'name': 'Jane', 'pk': 'jane', 'place': 'Workplace[mad]', "\ - "'team': 'Team[dev-ops]'}") - assert db_entries[ 3] == ('set', "Team/instances", - "{'Team[admin]', 'Team[dev-ops]'}") - assert db_entries[ 4] == ('dict', 'Team[admin]', - "{'name': 'Admin', 'pk': 'admin'}") - assert db_entries[ 5] == ('set', 'Team[admin]/references', - "{'Member[brad]:team'}") - assert db_entries[ 6] == ('dict', 'Team[dev-ops]', - "{'name': 'Dev Ops', 'pk': 'dev-ops'}") - assert db_entries[ 7] == ('set', 'Team[dev-ops]/references', - "{'Member[jane]:team'}") - assert db_entries[ 8] == ('set', "Workplace/instances", - "{'Workplace[bcn]', 'Workplace[mad]'}") - assert db_entries[ 9] == ('dict', 'Workplace[bcn]', - "{'name': 'Barcelona', 'pk': 'bcn'}") - assert db_entries[10] == ('dict', 'Workplace[mad]', - "{'name': 'Madrid', 'pk': 'mad'}") - assert db_entries[11] == ('set', 'Workplace[mad]/references', - "{'Member[jane]:place'}") diff --git a/src/dlt/connector/tests/PrepareTestScenario.py b/src/dlt/connector/tests/PrepareTestScenario.py index 5c5d1cb5c..0bddea071 100644 --- a/src/dlt/connector/tests/PrepareTestScenario.py +++ b/src/dlt/connector/tests/PrepareTestScenario.py @@ -12,98 +12,98 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os, pytest -from typing import Tuple -from common.Constants import ServiceNameEnum -from common.Settings import ( - ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name, get_service_port_grpc) -from common.orm.Database import Database -from common.orm.Factory import get_database_backend, BackendEnum as DatabaseBackendEnum -from common.message_broker.Factory import get_messagebroker_backend, BackendEnum as MessageBrokerBackendEnum -from common.message_broker.MessageBroker import MessageBroker -from context.client.ContextClient import ContextClient -from context.service.grpc_server.ContextService import ContextService -from dlt.connector.client.DltConnectorClient import DltConnectorClient -from dlt.connector.service.DltConnectorService import DltConnectorService -from .MockService_Dependencies import MockService_Dependencies - -LOCAL_HOST = '127.0.0.1' -MOCKSERVICE_PORT = 10000 -#GRPC_PORT = 10000 + get_service_port_grpc(ServiceNameEnum.CONTEXT) # avoid privileged ports -#os.environ[get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_HOST )] = str(LOCAL_HOST) -#os.environ[get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_PORT_GRPC)] = str(GRPC_PORT) - -# ===== BlockChain Emulator (Mock DLT Gateway) ========================================================================= -# A single gateway is used for all the domains - -@pytest.fixture(scope='session') -def dltgateway_service(): - _service = MockService_Dependencies(MOCKSERVICE_PORT) - _service.configure_env_vars() - _service.start() - yield _service - _service.stop() - -# ===== Domain A (Real Context + Real DLT Connector) =================================================================== - -@pytest.fixture(scope='session') -def context_service_a(): # pylint: disable=redefined-outer-name - _database = Database(get_database_backend(backend=DatabaseBackendEnum.INMEMORY)) - _message_broker = MessageBroker(get_messagebroker_backend(backend=MessageBrokerBackendEnum.INMEMORY)) - _service = ContextService(_database, _message_broker) - _service.start() - yield _service - _service.stop() - _message_broker.terminate() - -@pytest.fixture(scope='session') -def context_client_a(context_service_a : ContextService): # pylint: disable=redefined-outer-name - _client = ContextClient(host=context_service_a.bind_address, port=context_service_a.bind_port) - yield _client - _client.close() - -@pytest.fixture(scope='session') -def dltconnector_service_a(): - _service = DltConnectorService() - _service.bind_port += 1 - _service.start() - yield _service - _service.stop() - -@pytest.fixture(scope='session') -def dltconnector_client_a(dltconnector_service_a : DltConnectorService): # pylint: disable=redefined-outer-name - _client = DltConnectorClient(host=dltconnector_service_a.bind_address, port=dltconnector_service_a.bind_port) - yield _client - _client.close() - -# ===== Domain B (Real Context + Real DLT Connector) =================================================================== - -@pytest.fixture(scope='session') -def context_service_b(): # pylint: disable=redefined-outer-name - _database = Database(get_database_backend(backend=DatabaseBackendEnum.INMEMORY)) - _message_broker = MessageBroker(get_messagebroker_backend(backend=MessageBrokerBackendEnum.INMEMORY)) - _service = ContextService(_database, _message_broker) - _service.start() - yield _service - _service.stop() - _message_broker.terminate() - -@pytest.fixture(scope='session') -def context_client_b(context_service_b : ContextService): # pylint: disable=redefined-outer-name - _client = ContextClient(host=context_service_b.bind_address, port=context_service_b.bind_port) - yield _client - _client.close() - -@pytest.fixture(scope='session') -def dltconnector_service_b(): - _service = DltConnectorService() - _service.bind_port += 2 - _service.start() - yield _service - _service.stop() - -@pytest.fixture(scope='session') -def dltconnector_client_b(dltconnector_service_b : DltConnectorService): # pylint: disable=redefined-outer-name - _client = DltConnectorClient(host=dltconnector_service_b.bind_address, port=dltconnector_service_b.bind_port) - yield _client - _client.close() +#import os, pytest +#from typing import Tuple +#from common.Constants import ServiceNameEnum +#from common.Settings import ( +# ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name, get_service_port_grpc) +#from common.orm.Database import Database +#from common.orm.Factory import get_database_backend, BackendEnum as DatabaseBackendEnum +#from common.message_broker.Factory import get_messagebroker_backend, BackendEnum as MessageBrokerBackendEnum +#from common.message_broker.MessageBroker import MessageBroker +#from context.client.ContextClient import ContextClient +#from context.service.grpc_server.ContextService import ContextService +#from dlt.connector.client.DltConnectorClient import DltConnectorClient +#from dlt.connector.service.DltConnectorService import DltConnectorService +#from .MockService_Dependencies import MockService_Dependencies +# +#LOCAL_HOST = '127.0.0.1' +#MOCKSERVICE_PORT = 10000 +##GRPC_PORT = 10000 + get_service_port_grpc(ServiceNameEnum.CONTEXT) # avoid privileged ports +##os.environ[get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_HOST )] = str(LOCAL_HOST) +##os.environ[get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_PORT_GRPC)] = str(GRPC_PORT) +# +## ===== BlockChain Emulator (Mock DLT Gateway) ========================================================================= +## A single gateway is used for all the domains +# +#@pytest.fixture(scope='session') +#def dltgateway_service(): +# _service = MockService_Dependencies(MOCKSERVICE_PORT) +# _service.configure_env_vars() +# _service.start() +# yield _service +# _service.stop() +# +## ===== Domain A (Real Context + Real DLT Connector) =================================================================== +# +#@pytest.fixture(scope='session') +#def context_service_a(): # pylint: disable=redefined-outer-name +# _database = Database(get_database_backend(backend=DatabaseBackendEnum.INMEMORY)) +# _message_broker = MessageBroker(get_messagebroker_backend(backend=MessageBrokerBackendEnum.INMEMORY)) +# _service = ContextService(_database, _message_broker) +# _service.start() +# yield _service +# _service.stop() +# _message_broker.terminate() +# +#@pytest.fixture(scope='session') +#def context_client_a(context_service_a : ContextService): # pylint: disable=redefined-outer-name +# _client = ContextClient(host=context_service_a.bind_address, port=context_service_a.bind_port) +# yield _client +# _client.close() +# +#@pytest.fixture(scope='session') +#def dltconnector_service_a(): +# _service = DltConnectorService() +# _service.bind_port += 1 +# _service.start() +# yield _service +# _service.stop() +# +#@pytest.fixture(scope='session') +#def dltconnector_client_a(dltconnector_service_a : DltConnectorService): # pylint: disable=redefined-outer-name +# _client = DltConnectorClient(host=dltconnector_service_a.bind_address, port=dltconnector_service_a.bind_port) +# yield _client +# _client.close() +# +## ===== Domain B (Real Context + Real DLT Connector) =================================================================== +# +#@pytest.fixture(scope='session') +#def context_service_b(): # pylint: disable=redefined-outer-name +# _database = Database(get_database_backend(backend=DatabaseBackendEnum.INMEMORY)) +# _message_broker = MessageBroker(get_messagebroker_backend(backend=MessageBrokerBackendEnum.INMEMORY)) +# _service = ContextService(_database, _message_broker) +# _service.start() +# yield _service +# _service.stop() +# _message_broker.terminate() +# +#@pytest.fixture(scope='session') +#def context_client_b(context_service_b : ContextService): # pylint: disable=redefined-outer-name +# _client = ContextClient(host=context_service_b.bind_address, port=context_service_b.bind_port) +# yield _client +# _client.close() +# +#@pytest.fixture(scope='session') +#def dltconnector_service_b(): +# _service = DltConnectorService() +# _service.bind_port += 2 +# _service.start() +# yield _service +# _service.stop() +# +#@pytest.fixture(scope='session') +#def dltconnector_client_b(dltconnector_service_b : DltConnectorService): # pylint: disable=redefined-outer-name +# _client = DltConnectorClient(host=dltconnector_service_b.bind_address, port=dltconnector_service_b.bind_port) +# yield _client +# _client.close() diff --git a/src/dlt/connector/tests/test_unitary.py b/src/dlt/connector/tests/test_unitary.py index 00c1164e1..f1424847d 100644 --- a/src/dlt/connector/tests/test_unitary.py +++ b/src/dlt/connector/tests/test_unitary.py @@ -12,43 +12,44 @@ # See the License for the specific language governing permissions and # limitations under the License. -import logging -from typing import Tuple -from common.orm.Database import Database -from common.message_broker.MessageBroker import MessageBroker -from common.proto.context_pb2 import Context, ContextId, Device, DeviceId, Link, LinkId, Topology, TopologyId -from context.client.ContextClient import ContextClient -from .PrepareTestScenario import ( - # pylint: disable=unused-import - dltgateway_service, - context_service_a, context_client_a, dltconnector_service_a, dltconnector_client_a, - context_service_b, context_client_b, dltconnector_service_b, dltconnector_client_b) -from .Objects import ( - DA_CONTEXTS, DA_TOPOLOGIES, DA_DEVICES, DA_LINKS, - DB_CONTEXTS, DB_TOPOLOGIES, DB_DEVICES, DB_LINKS) - -LOGGER = logging.getLogger(__name__) -LOGGER.setLevel(logging.DEBUG) - -def test_create_events( - context_client : ContextClient, # pylint: disable=redefined-outer-name - context_db_mb : Tuple[Database, MessageBroker]): # pylint: disable=redefined-outer-name - - for context in CONTEXTS : context_client.SetContext (Context (**context )) - for topology in TOPOLOGIES: context_client.SetTopology(Topology(**topology)) - for device in DEVICES : context_client.SetDevice (Device (**device )) - for link in LINKS : context_client.SetLink (Link (**link )) - - - for link in LINKS : context_client.RemoveLink (LinkId (**link ['link_id' ])) - for device in DEVICES : context_client.RemoveDevice (DeviceId (**device ['device_id' ])) - for topology in TOPOLOGIES: context_client.RemoveTopology(TopologyId(**topology['topology_id'])) - for context in CONTEXTS : context_client.RemoveContext (ContextId (**context ['context_id' ])) - - - - dltgateway_client = DltGatewayClient(host='127.0.0.1', port=50051) - dltgateway_collector = DltEventsCollector(dltgateway_client, log_events_received=True) - dltgateway_collector.start() - - dltgateway_collector.stop() +#import logging +#from typing import Tuple +#from common.orm.Database import Database +#from common.message_broker.MessageBroker import MessageBroker +#from common.proto.context_pb2 import Context, ContextId, Device, DeviceId, Link, LinkId, Topology, TopologyId +#from context.client.ContextClient import ContextClient +#from .PrepareTestScenario import ( +# # pylint: disable=unused-import +# dltgateway_service, +# context_service_a, context_client_a, dltconnector_service_a, dltconnector_client_a, +# context_service_b, context_client_b, dltconnector_service_b, dltconnector_client_b) +#from .Objects import ( +# DA_CONTEXTS, DA_TOPOLOGIES, DA_DEVICES, DA_LINKS, +# DB_CONTEXTS, DB_TOPOLOGIES, DB_DEVICES, DB_LINKS) +# +#LOGGER = logging.getLogger(__name__) +#LOGGER.setLevel(logging.DEBUG) +# +#def test_create_events( +# context_client : ContextClient, # pylint: disable=redefined-outer-name +# context_db_mb : Tuple[Database, MessageBroker]): # pylint: disable=redefined-outer-name +# +# for context in CONTEXTS : context_client.SetContext (Context (**context )) +# for topology in TOPOLOGIES: context_client.SetTopology(Topology(**topology)) +# for device in DEVICES : context_client.SetDevice (Device (**device )) +# for link in LINKS : context_client.SetLink (Link (**link )) +# +# +# for link in LINKS : context_client.RemoveLink (LinkId (**link ['link_id' ])) +# for device in DEVICES : context_client.RemoveDevice (DeviceId (**device ['device_id' ])) +# for topology in TOPOLOGIES: context_client.RemoveTopology(TopologyId(**topology['topology_id'])) +# for context in CONTEXTS : context_client.RemoveContext (ContextId (**context ['context_id' ])) +# +# +# +# dltgateway_client = DltGatewayClient(host='127.0.0.1', port=50051) +# dltgateway_collector = DltEventsCollector(dltgateway_client, log_events_received=True) +# dltgateway_collector.start() +# +# dltgateway_collector.stop() +# \ No newline at end of file diff --git a/tutorial/1-0-deployment.md b/tutorial/1-0-deployment.md deleted file mode 100644 index 6aa46aab7..000000000 --- a/tutorial/1-0-deployment.md +++ /dev/null @@ -1,14 +0,0 @@ -# 1. Deployment Guide - -This section walks you through the process of deploying TeraFlowSDN on top of a Virtual -Machine (VM) running [MicroK8s Kubernetes platform](https://microk8s.io). -The guide includes the details on configuring and installing the VM, installing and -configuring MicroK8s, and deploying and reporting the status of the TeraFlowSDN -controller. - -## Table of Content: -- [1.1. Create VM for the TeraFlowSDN controller](./1-1-create-vm.md) -- [1.2. Install MicroK8s Kubernetes platform](./1-2-install-microk8s.md) -- [1.3. Deploy TeraFlowSDN over MicroK8s](./1-3-deploy-tfs.md) -- [1.4. Access TeraFlowSDN WebUI and Grafana Dashboards](./1-4-access-webui.md) -- [1.5. Show Deployment and Log per Component](./1-5-deploy-logs-troubleshooting.md) diff --git a/tutorial/1-1-1-create-vm-oracle-virtualbox.md b/tutorial/1-1-1-create-vm-oracle-virtualbox.md deleted file mode 100644 index 0a074d56a..000000000 --- a/tutorial/1-1-1-create-vm-oracle-virtualbox.md +++ /dev/null @@ -1,94 +0,0 @@ -## 1.1.1. Oracle VirtualBox - -### 1.1.1.1. Create a NAT Network in VirtualBox -In "Oracle VM VirtualBox Manager", Menu "File > Preferences... > Network", create a NAT -network with the following specifications: - -|Name |CIDR |DHCP |IPv6 | -|-----------|-----------|--------|--------| -|TFS-NAT-Net|10.0.2.0/24|Disabled|Disabled| - -Within the newly created "TFS-NAT-Net" NAT network, configure the following IPv4 -forwarding rules: - -|Name|Protocol|Host IP |Host Port|Guest IP |Guest Port| -|----|--------|---------|---------|---------|----------| -|SSH |TCP |127.0.0.1|2200 |10.0.2.10|22 | -|HTTP|TCP |127.0.0.1|8080 |10.0.2.10|80 | - -__Note__: IP address 10.0.2.10 is the one that will be assigned to the VM. - - -### 1.1.1.2. Create VM in VirtualBox: - -- Name: TFS-VM -- Type/Version: Linux / Ubuntu (64-bit) -- CPU (*): 4 vCPUs @ 100% execution capacity -- RAM: 8 GB -- Disk: 40 GB, Virtual Disk Image (VDI), Dynamically allocated -- Optical Drive ISO Image: "ubuntu-20.04.4-live-server-amd64.iso" - - Download the file "ubuntu-20.04.4-live-server-amd64.iso" from [Ubuntu 20.04 LTS](https://releases.ubuntu.com/20.04/). - - __Note__: use Ubuntu Server image instead of Ubuntu Desktop to create a lightweight VM. -- Network Adapter 1 (*): enabled, attached to NAT Network "TFS-NAT-Net" -- Minor adjustments (*): - - Audio: disabled - - Boot otder: disable "Floppy" - -__Note__: (*) settings to be editing after the VM is created. - -### 1.1.1.3. Install Ubuntu 20.04 LTS Operating System -In "Oracle VM VirtualBox Manager", start the VM in normal mode, and follow the -installation procedure. -Below we provide some installation guidelines: -- Installation Language: English -- Autodetect your keyboard -- Configure static network specifications: - -|Interface|IPv4 Method|Subnet |Address |Gateway |Name servers |Search domains| -|---------|-----------|-----------|---------|--------|---------------|--------------| -|enp0s3 |Manual |10.0.2.0/24|10.0.2.10|10.0.2.1|8.8.8.8,8.8.4.4| | - -- Leave proxy and mirror addresses as they are -- Let the installer self-upgrade (if asked). At the time of writing this walkthrough, the version of the installer is 22.06.1. Anyway, Ubuntu 20.04 LTS OS will be installed. -- Use an entire disk for the installation - - Disable setup of the disk as LVM group - - Double check that NO swap space is allocated in the partition table. Kubernetes does not work properly with SWAP. -- Configure your user and system names: - - User name: TeraFlowSDN - - Server's name: tfs-vm - - Username: tfs - - Password: tfs123 -- Install Open SSH Server - - Import SSH keys, if any. -- Featured Server Snaps - - Do not install featured server snaps. It will be done manually later to illustrate how to uninstall and reinstall - them in case of trouble with. -- Let the system install and upgrade the packages. - - This operation might take some minutes depending on how old is the Optical Drive ISO image you use and your - Internet connection speed. -- Restart the VM when the installation is completed. - -## 1.1.1.4. Upgrade the Ubuntu distribution -```bash -sudo apt-get update -y -sudo apt-get dist-upgrade -y -``` - -## 1.1.1.5. Install VirtualBox Guest Additions -On VirtualBox Manager, open the VM main screen. If you are running the VM in headless -mode, right click over the VM in the VirtualBox Manager window and click "Show". -If a dialog informing about how to leave the interface of the VM is shown, confirm -pressing "Switch" button. The interface of the VM should appear. - -Click menu "Device > Insert Guest Additions CD image..." - -On the VM terminal, type: -```bash -sudo apt-get install -y linux-headers-$(uname -r) build-essential dkms - # This command might take some minutes depending on your VM specs and your Internet access speed. -sudo mount /dev/cdrom /mnt/ -cd /mnt/ -sudo ./VBoxLinuxAdditions.run - # This command might take some minutes depending on your VM specs. -sudo reboot -``` diff --git a/tutorial/1-1-2-create-vm-vmware-fusion.md b/tutorial/1-1-2-create-vm-vmware-fusion.md deleted file mode 100644 index 7147c24af..000000000 --- a/tutorial/1-1-2-create-vm-vmware-fusion.md +++ /dev/null @@ -1,54 +0,0 @@ -## 1.1.2. VMWare Fusion - -### 1.1.2.1. Create VM in VMWare Fusion: - -In "VMWare Fusion" manager, create a new network from the "Settings/Network" menu. - -- Unlock to make changes -- Press the + icon and create a new network -- Change the name to TFS-NAT-Net -- Check "Allow virtual machines on this networkto connect to external network (NAT)" -- Do not check "Enable IPv6" -- Add port forwarding for HTTP and SSH -- Uncheck "Provide address on this network via DHCP" - -Create a new VM an Ubuntu 20.04 iso: - -- Display Name: TeraFlowSDN -- Username: tfs -- Password: tfs123 - -On the next screen press "Customize Settings", save the VM and in "Settings" change: -- Change to use 4 CPUs -- Change to access 8 GB of RAM -- Change disk to size 40 GB -- Change the network interface to use the previously created TFS-NAT-Net - -Run the VM to start the installation. - -### 1.1.2.2. Install Ubuntu 20.04 LTS Operating System - -The installation will be automatic, without any configuration required. - -- Configure the guest ip, gateway and DNS: - - Using the Network Settings for the wired connection, set the IP to 10.0.2.10, - the mask to 255.255.255.0, the gatway to 10.0.2.2 and the DNS to 10.0.2.2. - -- Disable and remove swap file: - - $ sudo swapoff -a - $ sudo rm /swapfile - - Then you can remove or comment the /swapfile entry in /etc/fstab - -- Install Open SSH Server - - Import SSH keys, if any. - -- Restart the VM when the installation is completed. - -### 1.1.2.3. Upgrade the Ubuntu distribution -```bash -sudo apt-get update -y -sudo apt-get dist-upgrade -y -``` diff --git a/tutorial/1-1-create-vm.md b/tutorial/1-1-create-vm.md deleted file mode 100644 index 6ebed2f19..000000000 --- a/tutorial/1-1-create-vm.md +++ /dev/null @@ -1,17 +0,0 @@ -# 1.1. Create VM for the TeraFlowSDN controller - -In this section, we install a VM to be used as the deployment, execution, and -development environment for the ETSI TeraFlowSDN controller. -If you already have a remote physical server fitting the requirements specified in this -section feel free to use it instead of deploying a local VM. -Other virtualization environments can also be used; in that case, you will need to adapt -these instructions to your particular case. - -Different Hypervisors are considered for that. -Check the table of contents for available options. -If you want to contribute with other Hypervisors, [contact](./README.md#contact) the TFS -team through Slack. - -## Table of Content: -- [1.1.1. Oracle VirtualBox](./1-1-1-create-vm-oracle-virtualbox.md) -- [1.1.2. VMWare Fusion](./1-1-2-create-vm-vmware-fusion.md) diff --git a/tutorial/1-2-install-microk8s.md b/tutorial/1-2-install-microk8s.md deleted file mode 100644 index 1cd14ef6f..000000000 --- a/tutorial/1-2-install-microk8s.md +++ /dev/null @@ -1,165 +0,0 @@ -# 1.2. Install MicroK8s Kubernetes platform - -This section describes how to deploy the MicroK8s Kubernetes platform and configure it -to be used with ETSI TeraFlowSDN controller. -Besides, Docker is installed to build docker images for the ETSI TeraFlowSDN controller. - -The steps described in this section might take some minutes depending on your internet -connection speed and the resources assigned to your VM, or the specifications of your -physical server. - - -## 1.2.1. Upgrade the Ubuntu distribution -Skip this step if you already did it during the creation of the VM. -```bash -sudo apt-get update -y -sudo apt-get dist-upgrade -y -``` - - -## 1.2.2. Install prerequisites -```bash -sudo apt-get install -y ca-certificates curl gnupg lsb-release snapd jq -``` - - -## 1.2.3. Install Docker CE -Install Docker CE -```bash -sudo apt-get install -y docker.io -``` - -Add key "insecure-registries" with the private repository to the daemon configuration. It is done in two commands since -sometimes read from and write to same file might cause trouble. - -```bash -if [ -s /etc/docker/daemon.json ]; then cat /etc/docker/daemon.json; else echo '{}'; fi \ - | jq 'if has("insecure-registries") then . else .+ {"insecure-registries": []} end' -- \ - | jq '."insecure-registries" |= (.+ ["localhost:32000"] | unique)' -- \ - | tee tmp.daemon.json -sudo mv tmp.daemon.json /etc/docker/daemon.json -sudo chown root:root /etc/docker/daemon.json -sudo chmod 600 /etc/docker/daemon.json -``` - -Restart the Docker daemon -```bash -sudo systemctl restart docker -``` - - -## 1.2.4. Install MicroK8s -Ref: https://ubuntu.com/tutorials/install-a-local-kubernetes-with-microk8s -Ref: https://microk8s.io/#install-microk8s - -```bash -# Install MicroK8s -sudo snap install microk8s --classic --channel=1.24/stable - -# Create alias for command "microk8s.kubectl" to be usable as "kubectl" -sudo snap alias microk8s.kubectl kubectl -``` - -It is important to make sure that `ufw` will not interfere with the internal pod-to-pod -and pod-to-Internet traffic. -To do so, first check the status. -If `ufw` is active, use the following command to enable the communication. - -```bash - -# Verify status of ufw firewall -sudo ufw status - -# If ufw is active, install following rules to enable access pod-to-pod and pod-to-internet -sudo ufw allow in on cni0 && sudo ufw allow out on cni0 -sudo ufw default allow routed -``` - - -## 1.2.5. Add user to the docker and microk8s groups - -It is important that your user has the permission to run `docker` and `microk8s` in the -terminal. -To allow this, you need to add your user to the `docker` and `microk8s` groups with the -following commands: - -```bash -sudo usermod -a -G docker $USER -sudo usermod -a -G microk8s $USER -sudo chown -f -R $USER $HOME/.kube -sudo reboot -``` - -In case that the .kube file is not automatically provisioned into your home folder, you -may follow the steps below: - -```bash -mkdir -p $HOME/.kube -sudo chown -f -R $USER $HOME/.kube -microk8s config > $HOME/.kube/config -sudo reboot -``` - -## 1.2.6. Check status of Kubernetes and addons -To retrieve the status of Kubernetes __once__, run the following command: -```bash -microk8s.status --wait-ready -``` - -To retrieve the status of Kubernetes __periodically__ (e.g., every 1 second), run the -following command: -```bash -watch -n 1 microk8s.status --wait-ready -``` - -## 1.2.7. Check all resources in Kubernetes -To retrieve the status of the Kubernetes resources __once__, run the following command: -```bash -kubectl get all --all-namespaces -``` - -To retrieve the status of the Kubernetes resources __periodically__ (e.g., every 1 -second), run the following command: -```bash -watch -n 1 kubectl get all --all-namespaces -``` - -## 1.2.8. Enable addons -The Addons enabled are: -- `dns`: enables resolving the pods and services by name -- `hostpath-storage`: enables providing storage for the pods (required by `registry`) -- `ingress`: deploys an ingress controller to expose the microservices outside Kubernetes -- `registry`: deploys a private registry for the TFS controller images - -```bash -microk8s.enable dns hostpath-storage ingress registry -``` - -__Important__: Enabling some of the addons might take few minutes. -Do not proceed with next steps until the addons are ready. -Otherwise, the deployment might fail. -To confirm everything is up and running: -1. Periodically - [Check the status of Kubernetes](./1-2-install-microk8s.md#126-check-status-of-kubernetes) - until you see the addons [dns, ha-cluster, hostpath-storage, ingress, registry, storage] in the enabled block. -2. Periodically - [Check Kubernetes resources](./1-2-install-microk8s.md#127-check-all-resources-in-kubernetes) - until all pods are __Ready__ and __Running__. - - -## 1.2.9. Stop, Restart, and Redeploy -Find below some additional commands you might need while you work with MicroK8s: -```bash -microk8s.stop # stop MicroK8s cluster (for instance, before power off your computer) -microk8s.start # start MicroK8s cluster -microk8s.reset # reset infrastructure to a clean state -``` - -If the following commands does not work to recover the MicroK8s cluster, you can redeploy it. -First remove the current deployment as follows: -```bash -sudo snap remove microk8s -sudo apt-get remove --purge docker.io -``` - -Then, redeploy as it is described in this section. diff --git a/tutorial/1-3-deploy-tfs.md b/tutorial/1-3-deploy-tfs.md deleted file mode 100644 index ffd9dfe49..000000000 --- a/tutorial/1-3-deploy-tfs.md +++ /dev/null @@ -1,84 +0,0 @@ -# 1.3. Deploy TeraFlowSDN over MicroK8s - -This section describes how to deploy TeraFlowSDN controller on top of MicroK8s using the -environment configured in the previous sections. - - -## 1.3.1. Install prerequisites -```bash -sudo apt-get install -y git curl jq -``` - - -## 1.3.2. Clone the Git repository of the TeraFlowSDN controller -Clone from ETSI-hosted GitLab code repository: -```bash -mkdir ~/tfs-ctrl -git clone https://labs.etsi.org/rep/tfs/controller.git ~/tfs-ctrl -``` - -__Important__: The original H2020-TeraFlow project hosted on GitLab.com has been -archieved and will not receive further contributions/updates. -Please, clone from [ETSI-hosted GitLab code repository](https://labs.etsi.org/rep/tfs/controller). - - -## 1.3.3. Checkout the appropriate Git branch -By default the *master* branch is checked out. -If you want to deploy the *develop* branch, that incorporates the most up-to-date code -contributions and features, run the following command: -```bash -cd ~/tfs-ctrl -git checkout develop -``` - - -## 1.3.4. Prepare a deployment script with the deployment settings -Create a new deployment script, e.g., `my_deploy.sh`, adding the appropriate settings as -follows. -This script, by default, makes use of the private Docker registry enabled in MicroK8s, -as specified in `TFS_REGISTRY_IMAGE`. -It builds the Docker images for the subset of components defined in `TFS_COMPONENTS`, -tags them with the tag defined in `TFS_IMAGE_TAG`, deploys them in the namespace defined -in `TFS_K8S_NAMESPACE`, and (optionally) deploys the extra Kubernetes manifests listed -in `TFS_EXTRA_MANIFESTS`. -Besides, it lets you specify in `TFS_GRAFANA_PASSWORD` the password to be set for the -Grafana `admin` user. - -```bash -cd ~/tfs-ctrl -tee my_deploy.sh >/dev/null << EOF -export TFS_REGISTRY_IMAGE="http://localhost:32000/tfs/" -export TFS_COMPONENTS="context device automation pathcomp service slice compute monitoring webui" -export TFS_IMAGE_TAG="dev" -export TFS_K8S_NAMESPACE="tfs" -export TFS_EXTRA_MANIFESTS="manifests/nginx_ingress_http.yaml" -export TFS_GRAFANA_PASSWORD="admin123+" -EOF -``` - - -## 1.3.5. Deploy TFS controller -First, source the deployment settings defined in the previous section. -This way, you do not need to specify the environment variables in each and every command -you execute to operate the TFS controller. -Be aware to re-source the file if you open new terminal sessions. -Then, run the following command to deploy TeraFlowSDN controller on top of the MicroK8s -Kubernetes platform. - -```bash -cd ~/tfs-ctrl -source my_deploy.sh -./deploy.sh -``` - -The script performs the following steps: -1. Builds the Docker images for the components defined in `TFS_COMPONENTS` -2. Tags the Docker images with the value of `TFS_IMAGE_TAG` -3. Pushes the Docker images to the repository defined in `TFS_REGISTRY_IMAGE` -4. Creates the namespace defined in `TFS_K8S_NAMESPACE` -5. Deploys the components defined in `TFS_COMPONENTS` -6. Creates the file `tfs_runtime_env_vars.sh` with the environment variables for the components defined in `TFS_COMPONENTS` defining their local host addresses and their port numbers. -7. Create an ingress controller listening at port 80 for HTTP connections to enable external access to the TeraFlowSDN WebUI, Grafana Dashboards, Context Debug endpoints, and Compute NBI interfaces. -8. Initialize and configure the Grafana dashboards -9. Report a summary of the deployment (see - [1.5. Show Deployment and Log per Component](./1-5-deploy-logs-troubleshooting.md)) diff --git a/tutorial/1-4-access-webui.md b/tutorial/1-4-access-webui.md deleted file mode 100644 index aa66ef190..000000000 --- a/tutorial/1-4-access-webui.md +++ /dev/null @@ -1,26 +0,0 @@ -# 1.4. Access TeraFlowSDN WebUI and Grafana Dashboards - -This section describes how to get access to the TeraFlowSDN controller WebUI and the -monitoring Grafana dashboards. - - -## 1.4.1. Access the TeraFlowSDN WebUI -If you followed the installation steps based on MicroK8s, you got an ingress controller -installed that exposes on TCP port 80. -In the creation of the VM, a forward from local TCP port 8080 to VM's TCP port 80 is -configured, so the WebUIs and REST APIs of TeraFlowSDN should be exposed on the endpoint -`127.0.0.1:8080` of your local machine. -Besides, the ingress controller defines the following reverse proxy paths -(on your local machine): -- `http://127.0.0.1:8080/webui`: points to the WebUI of TeraFlowSDN. -- `http://127.0.0.1:8080/grafana`: points to the Grafana dashboards. - This endpoint brings access to the monitoring dashboards of TeraFlowSDN. - The credentials for the `admin`user are those defined in the `my_deploy.sh` script, in - the `TFS_GRAFANA_PASSWORD` variable. -- `http://127.0.0.1:8080/context`: points to the REST API exposed by the TeraFlowSDN - Context component. - This endpoint is mainly used for debugging purposes. - Note that this endpoint is designed to be accessed from the WebUI. -- `http://127.0.0.1:8080/restconf`: points to the Compute component NBI based on RestCONF. - This endpoint enables connecting external software, such as ETSI OpenSourceMANO NFV - Orchestrator, to TeraFlowSDN. diff --git a/tutorial/1-5-deploy-logs-troubleshooting.md b/tutorial/1-5-deploy-logs-troubleshooting.md deleted file mode 100644 index 3aa7acaee..000000000 --- a/tutorial/1-5-deploy-logs-troubleshooting.md +++ /dev/null @@ -1,35 +0,0 @@ -# 1.5. Show Deployment and Log per Component - -This section presents some helper scripts to inspect the status of the deployment and -the logs of the components. -These scripts are particularly helpful for troubleshooting during execution of -experiments, development, and debugging. - - -## 1.5.1. Report the deployment of the TFS controller - -The summary report given at the end of the [Deploy TFS controller](./1-3-deploy-tfs.md#135-deploy-tfs-controller) -procedure can be generated manually at any time by running the following command. -You can avoid sourcing `my_deploy.sh` if it has been already done. -```bash -cd ~/tfs-ctrl -source my_deploy.sh -./show_deploy.sh -``` - -Use this script to validate that all the pods, deployments, replica sets, ingress -controller, etc. are ready and have the appropriate state, e.g., *running* for Pods, and -the services are deployed and have appropriate IP addresses and port numbers. - - -## 1.5.2. Report the log of a specific TFS controller component - -A number of scripts are pre-created in the `scripts` folder to facilitate the inspection -of the component logs. -For instance, to dump the log of the Context component, run the following command. -You can avoid sourcing `my_deploy.sh` if it has been already done. - -```bash -source my_deploy.sh -./scripts/show_logs_context.sh -``` diff --git a/tutorial/2-0-run-experiments.md b/tutorial/2-0-run-experiments.md deleted file mode 100644 index 8b5c8f6b8..000000000 --- a/tutorial/2-0-run-experiments.md +++ /dev/null @@ -1,19 +0,0 @@ -# 2. Run Experiments Guide - -This section walks you through the process of running experiments in TeraFlowSDN on top -of a Oracle VirtualBox-based VM running MicroK8s Kubernetes platform. -The guide includes the details on configuring the Python environment, some basic -commands you might need, configuring the network topology, and executing different experiments. - -Note that the steps followed here are likely to work regardless of the platform (VM) -where TeraFlowSDN is deployed over. - -Note also that this guide will keep growing with the new experiments and demonstrations -that are being carried out involving the ETSI TeraFlowSDN controller. - -## Table of Content: -- [2.1. Configure the Python environment](./2-1-python-environment.md) -- [2.2. OFC'22 Demo - Bootstrap devices, Monitor device Endpoints, Manage L3VPN Services](./2-2-ofc22.md) -- [2.3. OECC/PSC'22 Demo (PENDING)](./2-3-oeccpsc22.md) -- [2.4. ECOC'22 Demo - Disjoint DC-2-DC L2VPN Service](./2-4-ecoc22.md) -- [2.5. NFV-SDN'22 Demo (PENDING)](./2-5-nfvsdn22.md) diff --git a/tutorial/2-1-python-environment.md b/tutorial/2-1-python-environment.md deleted file mode 100644 index 940a1183a..000000000 --- a/tutorial/2-1-python-environment.md +++ /dev/null @@ -1,131 +0,0 @@ -# 2.1. Configure Python Environment - -This section describes how to configure the Python environment to run experiments and -develop code for the ETSI TeraFlowSDN controller. -In particular, we use [PyEnv](https://github.com/pyenv/pyenv) to install the appropriate -version of Python and manage the virtual environments. - - -## 2.1.1. Upgrade the Ubuntu distribution -Skip this step if you already did it during the creation of the VM. -```bash -sudo apt-get update -y -sudo apt-get dist-upgrade -y -``` - - -## 2.1.2. Install PyEnv dependencies in the VM -```bash -sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget \ - curl llvm git libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev -``` - - -## 2.1.3. Install PyEnv - -We recommend installing PyEnv through -[PyEnv Installer](https://github.com/pyenv/pyenv-installer). -Below you can find the instructions, but we refer you to the link for updated -instructions. - -```bash -curl https://pyenv.run | bash -# When finished, edit ~/.bash_profile // ~/.profile // ~/.bashrc as the installer proposes. -# In general, it means to append the following lines to ~/.bashrc: -export PYENV_ROOT="$HOME/.pyenv" -command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH" -eval "$(pyenv init -)" -eval "$(pyenv virtualenv-init -)" -``` - -In case .bashrc is not linked properly to your profile, you may need to append the -following line into your local .profile file: - -```bash -# Open ~/.profile and append this line: -+source "$HOME"/.bashrc -``` - - -## 2.1.4. Restart the VM -Restart the VM for all the changes to take effect. -```bash -sudo reboot -``` - - -## 2.1.5. Install Python 3.9 over PyEnv - -ETSI TeraFlowSDN uses Python 3.9 by default. -You should install the latest update of Python 3.9. -To find the latest version available in PyEnv, you can run the following command: - -```bash -pyenv install --list | grep " 3.9" -``` - -At the time of writing, this command will output the following list: - -``` - 3.9.0 - 3.9-dev - 3.9.1 - 3.9.2 - 3.9.4 - 3.9.5 - 3.9.6 - 3.9.7 - 3.9.8 - 3.9.9 - 3.9.10 - 3.9.11 - 3.9.12 - 3.9.13 - 3.9.14 ** always select the latest version ** -``` - -Therefore, the latest version is Python 3.9.14. -To install this version, you should run: - -```bash -pyenv install 3.9.14 - # This command might take some minutes depending on your Internet connection speed - # and the performance of your VM. -``` - - -## 2.1.6. Create the Virtual Environment for TeraFlowSDN -The following commands create a virtual environment named as `tfs` using Python 3.9 and -associate that environment with the current folder, i.e., `~/tfs-ctrl`. -That way, when you are in that folder, the associated virtual environment will be used, -thus inheriting the Python interpreter, i.e., Python 3.9, and the Python packages -installed on it. - -```bash -cd ~/tfs-ctrl -pyenv virtualenv 3.9.14 tfs -pyenv local 3.9.14/envs/tfs -``` - -In case that the correct pyenv does not get automatically activated when you change to -the tfs-ctrl/ folder, then execute the following command: - -```bash -cd ~/tfs-ctrl -pyenv activate 3.9.14/envs/tfs -``` - -After completing these commands, you should see in your prompt that now you're within -the virtual environment `3.9.14/envs/tfs` on folder `~/tfs-ctrl`: -``` -(3.9.14/envs/tfs) tfs@tfs-vm:~/tfs-ctrl$ -``` - - -## 2.1.7. Install the basic Python packages within the virtual environment -From within the `3.9.14/envs/tfs` environment on folder `~/tfs-ctrl`, run the following -commands to install the basic Python packages required to work with TeraFlowSDN. -```bash -cd ~/tfs-ctrl -./install_requirements.sh -``` diff --git a/tutorial/2-2-ofc22.md b/tutorial/2-2-ofc22.md deleted file mode 100644 index 04d585d24..000000000 --- a/tutorial/2-2-ofc22.md +++ /dev/null @@ -1,200 +0,0 @@ -# 2.2. OFC'22 Demo - Bootstrap devices, Monitor device Endpoints, Manage L3VPN Services - -This functional test reproduces the live demonstration *Demonstration of Zero-touch -Device and L3-VPN Service Management Using the TeraFlow Cloud-native SDN Controller* -carried out at [OFC'22](https://ieeexplore.ieee.org/document/9748575) / -[Open access](https://research.chalmers.se/en/publication/c397ef36-837f-416d-a44d-6d3b561d582a). - - -## 2.2.1. Functional test folder - -This functional test can be found in folder `./src/tests/ofc22/`. -A convenience alias `./ofc22/` pointing to that folder has been defined. - - -## 2.2.2. Execute with real devices - -This functional test is designed to operate both with real and emulated devices. -By default, emulated devices are used; -however, if you have access to real devices, you can create/modify the files -`./ofc22/tests/Objects.py` and `./ofc22/tests/Credentials.py` to point to your devices, -and map to your own network topology. -Otherwise, you can modify the `./ofc22/tests/descriptors_emulated.json` that is designed -to be uploaded through the WebUI instead of using the command line scripts. -Note that the default scenario assumes devices R2 and R4 are always emulated, while -devices R1, R3, and O1 can be configured as emulated or real devices. - -__Important__: The device drivers operating with real devices, e.g., OpenConfigDriver, - P4Driver, and TransportApiDriver, have to be considered as experimental. - The configuration and monitoring capabilities they support are - limited or partially implemented/tested. Use them with care. - - -## 2.2.3. Deployment and Dependencies - -To run this functional test, it is assumed you have deployed a MicroK8s-based Kubernetes -environment and a TeraFlowSDN controller instance as described in the -[Tutorial: Deployment Guide](./1-0-deployment.md), and you configured the Python -environment as described in -[Tutorial: Run Experiments Guide > 2.1. Configure Python Environment](./2-1-python-environment.md). - - -## 2.2.4. Access to the WebUI and Dashboard - -When the deployment completes, you can connect to the TeraFlowSDN WebUI and Dashboards -as described in -[Tutorial: Deployment Guide > 1.4. Access TeraFlowSDN WebUI and Grafana Dashboards](./1-4-access-webui.md) - -Notes: -- the default credentials for the Grafana Dashboiard is user/pass: `admin`/`admin123+`. -- in Grafana, you will find the *L3-Monitorng* in the *Starred dashboards* section. - - -## 2.2.5. Test execution - -Before executing the tests, we need to prepare a few things. - -First, you need to make sure that you have all the gRPC-generate code in your folder. -To do so, run: - -``` -proto/generate_code_python.sh -``` - -Then, it is time to deploy TeraFlowSDN with the correct specification for this scenario. -Make sure to load your deployment variables for this scenario by: - -``` -source ofc22/deploy_specs.sh -``` - -Then, you need to deploy the components by running: - -``` -./deploy.sh -``` - -After the deployment is finished, you need to load the environment variables to support -the execution of the tests by: - -``` -source tfs_runtime_env_vars.sh -``` - -To execute this functional test, four main steps needs to be carried out: -1. Device bootstrapping -2. L3VPN Service creation -3. L3VPN Service removal -4. Cleanup - -Upon the execution of each test progresses, a report will be generated indicating -*PASSED* / *FAILED* / *SKIPPED*. -If there is some error during the execution, you should see a detailed report on the error. -See the troubleshooting section if needed. - -You can check the logs of the different components using the appropriate `scripts/show_logs_[component].sh` scripts -after you execute each step. - -There are two ways to execute the functional tests, *running all the tests with a single script* or *running each test independently*. -In the following we start with the first option, then we comment on how to run each test independently. - - -### 2.2.5.1. Running all tests with a single script - -We have a script that executes all the steps at once. -It is meant for being used to test if all components involved in this scenario are working correct. -To run all the functional tests, you can run: - -``` -ofc22/run_tests_and_coverage.sh -``` - -The following sections explain each one of the steps. - - -### 2.2.5.2. Device bootstrapping - -This step configures some basic entities (Context and Topology), the devices, and the -links in the topology. -The expected results are: -- The devices to be added into the Topology. -- The devices to be pre-configured and initialized as ENABLED by the Automation component. -- The monitoring for the device ports (named as endpoints in TeraFlowSDN) to be activated and data collection to automatically start. -- The links to be added to the topology. - -To run this step, you can do it from the WebUI by uploading the file `./ofc22/tests/descriptors_emulated.json` that -contains the descriptors of the contexts, topologies, devices, and links, or by -executing the script: - -``` -./ofc22/run_test_01_bootstrap.sh -``` - -When the bootstrapping finishes, check in the Grafana L3-Monitoring Dashboard and you -should see the monitoring data being plotted and updated every 5 seconds (by default). -Given that there is no service configured, you should see a 0-valued flat plot. - -In the WebUI, select the *admin* Context. -Then, in the *Devices* tab you should see that 5 different emulated devices have been -created and activated: 4 packet routers, and 1 optical line system controller. -Besides, in the *Services* tab you should see that there is no service created. -Note here that the emulated devices produce synthetic randomly-generated monitoring data -and do not represent any particularservices configured. - - -### 2.2.5.3. L3VPN Service creation - -This step configures a new service emulating the request an OSM WIM would make by means -of a Mock OSM instance. - -To run this step, execute the script: - -``` -./ofc22/run_test_02_create_service.sh -``` - -When the script finishes, check the WebUI *Services* tab. You should see that two -services have been created, one for the optical layer and another for the packet layer. -Besides, you can check the *Devices* tab to see the configuration rules that have been -configured in each device. -In the Grafana Dashboard, given that there is now a service configured, you should see -the plots with the monitored data for the device. -By default, device R1-EMU is selected. - - -### 2.2.5.4. L3VPN Service removal - -This step deconfigures the previously created services emulating the request an OSM WIM -would make by means of a Mock OSM instance. - -To run this step, execute the script: - -``` -./ofc22/run_test_03_delete_service.sh -``` - -or delete the L3NM service from the WebUI. - -When the script finishes, check the WebUI *Services* tab. -You should see that the two services have been removed. -Besides, in the *Devices* tab you can see that the appropriate configuration rules have -been deconfigured. -In the Grafana Dashboard, given that there is no service configured, you should see a -0-valued flat plot again. - - -### 2.2.5.5. Cleanup - -This last step performs a cleanup of the scenario removing all the TeraFlowSDN entities -for completeness. - -To run this step, execute the script: - -``` -./ofc22/run_test_04_cleanup.sh -``` - -When the script finishes, check the WebUI *Devices* tab, you should see that the devices -have been removed. -Besides, in the *Services* tab you can see that the "admin" Context has no services -given that that context has been removed. diff --git a/tutorial/2-3-oeccpsc22.md b/tutorial/2-3-oeccpsc22.md deleted file mode 100644 index 2ea7261d8..000000000 --- a/tutorial/2-3-oeccpsc22.md +++ /dev/null @@ -1,8 +0,0 @@ -# 2.3. OECC/PSC'22 Demo - Interdomain slices (WORK IN PROGRESS) - -This functional test reproduces the experiment in paper "... paper title ..." presented at OECC/PSC'22 conference -[OECC/PSC'22](... demo link ...). - -## 2.3.1. Functional test folder -This functional test can be found in folder `./src/tests/oeccpsc22/`. A convenience alias `./oeccpsc22/` pointing to -that folder has been defined. diff --git a/tutorial/2-4-ecoc22.md b/tutorial/2-4-ecoc22.md deleted file mode 100644 index 87bc12be7..000000000 --- a/tutorial/2-4-ecoc22.md +++ /dev/null @@ -1,132 +0,0 @@ -# 2.4. ECOC'22 Demo - Disjoint DC-2-DC L2VPN Service - -This functional test reproduces the experimental assessment of *Experimental -Demonstration of Transport Network Slicing with SLA Using the TeraFlowSDN Controller* -presented at [ECOC'22](https://www.optica.org/en-us/events/topical_meetings/ecoc/schedule/?day=Tuesday#Tuesday). - -## 2.4.1. Functional test folder - -This functional test can be found in folder `./src/tests/ecoc22/`. -A convenience alias `./ecoc22/` pointing to that folder has been defined. - -## 2.4.2. Execute with real devices - -This functional test has only been tested with emulated devices; -however, if you have access to real devices, you can modify the files -`./ecoc22/tests/Objects.py` and `./ecoc22/tests/Credentials.py` to point to your devices, -and map to your network topology. -Otherwise, you can modify the `./ecoc22/tests/descriptors_emulated.json` that is -designed to be uploaded through the WebUI instead of using the command line scripts. - -__Important__: The device drivers operating with real devices, e.g., OpenConfigDriver, - P4Driver, and TransportApiDriver, have to be considered as experimental. - The configuration and monitoring capabilities they support are - limited or partially implemented/tested. Use them with care. - - -## 2.4.3. Deployment and Dependencies - -To run this functional test, it is assumed you have deployed a MicroK8s-based Kubernetes -environment and a TeraFlowSDN controller instance as described in the -[Tutorial: Deployment Guide](./1-0-deployment.md), and you configured the Python -environment as described in -[Tutorial: Run Experiments Guide > 2.1. Configure Python Environment](./2-1-python-environment.md). -Remember to source the scenario settings, e.g., `cd ~/tfs-ctrl && source ecoc22/deploy_specs.sh` -in each terminal you open. -Then, re-build the protocol buffers code from the proto files: -`./proto/generate_code_python.sh` - - - -## 2.4.4. Access to the WebUI - -When the deployment completes, you can connect to the TeraFlowSDN WebUI as described in -[Tutorial: Deployment Guide > 1.4. Access TeraFlowSDN WebUI and Grafana Dashboards](./1-4-access-webui.md) - -Notes: -- this experiment does not make use of Monitoring, so Grafana is not used. -- the default credentials for the Grafana Dashboard is user/pass: `admin`/`admin123+`. -- this functional test does not involve the Monitoring component, so no monitoring - data is plotted in Grafana. - - -## 2.4.5. Test execution - -To execute this functional test, four main steps needs to be carried out: -1. Device bootstrapping -2. L2VPN Slice and Services creation -3. L2VPN Slice and Services removal -4. Cleanup - -Upon the execution of each test progresses, a report will be generated indicating -*PASSED* / *FAILED* / *SKIPPED*. -If there is some error during the execution, you should see a detailed report on the -error. -See the troubleshooting section if needed. - -You can check the logs of the different components using the appropriate -`scripts/show_logs_[component].sh` scripts after you execute each step. - - -### 2.4.5.1. Device bootstrapping - -This step configures some basic entities (Context and Topology), the devices, and the -links in the topology. -The expected results are: -- The devices to be added into the Topology. -- The devices to be pre-configured and initialized as *ENABLED* by the Automation component. -- The links to be added to the topology. - -To run this step, you can do it from the WebUI by uploading the file -`./ecoc22/tests/descriptors_emulated.json` that contains the descriptors of the contexts, -topologies, devices, and links, or by executing the `./ecoc22/run_test_01_bootstrap.sh` script. - -In the WebUI, select the *admin* Context. -Then, in the *Devices* tab you should see that 5 different emulated devices have been -created and activated: 4 packet routers, and 1 optical Open Line System (OLS) controller. -Besides, in the *Services* tab you should see that there is no service created. - - -### 2.4.5.2. L2VPN Slice and Services creation - -This step configures a new service emulating the request an OSM WIM would make by means -of a Mock OSM instance. - -To run this step, execute the `./ecoc22/run_test_02_create_service.sh` script. - -When the script finishes, check the WebUI *Slices* and *Services* tab. -You should see that, for the connectivity service requested by MockOSM, one slice has -been created, three services have been created (two for the optical layer and another -for the packet layer). -Note that the two services for the optical layer correspond to the primary (service_uuid -ending with ":0") and the backup (service_uuid ending with ":1") services. -Each of the services indicates the connections and sub-services that are supporting them. -Besides, you can check the *Devices* tab to see the configuration rules that have been -configured in each device. - - -### 2.4.5.3. L2VPN Slice and Services removal - -This step deconfigures the previously created slices and services emulating the request -an OSM WIM would make by means of a Mock OSM instance. - -To run this step, execute the `./ecoc22/run_test_03_delete_service.sh` script, or delete -the slice from the WebUI. - -When the script finishes, check the WebUI *Slices* and *Services* tab. You should see -that the slice and the services have been removed. -Besides, in the *Devices* tab you can see that the appropriate configuration rules have -been deconfigured. - - -### 2.4.5.4. Cleanup - -This last step performs a cleanup of the scenario removing all the TeraFlowSDN entities -for completeness. - -To run this step, execute the `./ecoc22/run_test_04_cleanup.sh` script. - -When the script finishes, check the WebUI *Devices* tab, you should see that the devices -have been removed. -Besides, in the *Slices* and *Services* tab you can see that the *admin* Context has no services -given that that context has been removed. diff --git a/tutorial/2-5-nfvsdn22.md b/tutorial/2-5-nfvsdn22.md deleted file mode 100644 index 35fae3af3..000000000 --- a/tutorial/2-5-nfvsdn22.md +++ /dev/null @@ -1 +0,0 @@ -# 2.5. NFV-SDN'22 Demo (PENDING) diff --git a/tutorial/3-0-development.md b/tutorial/3-0-development.md deleted file mode 100644 index 05e03ef8f..000000000 --- a/tutorial/3-0-development.md +++ /dev/null @@ -1,18 +0,0 @@ -# 3. Development Guide (WORK IN PROGRESS) - -This section walks you through the process of developing new components for -the TeraFlowSDN controller. -In particular, the guide includes the details on how to configure VSCode IDE, -develop a new component, and debug individual components. - -For convenience, this guide assumes you are using the Oracle VirtualBox-based -VM running MicroK8s Kubernetes platform as described in the -[Deployment Guide](./1-0-deployment.md). -BEsides, it assumes you installed the appropriate Python and PyEnv as -described in [2.1. Configure Python Environment](./2-1-python-environment.md). - -## Table of Content: -- [3.1. Configure VSCode and Connect to the VM](./3-1-configure-vscode.md) -- [3.2. Developing a new component: Forecaster (WORK IN PROGRESS)](./3-2-develop-new-component.md) -- [3.3. Debugging individual components in VSCode](./3-3-debug-comp.md) -- [3.4. Development Commands, Tricks, and Hints (WORK IN PROGRESS)](./3-4-develop-cth.md) diff --git a/tutorial/3-1-configure-vscode.md b/tutorial/3-1-configure-vscode.md deleted file mode 100644 index e7dbf3a6a..000000000 --- a/tutorial/3-1-configure-vscode.md +++ /dev/null @@ -1,98 +0,0 @@ -# 3.1. Configure VSCode and Connect to the VM - - -## 3.1.1. Install VSCode and the required extensions -If not already done, install [VSCode](https://code.visualstudio.com/) and the "Remote SSH" extension on your local -machine, not in the VM. - -__Note__: "Python" extension is not required here. It will be installed later on the VSCode server running on the VM. - - -## 3.1.2. Configure the "Remote SSH" extension -- Go to left icon "Remote Explorer" -- Click the "gear" icon next to "SSH TARGETS" on top of "Remote Explorer" bar -- Choose to edit "<...>/.ssh/config" file (or equivalent) -- Add the following entry (assuming previous port forwarding configuration): -``` -Host TFS-VM - HostName 127.0.0.1 - Port 2200 - ForwardX11 no - User tfs -``` -- Save the file -- An entry "TFS-VM" should appear on "SSH TARGETS". - - -## 3.1.3. Connect VSCode to the VM through "Remote SSH" extension -- Right-click on "TFS-VM" -- Select "Connect to Host in Current Window" -- Reply to the questions asked - - Platform of the remote host "TFS-VM": Linux - - "TFS-VM" has fingerprint "". Do you want to continue?: Continue - - Type tfs user's password: tfs123 -- You should be now connected to the TFS-VM. - -__Note__: if you get a connection error message, the reason might be due to wrong SSH server fingerprint. Edit file - "<...>/.ssh/known_hosts" on your local user account, check if there is a line starting with - "[127.0.0.1]:2200" (assuming previous port forwarding configuration), remove the entire line, save the file, - and retry connection. - - -## 3.1.4. Add SSH key to prevent typing the password every time -This step creates an SSH key in the VM and installs it on the VSCode to prevent having to type the password every time. - -- In VSCode (connected to the VM), click menu "Terminal > New Terminal" -- Run the following commands on the VM's terminal through VSCode -```bash -ssh-keygen -t rsa -b 4096 -f ~/.ssh/tfs-vm.key - # leave password empty -ssh-copy-id -i ~/.ssh/tfs-vm.key.pub tfs@10.0.2.10 - # tfs@10.0.2.10's password: -rm .ssh/known_hosts -``` - -- In VSCode, click left "Explorer" panel to expand, if not expanded, and click "Open Folder" button. - - Choose "/home/tfs/" - - Type tfs user's password when asked - - Trust authors of the "/home/tfs [SSH: TFS-VM]" folder when asked -- Right click on the file "tfs-vm.key" in the file explorer - - Select "Download..." option - - Download the file into your user's accout ".ssh" folder -- Delete files "tfs-vm.key" and "tfs-vm.key.pub" on the TFS-VM. - -- In VSCode, click left "Remote Explorer" panel to expand - - Click the "gear" icon next to "SSH TARGETS" on top of "Remote Explorer" bar - - Choose to edit "<...>/.ssh/config" file (or equivalent) - - Find entry "Host TFS-VM" and update it as follows: -``` -Host TFS-VM - HostName 127.0.0.1 - Port 2200 - ForwardX11 no - User tfs - IdentityFile "" -``` - - Save the file -- From now, VSCode will use the identity file to connect to the TFS-VM instead of the user's password. - - -## 3.1.5. Install VSCode Python Extension (in VSCode server) -This step installs Python extensions in VSCode server running in the VM. - -- In VSCode (connected to the VM), click left button "Extensions" -- Search "Python" extension in the extension Marketplace. -- Install official "Python" extension released by Microsoft. - - By default, since you're connected to the VM, it will be installed in the VSCode server running in the VM. - -- In VSCode (connected to the VM), click left button "Explorer" -- Click "Ctrl+Alt+P" and type "Python: Select Interpreter". Select option "Python: 3.9.13 64-bit ('tfs')" - - -## 3.1.6. Define environment variables for VSCode -The source code in the TFS controller project is hosted in folder `src/`. To help VSCode find the Python modules and -packages, add the following file into your working space root folder: - -```bash -echo "PYTHONPATH=./src" >> ~/tfs-ctrl/.env -``` diff --git a/tutorial/3-2-develop-new-component.md b/tutorial/3-2-develop-new-component.md deleted file mode 100644 index 8d39b56a8..000000000 --- a/tutorial/3-2-develop-new-component.md +++ /dev/null @@ -1,132 +0,0 @@ -# 3.2. Developing a new component: Forecaster (WORK IN PROGRESS) - - -## 3.2.1. Preliminary requisites -As any microservice-based architecture, the components of TeraFlowSDN can be implemented using different programming languages. -For the sake of simplicity, and given it is the most widely used programming language in TeraFlow, this tutorial page assumes the reader will use Python. - -This tutorial assumes you hace successfully completed the steps in -[2.1. Configure the Python Environment](./2-1-python-environment.md) and -[3.1. Configure VSCode and Connect to the VM](./3-1-configure-vscode.md) to prepare your environment. - - -## 3.2.2. Create the component folder structure -The source code of each component of TeraFlowSDN is hosted in a particular folder within the `src` folder. -Within that folder, typically, 3 subfolders are created: -- Folder `client`: contains a client implementation that the rest of components can use to interact with the component. - See details in [3.2.4. Create the component client](./3-X-develop-new-component.md#3x4-create-the-component-client). -- Folder `service`: contains the implementation of the service logic. - See details in [3.2.5. Create the component service](./3-X-develop-new-component.md#3x5-create-the-component-service). -- Folder `tests`: contains the set of unitary tests to be executed over the component to ensure it is properly implemented. - See details in [3.2.6. Create the component tests](./3-X-develop-new-component.md#3x6-create-the-component-tests). -- File `__init__.py`: defines the component as a sub-package of TeraFlowSDN to facilitate imports. -- File `.gitlab-ci.yml`: defines the GitLab CI/CD settings to build, test, and deploy the component in an automated manner. -- File `Config.py`: contains particular configuration settings and constants for the component. -- File `Dockerfile`: defines the recipe to construct the Docker image for the component. -- File `requirements.in`: defines the Python dependencies that are required by this component. - -You can automate the creation of this file structure running the following command. -In this example, we create the `forecaster` component. -```bash -cd ~/tfs-ctrl -scripts/create_component.sh forecaster -``` - - -## 3.2.3. gRPC Proto messages and services -The components, e.g., microservices, of the TeraFlowSDN controller, in general, use a gRPC-based open API to interoperate. -All the protocol definitions can be found in sub-folder `proto` within the root project folder. -For additional details on gRPC, visit the official web-page [gRPC](https://grpc.io/). - -In general, each component has an associated _proto_ file named as the name of the component in snake_case.proto. -For instance, the _proto_ file for the `forecaster` component being developed in this tutorial is `proto/forecaster.proto` and implements 3 RPC methods: -- `rpc GetForecastOfTopology (context.TopologyId) returns (Forecast) {}´: - Takes a topology identifier as parameter, and computes the aggregated forecast for the topology. -- `rpc GetForecastOfLink(context.LinkId) returns (Forecast) {}´: - Takes a link identifier as parameter, and computes the aggregated forecast for that link. -- `rpc CheckService (context.ServiceId) returns (ForecastPrediction) {}´: - Takes a service identifier as parameter, computes the forecast for the connections of that service, and retrieves a value indicating if the resources can support the demand. - - -## 3.2.4. Create the component client -Each component has, by default, a pre-defined client that other components can import to inter-communicate. -The client module, by default, is named as the component's name concatenated with `client`, and written in CamelCase. -For instance, the client for the `forecaster` component would be `ForecasterClient.py`. - -This file contains a class with the same name as the file, e.g., `ForecasterClient`, and implements 3 main methods, plus one method for each RPC method supported by the service. These methods are: -- Main methods: - - `__init__(host=None, port=None)`: constructor of the client class. - - `connect(self)`: triggers the connection of the client to the service pointed by host and port class parameters. - - `close(self)`: disconnects the client from the service. -- RPC methods: one for each RPC method defined in the associated service within the proto file, e.g., `proto/forecaster.proto`. - -Create file `` - - - -## 3.2.3. Connect VSCode to the VM through "Remote SSH" extension -- Right-click on "TFS-VM" -- Select "Connect to Host in Current Window" -- Reply to the questions asked - - Platform of the remote host "TFS-VM": Linux - - "TFS-VM" has fingerprint "". Do you want to continue?: Continue - - Type tfs user's password: tfs123 -- You should be now connected to the TFS-VM. - -__Note__: if you get a connection error message, the reason might be due to wrong SSH server fingerprint. Edit file - "<...>/.ssh/known_hosts" on your local user account, check if there is a line starting with - "[127.0.0.1]:2200" (assuming previous port forwarding configuration), remove the entire line, save the file, - and retry connection. - - -## 3.2.4. Add SSH key to prevent typing the password every time -This step creates an SSH key in the VM and installs it on the VSCode to prevent having to type the password every time. - -- In VSCode (connected to the VM), click menu "Terminal > New Terminal" -- Run the following commands on the VM's terminal through VSCode -```bash -ssh-keygen -t rsa -b 4096 -f ~/.ssh/tfs-vm.key - # leave password empty -ssh-copy-id -i ~/.ssh/tfs-vm.key.pub tfs@10.0.2.10 - # tfs@10.0.2.10's password: -rm .ssh/known_hosts -``` - -- In VSCode, click left "Explorer" panel to expand, if not expanded, and click "Open Folder" button. - - Choose "/home/tfs/" - - Type tfs user's password when asked - - Trust authors of the "/home/tfs [SSH: TFS-VM]" folder when asked -- Right click on the file "tfs-vm.key" in the file explorer - - Select "Download..." option - - Download the file into your user's accout ".ssh" folder -- Delete files "tfs-vm.key" and "tfs-vm.key.pub" on the TFS-VM. - -- In VSCode, click left "Remote Explorer" panel to expand - - Click the "gear" icon next to "SSH TARGETS" on top of "Remote Explorer" bar - - Choose to edit "<...>/.ssh/config" file (or equivalent) - - Find entry "Host TFS-VM" and update it as follows: -``` -Host TFS-VM - HostName 127.0.0.1 - Port 2200 - ForwardX11 no - User tfs - IdentityFile "" -``` - - Save the file -- From now, VSCode will use the identity file to connect to the TFS-VM instead of the user's password. - - -## 3.2.5. Install VSCode Python Extension (in VSCode server) -This step installs Python extensions in VSCode server running in the VM. - -- In VSCode (connected to the VM), click left button "Extensions" -- Search "Python" extension in the extension Marketplace. -- Install official "Python" extension released by Microsoft. - - By default, since you're connected to the VM, it will be installed in the VSCode server running in the VM. - -- In VSCode (connected to the VM), click left button "Explorer" -- Click "Ctrl+Alt+P" and type "Python: Select Interpreter". Select option "Python: 3.9.13 64-bit ('tfs')" - -in terminal: set python path to be used by VSCode: -`echo "PYTHONPATH=./src" > ~/tfs-ctrl/.env` diff --git a/tutorial/3-3-debug-comp.md b/tutorial/3-3-debug-comp.md deleted file mode 100644 index 380c5add2..000000000 --- a/tutorial/3-3-debug-comp.md +++ /dev/null @@ -1,55 +0,0 @@ -# 3.3 Debugging individual components in VSCode - -## 3.3.1 Source TeraFlow environment variables into .bashrc - -With any text editor, open the file `~/.bashrc` and add the following line at the end: -```bash -source ~/tfs-ctrl/tfs_runtime_env_vars.sh -``` - -"tfs-ctrl" can be substituted by the appropriate path where the controller is deployed. - -## 3.3.2 Install VSCode Python extensions -The following extensions are required to execute and debug TeraFlow components in VSCode: - -- *Python*. New versions of the extension are known to have some unsolved bugs, it is recommended to downgrade to version **v2022.10.0**. Go to the extension window, select Python, click the arrow next to the "Uninstall" button and select "Install Another Version..." -- *Pylance* - -## 3.3.3 Configure VSCode workspace and launch settings -Run VSCode and open the folder with the source code of TeraFlow, this will be the main workspace. Create (if it does not exist) the subfolder `.vscode`. Inside, create and edit the following files: - -- `settings.json` - ```bash - { - "python.analysis.extraPaths": ["/.pyenv/versions/3.9.7/envs/teraflow/lib/python3.9/site-packages"], - } - ``` - `` should be replaced by the path of your home folder. If in the future another version of Python is used, or the virtual environment changes, this file should be updated to reflect the new path of the installed pip packages. - -- `launch.json` - ```bash - { - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "TFS compute.service", - "module": "compute.service", - "python": "${command:python.interpreterPath}", - "type": "python", - "request": "launch", - "justMyCode": true, - "console": "internalConsole", - "env": { - "PYTHONPATH": "${config:python.analysis.extraPaths}:${workspaceRoot}/src", - "LOG_LEVEL": "DEBUG", - } - } - ] - } - ``` - This file contains the configuration necessary to execute the `"compute"` component from the TeraFlow controller, while providing debugging capabilities (e.g., breaking points, console log output etc.). After saving, the debugging can be started from the "Run and Debug" menu. - - Additional profiles can be added to the JSON file under the `"configurations"` arrray. Copy & paste the existing one and change the `"name"` and `"module"` fields. \ No newline at end of file diff --git a/tutorial/3-4-develop-cth.md b/tutorial/3-4-develop-cth.md deleted file mode 100644 index bb842658b..000000000 --- a/tutorial/3-4-develop-cth.md +++ /dev/null @@ -1,50 +0,0 @@ -# 3.4. Development Commands, Tricks, and Hints (WORK IN PROGRESS) - -## Building, running, testing and reporting code coverage locally - -The project runs a CI/CD loops that ensures that all tests are run whenever new code is committed to our reporitory. -However, committing and waiting for the pipeline to run can take substantial time. -For this reason, we prepared a script that runs in your local machine, builds the container image and executes the tests within the image. - -To use the script receives one argument that is the name of the component you want to run. -For instance, if you want to build and run the tests of the `compute` component, you can run: - -```shell -scripts/build_run_report_tests_locally.sh compute -``` - - - -## Items to be addressed: -- pytest flags: --log-level=INFO --verbose -o log_cli=true -o log_file=my_log_file.log -o log_file_level=DEBUG -- code coverage -- nginx ingress grpc to enable access from external sources - - -# interesting Docker commands - -Build by hand: -cd src -docker build -t "context:lgr-test" -f ./context/Dockerfile . - -Run by hand: -docker run --rm --name lgr-test -it --env "DB_BACKEND=inmemory" --entrypoint /bin/bash context:lgr-test - - -## Expose gRPC ports through Ingress Controller -source `my_deploy.sh` -run script `./expose_ingress_grpc.sh` - -to test: -sudo apt-get install nmap -nmap -p 1010 127.0.0.1 # test if context is reachable -should retrieve something like: -$ nmap -p 1010 127.0.0.1 -Starting Nmap 7.80 ( https://nmap.org ) at 2022-07-29 15:06 UTC -Nmap scan report for localhost (127.0.0.1) -Host is up (0.00035s latency). - -PORT STATE SERVICE -1010/tcp open surf - -Nmap done: 1 IP address (1 host up) scanned in 0.07 seconds diff --git a/tutorial/README.md b/tutorial/README.md deleted file mode 100644 index f2fb3a219..000000000 --- a/tutorial/README.md +++ /dev/null @@ -1,45 +0,0 @@ -# ETSI TeraFlowSDN Controller Tutorials - - -## Abstract -This document provides a walkthrough on how to prepare your environment for executing -and contributing to the [ETSI TeraFlowSDN OSG](https://tfs.etsi.org/). - -This walkthrough makes some reasonable assumptions to simplify the deployment of the -ETSI TeraFlowSDN controller, the execution of experiments and tests, and development of -new contributions. -In particular, we assume: - -- [VirtualBox](https://www.virtualbox.org/) version 6.1.34 r150636 -- [VSCode](https://code.visualstudio.com/) with the - [*Remote SSH*](https://code.visualstudio.com/docs/remote/ssh) extension -- VM software: - - [Ubuntu Server 20.04 LTS](https://releases.ubuntu.com/20.04/) - - [MicroK8s](https://microk8s.io/) - - -## Contact -If your environment does not fit with the proposed assumptions and you experience issues -preparing it to work with the ETSI TeraFlowSDN controller, contact the ETSI TeraFlowSDN -OSG team through -[Slack](https://join.slack.com/t/teraflowsdn/shared_invite/zt-18gc5jvkh-1_DEZHFhxeuOqzJZPq~U~A) - - -## Table of Content: -- [1. Deployment Guide](./1-0-deployment.md) - - [1.1. Create VM for the TeraFlowSDN controller](./1-1-create-vm.md) - - [1.2. Install MicroK8s Kubernetes platform](./1-2-install-microk8s.md) - - [1.3. Deploy TeraFlowSDN over MicroK8s](./1-3-deploy-tfs.md) - - [1.4. Access TeraFlowSDN WebUI and Grafana Dashboards](./1-4-access-webui.md) - - [1.5. Show Deployment and Log per Component](./1-5-deploy-logs-troubleshooting.md) -- [2. Run Experiments Guide](./2-0-run-experiments.md) - - [2.1. Configure the Python environment](./2-1-python-environment.md) - - [2.2. OFC'22 Demo - Bootstrap devices, Monitor device Endpoints, Manage L3VPN Services](./2-2-ofc22.md) - - [2.3. OECC/PSC'22 Demo (PENDING)](./2-3-oeccpsc22.md) - - [2.4. ECOC'22 Demo - Disjoint DC-2-DC L2VPN Service](./2-4-ecoc22.md) - - [2.5. NFV-SDN'22 Demo (PENDING)](./2-5-nfvsdn22.md) -- [3. Development Guide (WORK IN PROGRESS)](./3-0-development.md) - - [3.1. Configure VSCode and Connect to the VM](./3-1-configure-vscode.md) - - [3.2. Developing a new component: Forecaster (WORK IN PROGRESS)](./3-4-develop-new-component.md) - - [3.3. Debugging individual components in VSCode](./3-3-debug-comp.md) - - [3.4. Development Commands, Tricks, and Hints (WORK IN PROGRESS)](./3-2-develop-cth.md) -- GitLab From 99242d0562b7724e5ca7926ed9f2d013591b3078 Mon Sep 17 00:00:00 2001 From: gifrerenom Date: Wed, 1 Feb 2023 17:04:35 +0000 Subject: [PATCH 2/4] Headers: - Added/Updated headers - Added script to update copyright headers --- .gitlab-ci.yml | 2 +- clean_testing_environment.sh | 2 +- common_requirements.in | 2 +- coverage/.coveragerc.template | 14 +++ deploy/all.sh | 2 +- deploy/component.sh | 2 +- deploy/crdb.sh | 2 +- deploy/mock_blockchain.sh | 2 +- deploy/nats.sh | 2 +- deploy/qdb.sh | 2 +- deploy/show.sh | 2 +- deploy/tfs.sh | 2 +- expose_ingress_grpc.sh | 2 +- hackfest/gnmi/sonic.clab.yml | 14 +++ hackfest/grpc/connection.proto | 14 +++ hackfest/grpc/connection/create.py | 14 +++ hackfest/grpc/connection/list.py | 14 +++ hackfest/grpc/connectionService.proto | 14 +++ .../connectionService_client.py | 14 +++ .../connectionService_server.py | 14 +++ .../grpc/connectionServiceWithNotif.proto | 14 +++ .../connectionServiceWithNotif_client.py | 14 +++ .../connectionServiceWithNotif_server.py | 14 +++ hackfest/grpc/topologyService.proto | 14 +++ .../topologyService/topologyService_client.py | 14 +++ .../topologyService/topologyService_server.py | 14 +++ hackfest/kafka/pub.py | 14 +++ hackfest/kafka/sub.py | 14 +++ hackfest/mock_osm/MockOSM.py | 2 +- hackfest/mock_osm/__init__.py | 2 +- hackfest/mock_osm/__main__.py | 2 +- hackfest/netconf-oc/device_definition.py | 14 +++ hackfest/netconf-oc/interfaces.xml | 16 +++ hackfest/netconf-oc/platform.xml | 16 +++ hackfest/netconf-oc/server_openconfig.py | 14 +++ hackfest/netconf/client_topology.py | 14 +++ .../netconf/connection/client_connection.py | 14 +++ .../connection/server_topology_connection.py | 14 +++ hackfest/netconf/connection/topology.xml | 16 +++ hackfest/netconf/server_topology.py | 14 +++ hackfest/netconf/topology.xml | 16 +++ hackfest/onos_api/onos_flows.py | 14 +++ hackfest/onos_api/onos_topology.py | 14 +++ hackfest/openconfig/generated.go | 14 +++ hackfest/p4/__init__.py | 2 +- hackfest/p4/deploy_specs.sh | 14 +++ hackfest/p4/mininet/topo-simple.py | 0 hackfest/p4/run_test_01_bootstrap.sh | 2 +- hackfest/p4/run_test_02_create_service.sh | 2 +- hackfest/p4/run_test_03_delete_service.sh | 2 +- hackfest/p4/run_test_04_cleanup.sh | 2 +- hackfest/p4/setup.sh | 14 +++ hackfest/p4/tests/BuildDescriptors.py | 2 +- hackfest/p4/tests/LoadDescriptors.py | 2 +- hackfest/p4/tests/Objects.py | 2 +- hackfest/p4/tests/__init__.py | 2 +- .../p4/tests/test_functional_bootstrap.py | 2 +- hackfest/p4/tests/test_functional_cleanup.py | 2 +- .../tests/test_functional_create_service.py | 2 +- .../tests/test_functional_delete_service.py | 2 +- hackfest/restconf/connection.yaml | 14 +++ .../swagger_server/database.py | 14 +++ .../swagger_server/swagger/swagger.yaml | 14 +++ hackfest/restconf/topology.yaml | 14 +++ .../swagger_server/swagger/swagger.yaml | 14 +++ hackfest/tapi/client/tapi-client.sh | 14 +++ hackfest/tapi/server/run.sh | 14 +++ hackfest/tapi/server/tapi_server/__main__.py | 14 +++ hackfest/tapi/server/tapi_server/database.py | 14 +++ .../server/tapi_server/swagger/swagger.yaml | 14 +++ hackfest/tapi/tapi-connectivity.yaml | 14 +++ hackfest/tapi/tapi_app/requirements.sh | 14 +++ hackfest/tapi/tapi_app/tapi_app.py | 14 +++ hackfest/yang/connection/connection.py | 14 +++ hackfest/yang/topology.py | 14 +++ hackfest/yang/topology.xml | 16 +++ install_requirements.sh | 2 +- manifests/.gitlab-ci.yml | 2 +- manifests/cockroachdb/single-node.yaml | 2 +- manifests/computeservice.yaml | 2 +- manifests/contextservice.yaml | 2 +- manifests/dbscanservingservice.yaml | 2 +- manifests/deviceservice.yaml | 2 +- manifests/dltservice.yaml | 2 +- manifests/interdomainservice.yaml | 2 +- manifests/l3_attackmitigatorservice.yaml | 2 +- .../l3_centralizedattackdetectorservice.yaml | 2 +- .../l3_distributedattackdetectorservice.yaml | 2 +- manifests/load_generatorservice.yaml | 2 +- manifests/mock_blockchain.yaml | 2 +- manifests/monitoringservice.yaml | 2 +- manifests/nginx_ingress_http.yaml | 14 +++ manifests/opticalattackmitigatorservice.yaml | 2 +- ...ticalcentralizedattackdetectorservice.yaml | 2 +- manifests/pathcompservice.yaml | 2 +- manifests/prometheus.yaml | 2 +- manifests/questdb/manifest.yaml | 2 +- manifests/servicemonitors.yaml | 14 +++ manifests/serviceservice.yaml | 2 +- manifests/sliceservice.yaml | 2 +- manifests/webuiservice.yaml | 2 +- my_deploy.sh | 2 +- proto/acl.proto | 2 +- proto/attack_mitigator.proto | 2 +- proto/automation.proto | 2 +- proto/centralized_attack_detector.proto | 2 +- proto/compute.proto | 2 +- proto/context.proto | 2 +- proto/context_policy.proto | 2 +- proto/dbscanserving.proto | 2 +- proto/device.proto | 2 +- proto/distributed_cybersecurity.proto | 2 +- proto/dlt_connector.proto | 2 +- proto/dlt_gateway.proto | 2 +- proto/forecaster.proto | 2 +- proto/generate_code_python.sh | 4 +- proto/generate_uml.sh | 2 +- proto/health.proto | 2 +- proto/interdomain.proto | 2 +- proto/kpi_sample_types.proto | 2 +- proto/l3_attackmitigator.proto | 2 +- proto/l3_centralizedattackdetector.proto | 2 +- proto/load_generator.proto | 2 +- proto/monitoring.proto | 2 +- proto/optical_attack_mitigator.proto | 2 +- .../optical_centralized_attack_detector.proto | 2 +- proto/pathcomp.proto | 2 +- proto/policy.proto | 2 +- proto/policy_action.proto | 2 +- proto/policy_condition.proto | 2 +- proto/service.proto | 2 +- proto/slice.proto | 2 +- proto/src/python/__init__.py | 2 +- proto/te.proto | 2 +- run_tests_docker.sh | 14 +++ scripts/add_license_header_to_files.sh | 3 +- scripts/build_run_report_tests_locally.sh | 2 +- scripts/cockroachdb_client.sh | 2 +- scripts/create_component.sh | 2 +- scripts/dump_logs.sh | 2 +- .../old/configure_dashboards_in_kubernetes.sh | 2 +- scripts/old/deploy_in_kubernetes.sh | 2 +- scripts/old/open_dashboard.sh | 2 +- scripts/old/open_webui.sh | 2 +- scripts/report_coverage_all.sh | 2 +- scripts/report_coverage_common.sh | 2 +- scripts/report_coverage_compute.sh | 2 +- scripts/report_coverage_context.sh | 2 +- scripts/report_coverage_device.sh | 2 +- scripts/report_coverage_l3_attackmitigator.sh | 2 +- ...t_coverage_l3_centralizedattackdetector.sh | 2 +- ...t_coverage_l3_distributedattackdetector.sh | 2 +- scripts/report_coverage_pathcomp.sh | 2 +- scripts/report_coverage_service.sh | 2 +- scripts/report_coverage_slice.sh | 2 +- scripts/run_tests_locally-compute.sh | 2 +- scripts/run_tests_locally-context.sh | 2 +- scripts/run_tests_locally-device-all.sh | 2 +- scripts/run_tests_locally-device-emulated.sh | 2 +- scripts/run_tests_locally-device-microwave.sh | 2 +- .../run_tests_locally-device-openconfig.sh | 2 +- scripts/run_tests_locally-device-p4.sh | 2 +- scripts/run_tests_locally-device-tapi.sh | 2 +- .../run_tests_locally-pathcomp-frontend.sh | 2 +- scripts/run_tests_locally-service.sh | 2 +- scripts/run_tests_locally-slice.sh | 2 +- scripts/run_tests_locally.sh | 2 +- scripts/show_logs_automation.sh | 2 +- scripts/show_logs_compute.sh | 2 +- scripts/show_logs_context.sh | 2 +- scripts/show_logs_device.sh | 2 +- scripts/show_logs_dlt_connector.sh | 2 +- scripts/show_logs_dlt_gateway.sh | 2 +- scripts/show_logs_monitoring.sh | 2 +- scripts/show_logs_pathcomp_backend.sh | 2 +- scripts/show_logs_pathcomp_frontend.sh | 2 +- scripts/show_logs_service.sh | 2 +- scripts/show_logs_slice.sh | 2 +- scripts/show_logs_webui.sh | 2 +- scripts/update_license_headers.py | 114 ++++++++++++++++++ src/__init__.py | 2 +- src/automation/.gitlab-ci.yml | 2 +- src/automation/mvnw | 0 src/automation/pom.xml | 2 +- .../src/main/docker/Dockerfile.multistage.jvm | 2 +- .../automation/AutomationConfiguration.java | 2 +- .../automation/AutomationGateway.java | 2 +- .../automation/AutomationGatewayImpl.java | 2 +- .../automation/AutomationService.java | 2 +- .../automation/AutomationServiceImpl.java | 2 +- .../automation/ContextSubscriber.java | 2 +- .../eu/teraflow/automation/Serializer.java | 2 +- .../automation/SimpleLivenessCheck.java | 2 +- .../automation/SimpleReadinessCheck.java | 2 +- .../eu/teraflow/automation/acl/AclAction.java | 2 +- .../eu/teraflow/automation/acl/AclEntry.java | 2 +- .../automation/acl/AclForwardActionEnum.java | 2 +- .../automation/acl/AclLogActionEnum.java | 2 +- .../eu/teraflow/automation/acl/AclMatch.java | 2 +- .../teraflow/automation/acl/AclRuleSet.java | 2 +- .../automation/acl/AclRuleTypeEnum.java | 2 +- .../eu/teraflow/automation/common/Util.java | 2 +- .../automation/context/ContextGateway.java | 2 +- .../context/ContextGatewayImpl.java | 2 +- .../automation/context/ContextService.java | 2 +- .../context/ContextServiceImpl.java | 2 +- .../context/model/ConfigActionEnum.java | 2 +- .../automation/context/model/ConfigRule.java | 2 +- .../context/model/ConfigRuleAcl.java | 2 +- .../context/model/ConfigRuleCustom.java | 2 +- .../context/model/ConfigRuleType.java | 2 +- .../context/model/ConfigRuleTypeAcl.java | 2 +- .../context/model/ConfigRuleTypeCustom.java | 2 +- .../automation/context/model/Device.java | 2 +- .../context/model/DeviceConfig.java | 2 +- .../context/model/DeviceDriverEnum.java | 2 +- .../automation/context/model/DeviceEvent.java | 2 +- .../model/DeviceOperationalStatus.java | 2 +- .../automation/context/model/Empty.java | 2 +- .../automation/context/model/EndPoint.java | 2 +- .../automation/context/model/EndPointId.java | 2 +- .../automation/context/model/Event.java | 2 +- .../context/model/EventTypeEnum.java | 2 +- .../automation/context/model/GpsPosition.java | 2 +- .../automation/context/model/Location.java | 2 +- .../context/model/LocationType.java | 2 +- .../model/LocationTypeGpsPosition.java | 2 +- .../context/model/LocationTypeRegion.java | 2 +- .../automation/context/model/TopologyId.java | 2 +- .../automation/device/DeviceGateway.java | 2 +- .../automation/device/DeviceGatewayImpl.java | 2 +- .../automation/device/DeviceService.java | 2 +- .../automation/device/DeviceServiceImpl.java | 2 +- .../kpi_sample_types/model/KpiSampleType.java | 2 +- .../teraflow/automation/model/DeviceRole.java | 2 +- .../automation/model/DeviceRoleConfig.java | 2 +- .../automation/model/DeviceRoleId.java | 2 +- .../automation/model/DeviceRoleType.java | 2 +- .../automation/model/DeviceState.java | 2 +- .../src/main/resources/application.yml | 2 +- .../AutomationFunctionalServiceTest.java | 2 +- .../automation/AutomationServiceTest.java | 2 +- .../automation/ConfigRuleTypeTest.java | 2 +- .../automation/ContextSubscriberTest.java | 16 +++ .../automation/EndPointCreationTest.java | 2 +- .../teraflow/automation/LocationTypeTest.java | 2 +- .../MockAutomationConfiguration.java | 16 +++ .../teraflow/automation/SerializerTest.java | 2 +- .../target/kubernetes/kubernetes.yml | 14 +++ src/automation/util/set_version.sh | 2 +- src/build.sh | 2 +- src/clean.sh | 2 +- src/common/Constants.py | 2 +- src/common/DeviceTypes.py | 2 +- src/common/Settings.py | 2 +- src/common/__init__.py | 2 +- src/common/logger.py | 2 +- src/common/message_broker/Constants.py | 2 +- src/common/message_broker/Factory.py | 2 +- src/common/message_broker/Message.py | 2 +- src/common/message_broker/MessageBroker.py | 2 +- src/common/message_broker/__init__.py | 2 +- .../message_broker/backend/BackendEnum.py | 2 +- src/common/message_broker/backend/_Backend.py | 2 +- src/common/message_broker/backend/__init__.py | 2 +- .../backend/inmemory/InMemoryBackend.py | 2 +- .../backend/inmemory/__init__.py | 2 +- .../backend/nats/NatsBackend.py | 2 +- .../backend/nats/NatsBackendThread.py | 2 +- .../message_broker/backend/nats/__init__.py | 2 +- .../backend/redis/RedisBackend.py | 2 +- .../message_broker/backend/redis/__init__.py | 2 +- src/common/message_broker/tests/__init__.py | 2 +- .../message_broker/tests/test_unitary.py | 2 +- src/common/method_wrappers/Decorator.py | 2 +- .../method_wrappers/ServiceExceptions.py | 2 +- src/common/method_wrappers/__init__.py | 2 +- .../results-perf-eval/MW/generate.sh | 14 +++ .../results-perf-eval/MW/generate_plot.py | 14 +++ .../results-perf-eval/OpenConfig/generate.sh | 14 +++ .../OpenConfig/generate_plot.py | 14 +++ .../results-perf-eval/TE/te-cdf.py | 14 +++ .../results-perf-eval/XR/generate.sh | 14 +++ .../results-perf-eval/XR/generate_plot.py | 14 +++ .../results-perf-eval/emulated/generate.sh | 14 +++ .../emulated/generate_plot.py | 14 +++ .../tests/DummyDeviceDriver.py | 2 +- src/common/method_wrappers/tests/__init__.py | 2 +- src/common/method_wrappers/tests/__main__.py | 2 +- .../method_wrappers/tests/deploy_specs.sh | 14 +++ .../tests/old/docker_grafana.sh | 2 +- .../method_wrappers/tests/old/prometheus.yml | 2 +- .../method_wrappers/tests/test_unitary.py | 2 +- src/common/tests/EventTools.py | 2 +- src/common/tests/LoadScenario.py | 2 +- src/common/tests/MockMessageBroker.py | 2 +- src/common/tests/MockServicerImpl_Context.py | 2 +- src/common/tests/MockServicerImpl_Device.py | 2 +- .../tests/MockServicerImpl_DltGateway.py | 2 +- .../tests/MockServicerImpl_Monitoring.py | 2 +- src/common/tests/MockServicerImpl_Service.py | 2 +- src/common/tests/MockServicerImpl_Slice.py | 2 +- src/common/tests/PytestGenerateTests.py | 2 +- src/common/tests/__init__.py | 2 +- src/common/tools/__init__.py | 2 +- src/common/tools/client/RetryDecorator.py | 2 +- src/common/tools/client/__init__.py | 2 +- src/common/tools/context_queries/CheckType.py | 2 +- src/common/tools/context_queries/Context.py | 2 +- src/common/tools/context_queries/Device.py | 2 +- src/common/tools/context_queries/EndPoint.py | 2 +- .../tools/context_queries/InterDomain.py | 2 +- src/common/tools/context_queries/Link.py | 2 +- src/common/tools/context_queries/Service.py | 2 +- src/common/tools/context_queries/Slice.py | 2 +- src/common/tools/context_queries/Topology.py | 2 +- src/common/tools/context_queries/__init__.py | 2 +- src/common/tools/descriptor/Loader.py | 2 +- src/common/tools/descriptor/Tools.py | 2 +- src/common/tools/descriptor/__init__.py | 2 +- .../tools/descriptor/old/BuildDescriptors.py | 2 +- .../tools/descriptor/old/LoadDescriptors.py | 2 +- src/common/tools/grpc/ConfigRules.py | 2 +- src/common/tools/grpc/Constraints.py | 2 +- src/common/tools/grpc/EndPointIds.py | 2 +- src/common/tools/grpc/ServiceIds.py | 2 +- src/common/tools/grpc/Tools.py | 2 +- src/common/tools/grpc/__init__.py | 2 +- src/common/tools/mutex_queues/MutexQueues.py | 2 +- src/common/tools/mutex_queues/__init__.py | 2 +- src/common/tools/object_factory/ConfigRule.py | 2 +- src/common/tools/object_factory/Connection.py | 2 +- src/common/tools/object_factory/Constraint.py | 2 +- src/common/tools/object_factory/Context.py | 2 +- src/common/tools/object_factory/Device.py | 2 +- src/common/tools/object_factory/EndPoint.py | 2 +- src/common/tools/object_factory/Link.py | 2 +- src/common/tools/object_factory/PolicyRule.py | 2 +- src/common/tools/object_factory/Service.py | 2 +- src/common/tools/object_factory/Slice.py | 2 +- src/common/tools/object_factory/Topology.py | 2 +- src/common/tools/object_factory/__init__.py | 2 +- .../tools/service/GenericGrpcService.py | 2 +- src/common/tools/service/GenericRestServer.py | 2 +- src/common/tools/service/__init__.py | 2 +- src/common/tools/timestamp/Converters.py | 2 +- src/common/tools/timestamp/__init__.py | 2 +- src/common/type_checkers/Assertions.py | 2 +- src/common/type_checkers/Checkers.py | 2 +- src/common/type_checkers/__init__.py | 2 +- src/compute/.gitlab-ci.yml | 2 +- src/compute/Config.py | 2 +- src/compute/Dockerfile | 2 +- src/compute/__init__.py | 2 +- src/compute/client/ComputeClient.py | 2 +- src/compute/client/__init__.py | 2 +- src/compute/requirements.in | 14 +++ src/compute/service/ComputeService.py | 2 +- .../service/ComputeServiceServicerImpl.py | 2 +- src/compute/service/__init__.py | 2 +- src/compute/service/__main__.py | 2 +- src/compute/service/rest_server/RestServer.py | 2 +- src/compute/service/rest_server/__init__.py | 2 +- .../rest_server/nbi_plugins/__init__.py | 2 +- .../nbi_plugins/debug_api/Resources.py | 2 +- .../nbi_plugins/debug_api/__init__.py | 2 +- .../nbi_plugins/ietf_l2vpn/Constants.py | 2 +- .../nbi_plugins/ietf_l2vpn/L2VPN_Service.py | 2 +- .../nbi_plugins/ietf_l2vpn/L2VPN_Services.py | 2 +- .../ietf_l2vpn/L2VPN_SiteNetworkAccesses.py | 2 +- .../nbi_plugins/ietf_l2vpn/__init__.py | 2 +- .../nbi_plugins/ietf_l2vpn/schemas/Common.py | 2 +- .../ietf_l2vpn/schemas/__init__.py | 2 +- .../ietf_l2vpn/schemas/site_network_access.py | 2 +- .../ietf_l2vpn/schemas/vpn_service.py | 2 +- .../ietf_l2vpn/tools/Authentication.py | 2 +- .../ietf_l2vpn/tools/HttpStatusCodes.py | 2 +- .../nbi_plugins/ietf_l2vpn/tools/Validator.py | 2 +- .../nbi_plugins/ietf_l2vpn/tools/__init__.py | 2 +- src/compute/tests/Constants.py | 2 +- src/compute/tests/MockService_Dependencies.py | 2 +- src/compute/tests/PrepareTestScenario.py | 2 +- src/compute/tests/__init__.py | 2 +- src/compute/tests/test_debug_api.py | 2 +- src/compute/tests/test_unitary.py | 2 +- src/context/.gitlab-ci.yml | 2 +- src/context/Config.py | 2 +- src/context/Dockerfile | 2 +- src/context/__init__.py | 2 +- src/context/client/ContextClient.py | 2 +- src/context/client/EventsCollector.py | 2 +- src/context/client/__init__.py | 2 +- src/context/data/cleanup_commands.sql | 14 +++ src/context/requirements.in | 14 +++ src/context/service/ContextService.py | 2 +- .../service/ContextServiceServicerImpl.py | 2 +- src/context/service/Events.py | 2 +- src/context/service/__init__.py | 2 +- src/context/service/__main__.py | 2 +- src/context/service/database/ConfigRule.py | 2 +- src/context/service/database/Connection.py | 2 +- src/context/service/database/Constraint.py | 2 +- src/context/service/database/Context.py | 2 +- src/context/service/database/Device.py | 2 +- src/context/service/database/EndPoint.py | 2 +- src/context/service/database/Engine.py | 2 +- src/context/service/database/Link.py | 2 +- src/context/service/database/PolicyRule.py | 2 +- src/context/service/database/Service.py | 2 +- src/context/service/database/Slice.py | 2 +- src/context/service/database/Topology.py | 2 +- src/context/service/database/__init__.py | 2 +- .../database/models/ConfigRuleModel.py | 2 +- .../database/models/ConnectionModel.py | 2 +- .../database/models/ConstraintModel.py | 2 +- .../service/database/models/ContextModel.py | 2 +- .../service/database/models/DeviceModel.py | 2 +- .../service/database/models/EndPointModel.py | 2 +- .../service/database/models/LinkModel.py | 2 +- .../database/models/PolicyRuleModel.py | 2 +- .../service/database/models/ServiceModel.py | 2 +- .../service/database/models/SliceModel.py | 2 +- .../service/database/models/TopologyModel.py | 2 +- src/context/service/database/models/_Base.py | 2 +- .../service/database/models/__init__.py | 2 +- .../database/models/enums/ConfigAction.py | 2 +- .../database/models/enums/DeviceDriver.py | 2 +- .../models/enums/DeviceOperationalStatus.py | 2 +- .../database/models/enums/KpiSampleType.py | 2 +- .../database/models/enums/PolicyRuleState.py | 2 +- .../database/models/enums/ServiceStatus.py | 2 +- .../database/models/enums/ServiceType.py | 2 +- .../database/models/enums/SliceStatus.py | 2 +- .../database/models/enums/_GrpcToEnum.py | 2 +- .../service/database/models/enums/__init__.py | 2 +- .../service/database/tools/FastHasher.py | 2 +- .../service/database/tools/__init__.py | 2 +- .../service/database/uuids/Connection.py | 2 +- src/context/service/database/uuids/Context.py | 2 +- src/context/service/database/uuids/Device.py | 2 +- .../service/database/uuids/EndPoint.py | 2 +- src/context/service/database/uuids/Link.py | 2 +- .../service/database/uuids/PolicuRule.py | 2 +- src/context/service/database/uuids/Service.py | 2 +- src/context/service/database/uuids/Slice.py | 2 +- .../service/database/uuids/Topology.py | 2 +- .../service/database/uuids/_Builder.py | 2 +- .../service/database/uuids/__init__.py | 2 +- src/context/tests/Constants.py | 2 +- src/context/tests/Objects.py | 2 +- src/context/tests/__init__.py | 2 +- src/context/tests/conftest.py | 2 +- src/context/tests/test_connection.py | 2 +- src/context/tests/test_context.py | 2 +- src/context/tests/test_device.py | 2 +- src/context/tests/test_hasher.py | 2 +- src/context/tests/test_link.py | 2 +- src/context/tests/test_policy.py | 2 +- src/context/tests/test_service.py | 2 +- src/context/tests/test_slice.py | 2 +- src/context/tests/test_topology.py | 2 +- src/dbscanserving/.gitlab-ci.yml | 2 +- src/dbscanserving/Config.py | 2 +- src/dbscanserving/Dockerfile | 2 +- src/dbscanserving/__init__.py | 2 +- .../client/DbscanServingClient.py | 2 +- src/dbscanserving/client/__init__.py | 2 +- src/dbscanserving/genproto.sh | 4 +- src/dbscanserving/proto/__init__.py | 2 +- src/dbscanserving/requirements.in | 15 +++ src/dbscanserving/requirements.txt | 15 +++ src/dbscanserving/service/DbscanService.py | 2 +- .../service/DbscanServiceServicerImpl.py | 2 +- src/dbscanserving/service/__init__.py | 2 +- src/dbscanserving/service/__main__.py | 2 +- src/dbscanserving/tests/__init__.py | 2 +- src/dbscanserving/tests/test_unitary.py | 2 +- src/device/.gitlab-ci.yml | 2 +- src/device/Config.py | 2 +- src/device/Dockerfile | 2 +- src/device/__init__.py | 2 +- src/device/client/DeviceClient.py | 2 +- src/device/client/__init__.py | 2 +- src/device/requirements.in | 15 +++ src/device/service/DeviceService.py | 2 +- .../service/DeviceServiceServicerImpl.py | 2 +- src/device/service/Errors.py | 2 +- src/device/service/Tools.py | 2 +- src/device/service/__init__.py | 2 +- src/device/service/__main__.py | 2 +- src/device/service/driver_api/AnyTreeTools.py | 2 +- .../service/driver_api/DriverFactory.py | 2 +- .../service/driver_api/DriverInstanceCache.py | 2 +- src/device/service/driver_api/Exceptions.py | 2 +- src/device/service/driver_api/FilterFields.py | 2 +- src/device/service/driver_api/_Driver.py | 2 +- src/device/service/driver_api/__init__.py | 2 +- src/device/service/drivers/__init__.py | 2 +- .../service/drivers/emulated/Constants.py | 2 +- .../drivers/emulated/EmulatedDriver.py | 2 +- .../emulated/SyntheticSamplingParameters.py | 2 +- src/device/service/drivers/emulated/Tools.py | 2 +- .../service/drivers/emulated/__init__.py | 2 +- .../drivers/microwave/IETFApiDriver.py | 2 +- src/device/service/drivers/microwave/Tools.py | 2 +- .../service/drivers/microwave/__init__.py | 2 +- .../drivers/openconfig/OpenConfigDriver.py | 2 +- .../drivers/openconfig/RetryDecorator.py | 2 +- .../service/drivers/openconfig/Tools.py | 2 +- .../service/drivers/openconfig/__init__.py | 2 +- src/device/service/drivers/p4/__init__.py | 2 +- src/device/service/drivers/p4/p4_client.py | 2 +- src/device/service/drivers/p4/p4_common.py | 2 +- src/device/service/drivers/p4/p4_context.py | 2 +- src/device/service/drivers/p4/p4_driver.py | 2 +- src/device/service/drivers/p4/p4_exception.py | 2 +- .../service/drivers/p4/p4_global_options.py | 2 +- src/device/service/drivers/p4/p4_manager.py | 2 +- .../service/drivers/transport_api/Tools.py | 2 +- .../transport_api/TransportApiDriver.py | 2 +- .../service/drivers/transport_api/__init__.py | 2 +- src/device/service/drivers/xr/XrDriver.py | 2 +- src/device/service/drivers/xr/__init__.py | 2 +- src/device/service/drivers/xr/cm-cli.py | 2 +- src/device/service/drivers/xr/cm/__init__.py | 2 +- .../service/drivers/xr/cm/cm_connection.py | 2 +- .../service/drivers/xr/cm/connection.py | 2 +- .../service/drivers/xr/cm/constellation.py | 2 +- .../service/drivers/xr/cm/tests/__init__.py | 2 +- .../drivers/xr/cm/tests/test_cm_connection.py | 2 +- .../drivers/xr/cm/tests/test_connection.py | 2 +- .../drivers/xr/cm/tests/test_constellation.py | 2 +- .../xr/cm/tests/test_transport_capacitity.py | 2 +- .../xr/cm/tests/test_xr_service_set_config.py | 2 +- src/device/service/drivers/xr/cm/tf.py | 2 +- .../service/drivers/xr/cm/tf_service.py | 2 +- .../drivers/xr/cm/transport_capacity.py | 2 +- src/device/service/drivers/xr/cm/utils.py | 2 +- .../service/drivers/xr/setup_test_env.sh | 14 +++ .../service/monitoring/MonitoringLoop.py | 2 +- .../service/monitoring/MonitoringLoops.py | 2 +- src/device/service/monitoring/__init__.py | 2 +- src/device/tests/CommonObjects.py | 2 +- src/device/tests/Device_Emulated.py | 2 +- src/device/tests/Device_Microwave_Template.py | 2 +- .../tests/Device_OpenConfig_Template.py | 2 +- .../tests/Device_Transport_Api_Template.py | 2 +- src/device/tests/MockService_Dependencies.py | 2 +- src/device/tests/PrepareTestScenario.py | 2 +- src/device/tests/__init__.py | 2 +- src/device/tests/device_p4.py | 2 +- src/device/tests/mock_p4runtime_service.py | 2 +- .../tests/mock_p4runtime_servicer_impl.py | 2 +- src/device/tests/test_internal_p4.py | 2 +- src/device/tests/test_unitary_emulated.py | 2 +- src/device/tests/test_unitary_microwave.py | 2 +- src/device/tests/test_unitary_openconfig.py | 2 +- src/device/tests/test_unitary_p4.py | 2 +- src/device/tests/test_unitary_tapi.py | 2 +- src/dlt/.gitlab-ci.yml | 2 +- src/dlt/__init__.py | 2 +- src/dlt/connector/Config.py | 2 +- src/dlt/connector/Dockerfile | 2 +- src/dlt/connector/__init__.py | 2 +- .../connector/client/DltConnectorClient.py | 2 +- .../connector/client/DltEventsCollector.py | 2 +- src/dlt/connector/client/DltGatewayClient.py | 2 +- src/dlt/connector/client/__init__.py | 2 +- src/dlt/connector/main_test.py | 14 +++ src/dlt/connector/requirements.in | 14 +++ .../connector/service/DltConnectorService.py | 2 +- .../DltConnectorServiceServicerImpl.py | 2 +- src/dlt/connector/service/__init__.py | 2 +- src/dlt/connector/service/__main__.py | 2 +- .../event_dispatcher/DltEventDispatcher.py | 2 +- .../service/event_dispatcher/__init__.py | 2 +- src/dlt/connector/service/tools/Checkers.py | 2 +- src/dlt/connector/service/tools/__init__.py | 2 +- .../tests/MockService_Dependencies.py | 2 +- src/dlt/connector/tests/Objects.py | 2 +- .../connector/tests/PrepareTestScenario.py | 2 +- src/dlt/connector/tests/__init__.py | 2 +- src/dlt/connector/tests/test_unitary.py | 2 +- src/dlt/gateway/settings.gradle.kts | 16 +++ src/dlt/mock_blockchain/Dockerfile | 2 +- src/dlt/mock_blockchain/__init__.py | 2 +- src/dlt/mock_blockchain/requirements.in | 14 +++ src/dlt/mock_blockchain/service/__init__.py | 2 +- src/dlt/mock_blockchain/service/__main__.py | 2 +- src/gitlab-ci.yml_generator.py | 2 +- src/interdomain/.gitlab-ci.yml | 2 +- src/interdomain/Config.py | 2 +- src/interdomain/Dockerfile | 2 +- src/interdomain/__init__.py | 2 +- src/interdomain/client/InterdomainClient.py | 2 +- src/interdomain/client/__init__.py | 2 +- src/interdomain/requirements.in | 14 +++ src/interdomain/service/InterdomainService.py | 2 +- .../service/InterdomainServiceServicerImpl.py | 2 +- .../service/RemoteDomainClients.py | 2 +- src/interdomain/service/Tools.py | 2 +- src/interdomain/service/__init__.py | 2 +- src/interdomain/service/__main__.py | 2 +- .../InterdomainServiceServicerImpl.py | 2 +- .../topology_abstractor/AbstractDevice.py | 2 +- .../topology_abstractor/AbstractLink.py | 2 +- .../topology_abstractor/DltRecordSender.py | 2 +- .../topology_abstractor/TopologyAbstractor.py | 2 +- .../service/topology_abstractor/Types.py | 2 +- .../service/topology_abstractor/__init__.py | 2 +- src/interdomain/tests/__init__.py | 2 +- src/interdomain/tests/test_unitary.py | 2 +- src/l3_attackmitigator/.gitlab-ci.yml | 2 +- src/l3_attackmitigator/Config.py | 2 +- src/l3_attackmitigator/Dockerfile | 2 +- src/l3_attackmitigator/__init__.py | 2 +- src/l3_attackmitigator/client/__init__.py | 2 +- .../client/l3_attackmitigatorClient.py | 2 +- src/l3_attackmitigator/requirements.in | 14 +++ src/l3_attackmitigator/service/__init__.py | 2 +- src/l3_attackmitigator/service/__main__.py | 2 +- .../service/l3_attackmitigatorService.py | 2 +- .../l3_attackmitigatorServiceServicerImpl.py | 2 +- src/l3_attackmitigator/tests/__init__.py | 2 +- src/l3_attackmitigator/tests/test_unitary.py | 2 +- .../.gitlab-ci.yml | 2 +- src/l3_centralizedattackdetector/Config.py | 2 +- src/l3_centralizedattackdetector/Dockerfile | 2 +- src/l3_centralizedattackdetector/__init__.py | 2 +- .../client/__init__.py | 2 +- .../l3_centralizedattackdetectorClient.py | 2 +- .../requirements.in | 14 +++ .../service/__init__.py | 2 +- .../service/__main__.py | 2 +- .../l3_centralizedattackdetectorService.py | 2 +- ...alizedattackdetectorServiceServicerImpl.py | 2 +- .../service/ml_model/teraflow_rf.onnx | Bin 126743 -> 0 bytes .../tests/__init__.py | 2 +- .../tests/test_unitary.py | 2 +- .../.gitlab-ci.yml | 2 +- src/l3_distributedattackdetector/Config.py | 2 +- src/l3_distributedattackdetector/Dockerfile | 2 +- src/l3_distributedattackdetector/__init__.py | 2 +- .../requirements.in | 14 +++ .../service/__init__.py | 2 +- .../service/__main__.py | 2 +- .../tests/__init__.py | 2 +- .../tests/data_generator.py | 2 +- .../tests/test_unitary.py | 2 +- src/load_generator/.gitlab-ci.yml | 2 +- src/load_generator/Config.py | 2 +- src/load_generator/Dockerfile | 2 +- src/load_generator/__init__.py | 2 +- .../client/LoadGeneratorClient.py | 2 +- src/load_generator/client/__init__.py | 2 +- src/load_generator/command/__init__.py | 2 +- src/load_generator/command/__main__.py | 2 +- src/load_generator/load_gen/Constants.py | 2 +- src/load_generator/load_gen/DltTools.py | 2 +- src/load_generator/load_gen/Parameters.py | 2 +- .../load_gen/RequestGenerator.py | 2 +- .../load_gen/RequestScheduler.py | 2 +- src/load_generator/load_gen/__init__.py | 2 +- src/load_generator/requirements.in | 2 +- src/load_generator/run.sh | 2 +- .../service/LoadGeneratorService.py | 2 +- .../LoadGeneratorServiceServicerImpl.py | 2 +- src/load_generator/service/__init__.py | 2 +- src/load_generator/service/__main__.py | 2 +- src/load_generator/tests/__init__.py | 2 +- src/load_generator/tests/deploy_specs.sh | 14 +++ .../tests/test_dlt_functional.py | 2 +- src/monitoring/.gitlab-ci.yml | 2 +- src/monitoring/Dockerfile | 2 +- src/monitoring/__init__.py | 2 +- src/monitoring/client/MonitoringClient.py | 2 +- src/monitoring/client/__init__.py | 2 +- src/monitoring/requirements.in | 14 +++ src/monitoring/service/AlarmManager.py | 14 +++ src/monitoring/service/EventTools.py | 2 +- src/monitoring/service/InfluxTools.py | 2 +- src/monitoring/service/ManagementDBTools.py | 2 +- src/monitoring/service/MetricsDBTools.py | 2 +- src/monitoring/service/MonitoringService.py | 2 +- .../service/MonitoringServiceServicerImpl.py | 2 +- src/monitoring/service/NameMapping.py | 2 +- src/monitoring/service/SubscriptionManager.py | 2 +- src/monitoring/service/__init__.py | 2 +- src/monitoring/service/__main__.py | 2 +- src/monitoring/tests/Messages.py | 2 +- src/monitoring/tests/Objects.py | 2 +- src/monitoring/tests/__init__.py | 2 +- src/monitoring/tests/test_unitary.py | 2 +- src/opticalattackmitigator/.gitlab-ci.yml | 2 +- src/opticalattackmitigator/Config.py | 2 +- src/opticalattackmitigator/Dockerfile | 2 +- src/opticalattackmitigator/__init__.py | 2 +- .../client/OpticalAttackMitigatorClient.py | 2 +- src/opticalattackmitigator/client/__init__.py | 2 +- src/opticalattackmitigator/genproto.sh | 4 +- src/opticalattackmitigator/proto/__init__.py | 2 +- src/opticalattackmitigator/requirements.in | 14 +++ .../service/OpticalAttackMitigatorService.py | 2 +- ...ticalAttackMitigatorServiceServicerImpl.py | 2 +- .../service/__init__.py | 2 +- .../service/__main__.py | 2 +- src/opticalattackmitigator/tests/__init__.py | 2 +- .../tests/test_unitary.py | 2 +- .../.gitlab-ci.yml | 2 +- .../Config.py | 2 +- .../Dockerfile | 2 +- .../__init__.py | 2 +- .../OpticalCentralizedAttackDetectorClient.py | 2 +- .../client/__init__.py | 2 +- .../genproto.sh | 4 +- .../proto/__init__.py | 2 +- .../requirements.in | 14 +++ .../requirements.txt | 14 +++ ...OpticalCentralizedAttackDetectorService.py | 2 +- ...alizedAttackDetectorServiceServicerImpl.py | 2 +- .../service/__init__.py | 2 +- .../service/__main__.py | 2 +- .../tests/__init__.py | 2 +- .../tests/example_objects.py | 2 +- .../tests/test_unitary.py | 2 +- src/pathcomp/.gitlab-ci.yml | 2 +- src/pathcomp/__init__.py | 2 +- src/pathcomp/backend/Dockerfile | 2 +- src/pathcomp/backend/Dockerfile-gdb | 2 +- src/pathcomp/backend/Makefile | 7 +- src/pathcomp/backend/pathComp.c | 8 +- src/pathcomp/backend/pathComp.h | 7 +- src/pathcomp/backend/pathComp_RESTapi.c | 9 +- src/pathcomp/backend/pathComp_RESTapi.h | 7 +- src/pathcomp/backend/pathComp_cjson.c | 8 +- src/pathcomp/backend/pathComp_cjson.h | 8 +- src/pathcomp/backend/pathComp_ksp.c | 9 +- src/pathcomp/backend/pathComp_ksp.h | 7 +- src/pathcomp/backend/pathComp_log.c | 17 ++- src/pathcomp/backend/pathComp_log.h | 8 +- src/pathcomp/backend/pathComp_sp.c | 19 ++- src/pathcomp/backend/pathComp_sp.h | 7 +- src/pathcomp/backend/pathComp_tools.c | 8 +- src/pathcomp/backend/pathComp_tools.h | 8 +- src/pathcomp/backend/tests/run-test.sh | 14 +++ src/pathcomp/frontend/Config.py | 2 +- src/pathcomp/frontend/Dockerfile | 2 +- src/pathcomp/frontend/__init__.py | 2 +- .../frontend/client/PathCompClient.py | 2 +- src/pathcomp/frontend/client/__init__.py | 2 +- src/pathcomp/frontend/requirements.in | 15 +++ .../frontend/service/PathCompService.py | 2 +- .../service/PathCompServiceServicerImpl.py | 2 +- src/pathcomp/frontend/service/__init__.py | 2 +- src/pathcomp/frontend/service/__main__.py | 2 +- .../frontend/service/algorithms/Factory.py | 2 +- .../algorithms/KDisjointPathAlgorithm.py | 2 +- .../algorithms/KShortestPathAlgorithm.py | 2 +- .../algorithms/ShortestPathAlgorithm.py | 2 +- .../frontend/service/algorithms/_Algorithm.py | 2 +- .../frontend/service/algorithms/__init__.py | 2 +- .../algorithms/tools/ComposeRequest.py | 2 +- .../algorithms/tools/ComputeSubServices.py | 2 +- .../algorithms/tools/ConstantsMappings.py | 2 +- .../service/algorithms/tools/EroPathToHops.py | 2 +- .../service/algorithms/tools/__init__.py | 2 +- .../tests/MockService_Dependencies.py | 2 +- src/pathcomp/frontend/tests/Objects_A_B_C.py | 2 +- .../frontend/tests/Objects_DC_CSGW_TN.py | 2 +- .../frontend/tests/Objects_DC_CSGW_TN_OLS.py | 2 +- .../frontend/tests/PrepareTestScenario.py | 2 +- src/pathcomp/frontend/tests/__init__.py | 2 +- src/pathcomp/frontend/tests/test_unitary.py | 2 +- src/pathcomp/misc/my_deploy-tests.sh | 14 +++ src/pathcomp/misc/test-commands.sh | 2 +- src/policy/.gitlab-ci.yml | 2 +- src/policy/mvnw | 0 src/policy/pom.xml | 2 +- .../src/main/docker/Dockerfile.multistage.jvm | 2 +- .../eu/teraflow/policy/PolicyGateway.java | 2 +- .../eu/teraflow/policy/PolicyGatewayImpl.java | 2 +- .../PolicyRuleConditionFieldsGetter.java | 2 +- .../policy/PolicyRuleConditionValidator.java | 2 +- .../eu/teraflow/policy/PolicyService.java | 2 +- .../eu/teraflow/policy/PolicyServiceImpl.java | 2 +- .../java/eu/teraflow/policy/Serializer.java | 2 +- .../teraflow/policy/SimpleLivenessCheck.java | 2 +- .../teraflow/policy/SimpleReadinessCheck.java | 2 +- .../eu/teraflow/policy/acl/AclAction.java | 2 +- .../java/eu/teraflow/policy/acl/AclEntry.java | 2 +- .../policy/acl/AclForwardActionEnum.java | 2 +- .../teraflow/policy/acl/AclLogActionEnum.java | 2 +- .../java/eu/teraflow/policy/acl/AclMatch.java | 2 +- .../eu/teraflow/policy/acl/AclRuleSet.java | 2 +- .../teraflow/policy/acl/AclRuleTypeEnum.java | 2 +- .../java/eu/teraflow/policy/common/Util.java | 16 +++ .../policy/context/ContextGateway.java | 2 +- .../policy/context/ContextGatewayImpl.java | 2 +- .../policy/context/ContextService.java | 2 +- .../policy/context/ContextServiceImpl.java | 2 +- .../context/model/ConfigActionEnum.java | 2 +- .../policy/context/model/ConfigRule.java | 2 +- .../policy/context/model/ConfigRuleAcl.java | 2 +- .../context/model/ConfigRuleCustom.java | 2 +- .../policy/context/model/ConfigRuleType.java | 2 +- .../context/model/ConfigRuleTypeAcl.java | 2 +- .../context/model/ConfigRuleTypeCustom.java | 2 +- .../policy/context/model/Constraint.java | 2 +- .../context/model/ConstraintCustom.java | 2 +- .../model/ConstraintEndPointLocation.java | 2 +- .../context/model/ConstraintSchedule.java | 2 +- .../model/ConstraintSlaAvailability.java | 2 +- .../context/model/ConstraintSlaCapacity.java | 2 +- .../model/ConstraintSlaIsolationLevel.java | 2 +- .../context/model/ConstraintSlaLatency.java | 2 +- .../policy/context/model/ConstraintType.java | 2 +- .../context/model/ConstraintTypeCustom.java | 2 +- .../model/ConstraintTypeEndPointLocation.java | 2 +- .../context/model/ConstraintTypeSchedule.java | 2 +- .../model/ConstraintTypeSlaAvailability.java | 2 +- .../model/ConstraintTypeSlaCapacity.java | 2 +- .../ConstraintTypeSlaIsolationLevel.java | 2 +- .../model/ConstraintTypeSlaLatency.java | 2 +- .../teraflow/policy/context/model/Device.java | 2 +- .../policy/context/model/DeviceConfig.java | 2 +- .../context/model/DeviceDriverEnum.java | 2 +- .../model/DeviceOperationalStatus.java | 2 +- .../teraflow/policy/context/model/Empty.java | 2 +- .../policy/context/model/EndPoint.java | 2 +- .../policy/context/model/EndPointId.java | 2 +- .../teraflow/policy/context/model/Event.java | 2 +- .../policy/context/model/EventTypeEnum.java | 2 +- .../policy/context/model/GpsPosition.java | 2 +- .../context/model/IsolationLevelEnum.java | 2 +- .../policy/context/model/Location.java | 2 +- .../policy/context/model/LocationType.java | 2 +- .../model/LocationTypeGpsPosition.java | 16 +++ .../context/model/LocationTypeRegion.java | 2 +- .../policy/context/model/Service.java | 2 +- .../policy/context/model/ServiceConfig.java | 2 +- .../policy/context/model/ServiceId.java | 2 +- .../policy/context/model/ServiceStatus.java | 2 +- .../context/model/ServiceStatusEnum.java | 2 +- .../policy/context/model/ServiceTypeEnum.java | 2 +- .../policy/context/model/SliceId.java | 2 +- .../policy/context/model/TopologyId.java | 2 +- .../teraflow/policy/device/DeviceGateway.java | 2 +- .../policy/device/DeviceGatewayImpl.java | 2 +- .../teraflow/policy/device/DeviceService.java | 2 +- .../policy/device/DeviceServiceImpl.java | 2 +- .../kpi_sample_types/model/KpiSampleType.java | 2 +- .../policy/model/BooleanOperator.java | 2 +- .../policy/model/NumericalOperator.java | 2 +- .../eu/teraflow/policy/model/PolicyRule.java | 2 +- .../policy/model/PolicyRuleAction.java | 2 +- .../policy/model/PolicyRuleActionConfig.java | 16 +++ .../policy/model/PolicyRuleActionEnum.java | 2 +- .../policy/model/PolicyRuleBasic.java | 2 +- .../policy/model/PolicyRuleCondition.java | 2 +- .../policy/model/PolicyRuleDevice.java | 2 +- .../policy/model/PolicyRuleService.java | 2 +- .../policy/model/PolicyRuleState.java | 2 +- .../policy/model/PolicyRuleStateEnum.java | 2 +- .../teraflow/policy/model/PolicyRuleType.java | 2 +- .../policy/model/PolicyRuleTypeDevice.java | 2 +- .../policy/model/PolicyRuleTypeService.java | 2 +- .../policy/monitoring/MonitoringGateway.java | 2 +- .../monitoring/MonitoringGatewayImpl.java | 2 +- .../policy/monitoring/MonitoringService.java | 2 +- .../monitoring/MonitoringServiceImpl.java | 2 +- .../monitoring/model/AlarmDescriptor.java | 2 +- .../monitoring/model/AlarmResponse.java | 2 +- .../monitoring/model/AlarmSubscription.java | 2 +- .../monitoring/model/BooleanKpiValue.java | 2 +- .../monitoring/model/FloatKpiValue.java | 2 +- .../monitoring/model/IntegerKpiValue.java | 2 +- .../teraflow/policy/monitoring/model/Kpi.java | 2 +- .../monitoring/model/KpiDescriptor.java | 2 +- .../policy/monitoring/model/KpiValue.java | 2 +- .../monitoring/model/KpiValueRange.java | 2 +- .../policy/monitoring/model/LongKpiValue.java | 2 +- .../monitoring/model/MonitorKpiRequest.java | 2 +- .../monitoring/model/StringKpiValue.java | 2 +- .../monitoring/model/SubsDescriptor.java | 2 +- .../policy/monitoring/model/SubsResponse.java | 2 +- .../policy/service/ServiceGateway.java | 2 +- .../policy/service/ServiceGatewayImpl.java | 2 +- .../policy/service/ServiceService.java | 2 +- .../policy/service/ServiceServiceImpl.java | 2 +- src/policy/src/main/resources/application.yml | 2 +- .../teraflow/policy/ConfigRuleTypeTest.java | 2 +- .../teraflow/policy/ConstraintTypeTest.java | 2 +- .../teraflow/policy/EndPointCreationTest.java | 2 +- .../eu/teraflow/policy/LocationTypeTest.java | 2 +- .../policy/PolicyRuleBasicValidationTest.java | 2 +- .../PolicyRuleConditionValidationTest.java | 2 +- .../PolicyRuleDeviceValidationTest.java | 2 +- .../PolicyRuleServiceValidationTest.java | 2 +- .../eu/teraflow/policy/PolicyServiceTest.java | 2 +- .../eu/teraflow/policy/SerializerTest.java | 2 +- src/policy/target/kubernetes/kubernetes.yml | 14 +++ src/policy/util/set_version.sh | 2 +- src/service/.gitlab-ci.yml | 2 +- src/service/Config.py | 2 +- src/service/Dockerfile | 2 +- src/service/__init__.py | 2 +- src/service/client/ServiceClient.py | 2 +- src/service/client/__init__.py | 2 +- src/service/requirements.in | 15 +++ src/service/service/ServiceService.py | 2 +- .../service/ServiceServiceServicerImpl.py | 2 +- src/service/service/__init__.py | 2 +- src/service/service/__main__.py | 2 +- .../service_handler_api/AnyTreeTools.py | 2 +- .../service/service_handler_api/Exceptions.py | 2 +- .../service_handler_api/FilterFields.py | 2 +- .../ServiceHandlerFactory.py | 2 +- .../service_handler_api/SettingsHandler.py | 2 +- .../service/service_handler_api/Tools.py | 2 +- .../service_handler_api/_ServiceHandler.py | 2 +- .../service/service_handler_api/__init__.py | 2 +- .../service/service_handlers/__init__.py | 2 +- .../l2nm_emulated/ConfigRules.py | 2 +- .../L2NMEmulatedServiceHandler.py | 2 +- .../l2nm_emulated/__init__.py | 2 +- .../l2nm_openconfig/ConfigRules.py | 2 +- .../L2NMOpenConfigServiceHandler.py | 2 +- .../l2nm_openconfig/__init__.py | 2 +- .../l3nm_emulated/ConfigRules.py | 2 +- .../L3NMEmulatedServiceHandler.py | 2 +- .../l3nm_emulated/__init__.py | 2 +- .../l3nm_openconfig/ConfigRules.py | 2 +- .../L3NMOpenConfigServiceHandler.py | 2 +- .../l3nm_openconfig/__init__.py | 2 +- .../microwave/MicrowaveServiceHandler.py | 2 +- .../service_handlers/microwave/__init__.py | 2 +- .../service/service_handlers/p4/__init__.py | 2 +- .../service_handlers/p4/p4_service_handler.py | 2 +- .../tapi_tapi/TapiServiceHandler.py | 2 +- .../service_handlers/tapi_tapi/__init__.py | 2 +- .../task_scheduler/ConnectionExpander.py | 2 +- .../service/task_scheduler/TaskExecutor.py | 2 +- .../service/task_scheduler/TaskScheduler.py | 2 +- .../service/task_scheduler/__init__.py | 2 +- .../tasks/Task_ConnectionConfigure.py | 2 +- .../tasks/Task_ConnectionDeconfigure.py | 2 +- .../tasks/Task_ServiceDelete.py | 2 +- .../tasks/Task_ServiceSetStatus.py | 2 +- .../service/task_scheduler/tasks/_Task.py | 2 +- .../service/task_scheduler/tasks/__init__.py | 2 +- src/service/service/tools/ContextGetters.py | 2 +- .../service/tools/EndpointIdFormatters.py | 2 +- src/service/service/tools/ObjectKeys.py | 2 +- src/service/service/tools/__init__.py | 2 +- src/service/tests/CommonObjects.py | 2 +- src/service/tests/MockService_Dependencies.py | 2 +- src/service/tests/PrepareTestScenario.py | 2 +- src/service/tests/ServiceHandler_L3NM_EMU.py | 2 +- src/service/tests/ServiceHandler_L3NM_OC.py | 2 +- src/service/tests/ServiceHandlersToTest.py | 2 +- src/service/tests/__init__.py | 2 +- src/service/tests/test_unitary.py | 2 +- .../tests/test_unitary_task_scheduler.py | 2 +- src/slice/.gitlab-ci.yml | 2 +- src/slice/Config.py | 2 +- src/slice/Dockerfile | 2 +- src/slice/__init__.py | 2 +- src/slice/client/SliceClient.py | 2 +- src/slice/client/__init__.py | 2 +- src/slice/old_code/ConstraintsChecker.py | 2 +- src/slice/old_code/SliceCheckers.py | 2 +- src/slice/old_code/SliceStatus.py | 14 +++ src/slice/old_code/Tools.py | 2 +- src/slice/old_code/Tools_2.py | 2 +- src/slice/requirements.in | 15 +++ src/slice/service/SliceService.py | 2 +- src/slice/service/SliceServiceServicerImpl.py | 2 +- src/slice/service/__init__.py | 2 +- src/slice/service/__main__.py | 2 +- src/slice/tests/__init__.py | 2 +- src/slice/tests/test_unitary.py | 2 +- src/start.sh | 2 +- src/start_webui_dev_mode.sh | 2 +- src/tests/.gitlab-ci.yml | 2 +- src/tests/Fixtures.py | 2 +- src/tests/__init__.py | 2 +- src/tests/benchmark/automation/ZtpAdd.js | 16 +++ src/tests/benchmark/automation/ZtpDelete.js | 16 +++ src/tests/benchmark/automation/ZtpUpdate.js | 16 +++ src/tests/benchmark/automation/__init__.py | 2 +- .../automation/run_test_01_bootstrap.sh | 2 +- .../automation/run_test_02_cleanup.sh | 2 +- .../benchmark/automation/tests/Fixtures.py | 2 +- .../benchmark/automation/tests/Objects.py | 2 +- .../benchmark/automation/tests/__init__.py | 2 +- .../tests/test_functional_bootstrap.py | 2 +- .../tests/test_functional_cleanup.py | 2 +- .../benchmark/policy/PolicyAddService.js | 16 +++ src/tests/benchmark/policy/PolicyDelete.js | 16 +++ .../benchmark/policy/PolicyUpdateService.js | 16 +++ src/tests/benchmark/policy/__init__.py | 2 +- src/tests/benchmark/policy/deploy_specs.sh | 14 +++ .../benchmark/policy/run_test_01_bootstrap.sh | 2 +- .../policy/run_test_02_create_service.sh | 2 +- .../policy/run_test_03_delete_service.sh | 2 +- .../benchmark/policy/run_test_04_cleanup.sh | 2 +- src/tests/benchmark/policy/tests/Fixtures.py | 2 +- src/tests/benchmark/policy/tests/Objects.py | 2 +- src/tests/benchmark/policy/tests/__init__.py | 2 +- .../policy/tests/test_functional_bootstrap.py | 2 +- .../policy/tests/test_functional_cleanup.py | 2 +- .../tests/test_functional_create_service.py | 2 +- .../tests/test_functional_delete_service.py | 2 +- src/tests/ecoc22/__init__.py | 2 +- src/tests/ecoc22/deploy_specs.sh | 2 +- src/tests/ecoc22/redeploy.sh | 2 +- src/tests/ecoc22/run_test_01_bootstrap.sh | 2 +- .../ecoc22/run_test_02_create_service.sh | 2 +- .../ecoc22/run_test_03_delete_service.sh | 2 +- src/tests/ecoc22/run_test_04_cleanup.sh | 2 +- src/tests/ecoc22/run_tests.sh | 2 +- src/tests/ecoc22/tests/Fixtures.py | 2 +- src/tests/ecoc22/tests/Objects.py | 2 +- src/tests/ecoc22/tests/Tools.py | 14 +++ src/tests/ecoc22/tests/__init__.py | 2 +- .../ecoc22/tests/old_code/BuildDescriptors.py | 2 +- .../ecoc22/tests/old_code/LoadDescriptors.py | 2 +- .../ecoc22/tests/old_code/Objects_BigNet.py | 2 +- .../tests/old_code/Objects_DC_CSGW_OLS.py | 2 +- .../tests/old_code/Objects_DC_CSGW_TN.py | 2 +- .../tests/old_code/Objects_DC_CSGW_TN_OLS.py | 2 +- .../ecoc22/tests/test_functional_bootstrap.py | 2 +- .../ecoc22/tests/test_functional_cleanup.py | 2 +- .../tests/test_functional_create_service.py | 2 +- .../tests/test_functional_delete_service.py | 2 +- src/tests/oeccpsc22/__init__.py | 2 +- src/tests/oeccpsc22/deploy_in_kubernetes.sh | 2 +- src/tests/oeccpsc22/dump_logs.sh | 2 +- .../oeccpsc22/expose_services_teraflow_1.yaml | 2 +- .../oeccpsc22/expose_services_teraflow_2.yaml | 2 +- src/tests/oeccpsc22/run_test_01_bootstrap.sh | 2 +- .../run_test_02_create_interdomain_slice.sh | 2 +- .../run_test_03_delete_interdomain_slice.sh | 2 +- src/tests/oeccpsc22/run_test_04_cleanup.sh | 2 +- src/tests/oeccpsc22/show_deploy.sh | 2 +- src/tests/oeccpsc22/tests/Objects_Domain_1.py | 2 +- src/tests/oeccpsc22/tests/Objects_Domain_2.py | 2 +- src/tests/oeccpsc22/tests/Objects_Service.py | 14 +++ src/tests/oeccpsc22/tests/Tools.py | 2 +- src/tests/oeccpsc22/tests/__init__.py | 2 +- .../tests/test_functional_bootstrap.py | 2 +- .../tests/test_functional_cleanup.py | 2 +- ...est_functional_create_interdomain_slice.py | 2 +- ...est_functional_delete_interdomain_slice.py | 2 +- src/tests/ofc22/__init__.py | 2 +- src/tests/ofc22/deploy_specs.sh | 2 +- src/tests/ofc22/redeploy.sh | 2 +- src/tests/ofc22/run_test_01_bootstrap.sh | 2 +- src/tests/ofc22/run_test_02_create_service.sh | 2 +- src/tests/ofc22/run_test_03_delete_service.sh | 2 +- src/tests/ofc22/run_test_04_cleanup.sh | 2 +- src/tests/ofc22/run_tests.sh | 2 +- src/tests/ofc22/tests/Fixtures.py | 2 +- src/tests/ofc22/tests/Objects.py | 2 +- src/tests/ofc22/tests/ObjectsXr.py | 2 +- src/tests/ofc22/tests/__init__.py | 2 +- .../ofc22/tests/test_functional_bootstrap.py | 2 +- .../ofc22/tests/test_functional_cleanup.py | 2 +- .../tests/test_functional_create_service.py | 2 +- .../test_functional_create_service_xr.py | 2 +- .../tests/test_functional_delete_service.py | 2 +- .../test_functional_delete_service_xr.py | 2 +- src/tests/p4/__init__.py | 2 +- src/tests/p4/deploy_specs.sh | 14 +++ src/tests/p4/mininet/1switch1path.py | 0 src/tests/p4/mininet/2switch1path.py | 0 src/tests/p4/mininet/4switch2path.py | 0 src/tests/p4/mininet/6switch2path.py | 0 src/tests/p4/run_test_01_bootstrap.sh | 2 +- src/tests/p4/run_test_02_create_service.sh | 2 +- src/tests/p4/run_test_03_delete_service.sh | 2 +- src/tests/p4/run_test_04_cleanup.sh | 2 +- src/tests/p4/setup.sh | 14 +++ src/tests/p4/tests/BuildDescriptors.py | 2 +- src/tests/p4/tests/LoadDescriptors.py | 2 +- src/tests/p4/tests/Objects.py | 2 +- src/tests/p4/tests/__init__.py | 2 +- .../p4/tests/test_functional_bootstrap.py | 2 +- src/tests/p4/tests/test_functional_cleanup.py | 2 +- .../tests/test_functional_create_service.py | 2 +- .../tests/test_functional_delete_service.py | 2 +- src/tests/scenario2/__init__.py | 2 +- src/tests/scenario2/delete_all.sh | 14 +++ src/tests/scenario2/deploy_all.sh | 14 +++ src/tests/scenario2/deploy_specs_dom1.sh | 14 +++ src/tests/scenario2/deploy_specs_dom2.sh | 14 +++ src/tests/scenario2/deploy_specs_dom3.sh | 14 +++ src/tests/scenario2/deploy_specs_dom4.sh | 14 +++ src/tests/scenario2/dump_logs.sh | 14 +++ src/tests/scenario2/fast_redeploy.sh | 14 +++ .../nginx-ingress-controller-dom1.yaml | 14 +++ .../nginx-ingress-controller-dom2.yaml | 14 +++ .../nginx-ingress-controller-dom3.yaml | 14 +++ .../nginx-ingress-controller-dom4.yaml | 14 +++ src/tests/scenario2/reset.sh | 14 +++ src/tests/scenario2/show_deploy.sh | 2 +- src/tests/scenario2/tfs-ingress-dom1.yaml | 14 +++ src/tests/scenario2/tfs-ingress-dom2.yaml | 14 +++ src/tests/scenario2/tfs-ingress-dom3.yaml | 14 +++ src/tests/scenario2/tfs-ingress-dom4.yaml | 14 +++ src/tests/tools/__init__.py | 2 +- src/tests/tools/load_scenario/__init__.py | 2 +- src/tests/tools/load_scenario/__main__.py | 2 +- src/tests/tools/load_scenario/run.sh | 2 +- src/tests/tools/mock_osm/Constants.py | 2 +- src/tests/tools/mock_osm/MockOSM.py | 2 +- src/tests/tools/mock_osm/Tools.py | 2 +- src/tests/tools/mock_osm/__init__.py | 2 +- .../tools/mock_sdn_ctrl/MockMWSdnCtrl.py | 2 +- .../tools/mock_sdn_ctrl/microwave_deploy.sh | 14 +++ src/webui/.gitlab-ci.yml | 2 +- src/webui/Config.py | 2 +- src/webui/Dockerfile | 2 +- src/webui/__init__.py | 2 +- src/webui/requirements.in | 14 +++ src/webui/service/__init__.py | 2 +- src/webui/service/__main__.py | 2 +- src/webui/service/context/__init__.py | 2 +- src/webui/service/context/routes.py | 2 +- src/webui/service/device/__init__.py | 2 +- src/webui/service/device/forms.py | 2 +- src/webui/service/device/routes.py | 2 +- src/webui/service/js/__init__.py | 2 +- src/webui/service/js/routes.py | 2 +- src/webui/service/link/__init__.py | 14 +++ src/webui/service/link/routes.py | 2 +- src/webui/service/load_gen/__init__.py | 2 +- src/webui/service/load_gen/routes.py | 2 +- src/webui/service/main/__init__.py | 2 +- src/webui/service/main/forms.py | 2 +- src/webui/service/main/routes.py | 2 +- src/webui/service/service/__init__.py | 2 +- src/webui/service/service/routes.py | 2 +- src/webui/service/slice/__init__.py | 2 +- src/webui/service/slice/routes.py | 2 +- src/webui/service/templates/base.html | 2 +- src/webui/service/templates/context/home.html | 2 +- src/webui/service/templates/device/add.html | 2 +- .../service/templates/device/addconfig.html | 2 +- .../service/templates/device/detail.html | 2 +- src/webui/service/templates/device/home.html | 2 +- .../service/templates/device/update.html | 16 +++ .../templates/device/updateconfig.html | 2 +- src/webui/service/templates/js/site.js | 2 +- src/webui/service/templates/js/topology.js | 2 +- src/webui/service/templates/link/detail.html | 2 +- src/webui/service/templates/link/home.html | 2 +- src/webui/service/templates/main/about.html | 2 +- src/webui/service/templates/main/debug.html | 2 +- src/webui/service/templates/main/home.html | 2 +- .../service/templates/service/detail.html | 2 +- src/webui/service/templates/service/home.html | 2 +- src/webui/service/templates/slice/detail.html | 2 +- src/webui/service/templates/slice/home.html | 2 +- src/webui/tests/__init__.py | 2 +- src/webui/tests/test_unitary.py | 2 +- src/webui/utils/__init__.py | 2 +- src/webui/utils/form_validators.py | 2 +- update_tfs_runtime_env_vars.sh | 2 +- 1169 files changed, 2986 insertions(+), 1118 deletions(-) mode change 100755 => 100644 clean_testing_environment.sh mode change 100755 => 100644 deploy/all.sh mode change 100755 => 100644 deploy/component.sh mode change 100755 => 100644 deploy/crdb.sh mode change 100755 => 100644 deploy/mock_blockchain.sh mode change 100755 => 100644 deploy/nats.sh mode change 100755 => 100644 deploy/qdb.sh mode change 100755 => 100644 deploy/show.sh mode change 100755 => 100644 deploy/tfs.sh mode change 100755 => 100644 expose_ingress_grpc.sh mode change 100755 => 100644 hackfest/grpc/connection/create.py mode change 100755 => 100644 hackfest/grpc/connection/list.py mode change 100755 => 100644 hackfest/p4/mininet/topo-simple.py mode change 100755 => 100644 hackfest/p4/run_test_01_bootstrap.sh mode change 100755 => 100644 hackfest/p4/run_test_02_create_service.sh mode change 100755 => 100644 hackfest/p4/run_test_03_delete_service.sh mode change 100755 => 100644 hackfest/p4/run_test_04_cleanup.sh mode change 100755 => 100644 hackfest/p4/setup.sh mode change 100755 => 100644 hackfest/tapi/client/tapi-client.sh mode change 100755 => 100644 hackfest/tapi/server/run.sh mode change 100755 => 100644 install_requirements.sh mode change 100755 => 100644 proto/generate_code_python.sh mode change 100755 => 100644 proto/generate_uml.sh mode change 100755 => 100644 run_tests_docker.sh mode change 100755 => 100644 scripts/add_license_header_to_files.sh mode change 100755 => 100644 scripts/build_run_report_tests_locally.sh mode change 100755 => 100644 scripts/cockroachdb_client.sh mode change 100755 => 100644 scripts/create_component.sh mode change 100755 => 100644 scripts/dump_logs.sh mode change 100755 => 100644 scripts/old/configure_dashboards_in_kubernetes.sh mode change 100755 => 100644 scripts/old/deploy_in_kubernetes.sh mode change 100755 => 100644 scripts/old/open_dashboard.sh mode change 100755 => 100644 scripts/old/open_webui.sh mode change 100755 => 100644 scripts/report_coverage_all.sh mode change 100755 => 100644 scripts/report_coverage_common.sh mode change 100755 => 100644 scripts/report_coverage_compute.sh mode change 100755 => 100644 scripts/report_coverage_context.sh mode change 100755 => 100644 scripts/report_coverage_device.sh mode change 100755 => 100644 scripts/report_coverage_l3_attackmitigator.sh mode change 100755 => 100644 scripts/report_coverage_l3_centralizedattackdetector.sh mode change 100755 => 100644 scripts/report_coverage_l3_distributedattackdetector.sh mode change 100755 => 100644 scripts/report_coverage_pathcomp.sh mode change 100755 => 100644 scripts/report_coverage_service.sh mode change 100755 => 100644 scripts/report_coverage_slice.sh mode change 100755 => 100644 scripts/run_tests_locally-compute.sh mode change 100755 => 100644 scripts/run_tests_locally-context.sh mode change 100755 => 100644 scripts/run_tests_locally-device-all.sh mode change 100755 => 100644 scripts/run_tests_locally-device-emulated.sh mode change 100755 => 100644 scripts/run_tests_locally-device-microwave.sh mode change 100755 => 100644 scripts/run_tests_locally-device-openconfig.sh mode change 100755 => 100644 scripts/run_tests_locally-device-p4.sh mode change 100755 => 100644 scripts/run_tests_locally-device-tapi.sh mode change 100755 => 100644 scripts/run_tests_locally-pathcomp-frontend.sh mode change 100755 => 100644 scripts/run_tests_locally-service.sh mode change 100755 => 100644 scripts/run_tests_locally-slice.sh mode change 100755 => 100644 scripts/run_tests_locally.sh mode change 100755 => 100644 scripts/show_logs_automation.sh mode change 100755 => 100644 scripts/show_logs_compute.sh mode change 100755 => 100644 scripts/show_logs_context.sh mode change 100755 => 100644 scripts/show_logs_device.sh mode change 100755 => 100644 scripts/show_logs_dlt_connector.sh mode change 100755 => 100644 scripts/show_logs_dlt_gateway.sh mode change 100755 => 100644 scripts/show_logs_monitoring.sh mode change 100755 => 100644 scripts/show_logs_pathcomp_backend.sh mode change 100755 => 100644 scripts/show_logs_pathcomp_frontend.sh mode change 100755 => 100644 scripts/show_logs_service.sh mode change 100755 => 100644 scripts/show_logs_slice.sh mode change 100755 => 100644 scripts/show_logs_webui.sh create mode 100644 scripts/update_license_headers.py mode change 100755 => 100644 src/automation/mvnw mode change 100755 => 100644 src/automation/util/set_version.sh mode change 100755 => 100644 src/build.sh mode change 100755 => 100644 src/clean.sh mode change 100755 => 100644 src/common/method_wrappers/results-perf-eval/MW/generate.sh mode change 100755 => 100644 src/common/method_wrappers/results-perf-eval/OpenConfig/generate.sh mode change 100755 => 100644 src/common/method_wrappers/results-perf-eval/XR/generate.sh mode change 100755 => 100644 src/common/method_wrappers/results-perf-eval/emulated/generate.sh mode change 100755 => 100644 src/dbscanserving/genproto.sh mode change 100755 => 100644 src/device/service/drivers/xr/cm-cli.py mode change 100755 => 100644 src/device/service/drivers/xr/setup_test_env.sh mode change 100755 => 100644 src/gitlab-ci.yml_generator.py mode change 100755 => 100644 src/load_generator/run.sh mode change 100755 => 100644 src/opticalattackmitigator/genproto.sh mode change 100755 => 100644 src/opticalcentralizedattackdetector/genproto.sh mode change 100755 => 100644 src/policy/mvnw mode change 100755 => 100644 src/policy/util/set_version.sh mode change 100755 => 100644 src/start.sh mode change 100755 => 100644 src/start_webui_dev_mode.sh mode change 100755 => 100644 src/tests/benchmark/automation/ZtpUpdate.js mode change 100755 => 100644 src/tests/benchmark/automation/run_test_01_bootstrap.sh mode change 100755 => 100644 src/tests/benchmark/automation/run_test_02_cleanup.sh mode change 100755 => 100644 src/tests/benchmark/policy/run_test_01_bootstrap.sh mode change 100755 => 100644 src/tests/benchmark/policy/run_test_02_create_service.sh mode change 100755 => 100644 src/tests/benchmark/policy/run_test_03_delete_service.sh mode change 100755 => 100644 src/tests/benchmark/policy/run_test_04_cleanup.sh mode change 100755 => 100644 src/tests/ecoc22/redeploy.sh mode change 100755 => 100644 src/tests/ecoc22/run_test_01_bootstrap.sh mode change 100755 => 100644 src/tests/ecoc22/run_test_02_create_service.sh mode change 100755 => 100644 src/tests/ecoc22/run_test_03_delete_service.sh mode change 100755 => 100644 src/tests/ecoc22/run_test_04_cleanup.sh mode change 100755 => 100644 src/tests/ecoc22/run_tests.sh mode change 100755 => 100644 src/tests/oeccpsc22/deploy_in_kubernetes.sh mode change 100755 => 100644 src/tests/oeccpsc22/dump_logs.sh mode change 100755 => 100644 src/tests/oeccpsc22/run_test_01_bootstrap.sh mode change 100755 => 100644 src/tests/oeccpsc22/run_test_02_create_interdomain_slice.sh mode change 100755 => 100644 src/tests/oeccpsc22/run_test_03_delete_interdomain_slice.sh mode change 100755 => 100644 src/tests/oeccpsc22/run_test_04_cleanup.sh mode change 100755 => 100644 src/tests/oeccpsc22/show_deploy.sh mode change 100755 => 100644 src/tests/ofc22/redeploy.sh mode change 100755 => 100644 src/tests/ofc22/run_test_01_bootstrap.sh mode change 100755 => 100644 src/tests/ofc22/run_test_02_create_service.sh mode change 100755 => 100644 src/tests/ofc22/run_test_03_delete_service.sh mode change 100755 => 100644 src/tests/ofc22/run_test_04_cleanup.sh mode change 100755 => 100644 src/tests/ofc22/run_tests.sh mode change 100755 => 100644 src/tests/p4/mininet/1switch1path.py mode change 100755 => 100644 src/tests/p4/mininet/2switch1path.py mode change 100755 => 100644 src/tests/p4/mininet/4switch2path.py mode change 100755 => 100644 src/tests/p4/mininet/6switch2path.py mode change 100755 => 100644 src/tests/p4/run_test_01_bootstrap.sh mode change 100755 => 100644 src/tests/p4/run_test_02_create_service.sh mode change 100755 => 100644 src/tests/p4/run_test_03_delete_service.sh mode change 100755 => 100644 src/tests/p4/run_test_04_cleanup.sh mode change 100755 => 100644 src/tests/p4/setup.sh mode change 100755 => 100644 src/tests/scenario2/delete_all.sh mode change 100755 => 100644 src/tests/scenario2/deploy_all.sh mode change 100755 => 100644 src/tests/scenario2/dump_logs.sh mode change 100755 => 100644 src/tests/scenario2/reset.sh mode change 100755 => 100644 src/tests/scenario2/show_deploy.sh mode change 100755 => 100644 src/tests/tools/load_scenario/run.sh mode change 100755 => 100644 update_tfs_runtime_env_vars.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 45d4056c6..713d893cf 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/clean_testing_environment.sh b/clean_testing_environment.sh old mode 100755 new mode 100644 index 09bff95d8..b9c502ade --- a/clean_testing_environment.sh +++ b/clean_testing_environment.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/common_requirements.in b/common_requirements.in index cb06c3b65..cb418f019 100644 --- a/common_requirements.in +++ b/common_requirements.in @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/coverage/.coveragerc.template b/coverage/.coveragerc.template index 8863d4d6e..4421399ca 100644 --- a/coverage/.coveragerc.template +++ b/coverage/.coveragerc.template @@ -1,3 +1,17 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + [run] data_file = ~/tfs-ctrl/coverage/.coverage source = . diff --git a/deploy/all.sh b/deploy/all.sh old mode 100755 new mode 100644 index 484640c67..a99607f5b --- a/deploy/all.sh +++ b/deploy/all.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/deploy/component.sh b/deploy/component.sh old mode 100755 new mode 100644 index 443bee601..922aa5e0e --- a/deploy/component.sh +++ b/deploy/component.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/deploy/crdb.sh b/deploy/crdb.sh old mode 100755 new mode 100644 index 90456773b..ebbe0a34e --- a/deploy/crdb.sh +++ b/deploy/crdb.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/deploy/mock_blockchain.sh b/deploy/mock_blockchain.sh old mode 100755 new mode 100644 index f741f069f..ef7811c87 --- a/deploy/mock_blockchain.sh +++ b/deploy/mock_blockchain.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/deploy/nats.sh b/deploy/nats.sh old mode 100755 new mode 100644 index 544028996..115a18530 --- a/deploy/nats.sh +++ b/deploy/nats.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/deploy/qdb.sh b/deploy/qdb.sh old mode 100755 new mode 100644 index 1e9d4d8ee..d9a4de353 --- a/deploy/qdb.sh +++ b/deploy/qdb.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/deploy/show.sh b/deploy/show.sh old mode 100755 new mode 100644 index 68a5659aa..a4084ac65 --- a/deploy/show.sh +++ b/deploy/show.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/deploy/tfs.sh b/deploy/tfs.sh old mode 100755 new mode 100644 index c0f376ee9..b9bcbab4d --- a/deploy/tfs.sh +++ b/deploy/tfs.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/expose_ingress_grpc.sh b/expose_ingress_grpc.sh old mode 100755 new mode 100644 index e2667247a..945641c1f --- a/expose_ingress_grpc.sh +++ b/expose_ingress_grpc.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/hackfest/gnmi/sonic.clab.yml b/hackfest/gnmi/sonic.clab.yml index dc4f74321..47c1e6464 100644 --- a/hackfest/gnmi/sonic.clab.yml +++ b/hackfest/gnmi/sonic.clab.yml @@ -1,3 +1,17 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + # file: sonic.clab.yml name: sonic-vs diff --git a/hackfest/grpc/connection.proto b/hackfest/grpc/connection.proto index 42661cd5b..0e8522768 100644 --- a/hackfest/grpc/connection.proto +++ b/hackfest/grpc/connection.proto @@ -1,3 +1,17 @@ +// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +// +// 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. + //Example of connection syntax = "proto3"; package connection; diff --git a/hackfest/grpc/connection/create.py b/hackfest/grpc/connection/create.py old mode 100755 new mode 100644 index df5df77d6..7d134105d --- a/hackfest/grpc/connection/create.py +++ b/hackfest/grpc/connection/create.py @@ -1,4 +1,18 @@ #! /usr/bin/env python3 +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + import connection_pb2 import sys diff --git a/hackfest/grpc/connection/list.py b/hackfest/grpc/connection/list.py old mode 100755 new mode 100644 index 47b92cc4a..5b1926d3c --- a/hackfest/grpc/connection/list.py +++ b/hackfest/grpc/connection/list.py @@ -1,4 +1,18 @@ #! /usr/bin/env python3 +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + from __future__ import print_function import connection_pb2 import sys diff --git a/hackfest/grpc/connectionService.proto b/hackfest/grpc/connectionService.proto index aa3bcb4ef..8f6b5a6e7 100644 --- a/hackfest/grpc/connectionService.proto +++ b/hackfest/grpc/connectionService.proto @@ -1,3 +1,17 @@ +// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +// +// 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. + //Example of connection syntax = "proto3"; package connection; diff --git a/hackfest/grpc/connectionService/connectionService_client.py b/hackfest/grpc/connectionService/connectionService_client.py index c0f45f7a9..e5c1bf481 100644 --- a/hackfest/grpc/connectionService/connectionService_client.py +++ b/hackfest/grpc/connectionService/connectionService_client.py @@ -1,3 +1,17 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + from __future__ import print_function import grpc diff --git a/hackfest/grpc/connectionService/connectionService_server.py b/hackfest/grpc/connectionService/connectionService_server.py index 6fbd195cd..f1632db90 100644 --- a/hackfest/grpc/connectionService/connectionService_server.py +++ b/hackfest/grpc/connectionService/connectionService_server.py @@ -1,3 +1,17 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + from concurrent import futures import time import logging diff --git a/hackfest/grpc/connectionServiceWithNotif.proto b/hackfest/grpc/connectionServiceWithNotif.proto index 8430479c5..f2f5b17e3 100644 --- a/hackfest/grpc/connectionServiceWithNotif.proto +++ b/hackfest/grpc/connectionServiceWithNotif.proto @@ -1,3 +1,17 @@ +// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +// +// 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. + //Example of connection syntax = "proto3"; package connection; diff --git a/hackfest/grpc/connectionServiceWithNotif/connectionServiceWithNotif_client.py b/hackfest/grpc/connectionServiceWithNotif/connectionServiceWithNotif_client.py index e40e0a5fa..9518bf743 100644 --- a/hackfest/grpc/connectionServiceWithNotif/connectionServiceWithNotif_client.py +++ b/hackfest/grpc/connectionServiceWithNotif/connectionServiceWithNotif_client.py @@ -1,3 +1,17 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + from __future__ import print_function import grpc diff --git a/hackfest/grpc/connectionServiceWithNotif/connectionServiceWithNotif_server.py b/hackfest/grpc/connectionServiceWithNotif/connectionServiceWithNotif_server.py index a9970056d..922f91837 100644 --- a/hackfest/grpc/connectionServiceWithNotif/connectionServiceWithNotif_server.py +++ b/hackfest/grpc/connectionServiceWithNotif/connectionServiceWithNotif_server.py @@ -1,3 +1,17 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + from concurrent import futures import time import logging diff --git a/hackfest/grpc/topologyService.proto b/hackfest/grpc/topologyService.proto index cf9601a4b..775e45add 100644 --- a/hackfest/grpc/topologyService.proto +++ b/hackfest/grpc/topologyService.proto @@ -1,3 +1,17 @@ +// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +// +// 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. + //Example of topology syntax = "proto3"; package topology; diff --git a/hackfest/grpc/topologyService/topologyService_client.py b/hackfest/grpc/topologyService/topologyService_client.py index 24ce803b0..ef628183b 100644 --- a/hackfest/grpc/topologyService/topologyService_client.py +++ b/hackfest/grpc/topologyService/topologyService_client.py @@ -1,3 +1,17 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + from __future__ import print_function import grpc diff --git a/hackfest/grpc/topologyService/topologyService_server.py b/hackfest/grpc/topologyService/topologyService_server.py index bb72e2242..ff1c80e82 100644 --- a/hackfest/grpc/topologyService/topologyService_server.py +++ b/hackfest/grpc/topologyService/topologyService_server.py @@ -1,3 +1,17 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + from concurrent import futures import time import logging diff --git a/hackfest/kafka/pub.py b/hackfest/kafka/pub.py index 12d3dc2dd..e80dd5db8 100644 --- a/hackfest/kafka/pub.py +++ b/hackfest/kafka/pub.py @@ -1,3 +1,17 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + from time import sleep from json import dumps from kafka import KafkaProducer diff --git a/hackfest/kafka/sub.py b/hackfest/kafka/sub.py index f61ab4d47..233b9f9d0 100644 --- a/hackfest/kafka/sub.py +++ b/hackfest/kafka/sub.py @@ -1,3 +1,17 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + from kafka import KafkaConsumer from json import loads diff --git a/hackfest/mock_osm/MockOSM.py b/hackfest/mock_osm/MockOSM.py index b4e629d58..338db0e19 100644 --- a/hackfest/mock_osm/MockOSM.py +++ b/hackfest/mock_osm/MockOSM.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/hackfest/mock_osm/__init__.py b/hackfest/mock_osm/__init__.py index 70a332512..1549d9811 100644 --- a/hackfest/mock_osm/__init__.py +++ b/hackfest/mock_osm/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/hackfest/mock_osm/__main__.py b/hackfest/mock_osm/__main__.py index 410feda84..669da2b5e 100644 --- a/hackfest/mock_osm/__main__.py +++ b/hackfest/mock_osm/__main__.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/hackfest/netconf-oc/device_definition.py b/hackfest/netconf-oc/device_definition.py index 15efdee42..6e737f556 100644 --- a/hackfest/netconf-oc/device_definition.py +++ b/hackfest/netconf-oc/device_definition.py @@ -1,3 +1,17 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + from lxml import etree from netconf import util from pyangbind.lib.serialise import pybindIETFXMLEncoder diff --git a/hackfest/netconf-oc/interfaces.xml b/hackfest/netconf-oc/interfaces.xml index 8358a0595..c47fc44e3 100644 --- a/hackfest/netconf-oc/interfaces.xml +++ b/hackfest/netconf-oc/interfaces.xml @@ -1,4 +1,20 @@ + + diff --git a/hackfest/netconf-oc/platform.xml b/hackfest/netconf-oc/platform.xml index 434dc4c9b..04c53f559 100644 --- a/hackfest/netconf-oc/platform.xml +++ b/hackfest/netconf-oc/platform.xml @@ -1,4 +1,20 @@ + + diff --git a/hackfest/netconf-oc/server_openconfig.py b/hackfest/netconf-oc/server_openconfig.py index 08a68d42f..fe4085e39 100644 --- a/hackfest/netconf-oc/server_openconfig.py +++ b/hackfest/netconf-oc/server_openconfig.py @@ -1,3 +1,17 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + import logging, os, sys, time from pyangbind.lib.serialise import pybindIETFXMLEncoder, pybindIETFXMLDecoder from lxml import etree diff --git a/hackfest/netconf/client_topology.py b/hackfest/netconf/client_topology.py index 5b1dd9a3e..138468e20 100644 --- a/hackfest/netconf/client_topology.py +++ b/hackfest/netconf/client_topology.py @@ -1,3 +1,17 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + from lxml import etree from netconf.client import NetconfSSHSession diff --git a/hackfest/netconf/connection/client_connection.py b/hackfest/netconf/connection/client_connection.py index 08c0eaae0..bba5e0ae9 100644 --- a/hackfest/netconf/connection/client_connection.py +++ b/hackfest/netconf/connection/client_connection.py @@ -1,3 +1,17 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + from lxml import etree from netconf.client import NetconfSSHSession diff --git a/hackfest/netconf/connection/server_topology_connection.py b/hackfest/netconf/connection/server_topology_connection.py index 928edfb87..67953e7ed 100644 --- a/hackfest/netconf/connection/server_topology_connection.py +++ b/hackfest/netconf/connection/server_topology_connection.py @@ -1,3 +1,17 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + import sys import time import logging diff --git a/hackfest/netconf/connection/topology.xml b/hackfest/netconf/connection/topology.xml index 93af48085..9baab0342 100644 --- a/hackfest/netconf/connection/topology.xml +++ b/hackfest/netconf/connection/topology.xml @@ -1,3 +1,19 @@ + + diff --git a/hackfest/netconf/server_topology.py b/hackfest/netconf/server_topology.py index 84460c84b..1320a7b00 100644 --- a/hackfest/netconf/server_topology.py +++ b/hackfest/netconf/server_topology.py @@ -1,3 +1,17 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + import sys import time import logging diff --git a/hackfest/netconf/topology.xml b/hackfest/netconf/topology.xml index 93af48085..9baab0342 100644 --- a/hackfest/netconf/topology.xml +++ b/hackfest/netconf/topology.xml @@ -1,3 +1,19 @@ + + diff --git a/hackfest/onos_api/onos_flows.py b/hackfest/onos_api/onos_flows.py index b2df4b5a2..da57506a1 100644 --- a/hackfest/onos_api/onos_flows.py +++ b/hackfest/onos_api/onos_flows.py @@ -1,4 +1,18 @@ #!/usr/bin/python +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + # -*- coding: utf-8 -*- import requests diff --git a/hackfest/onos_api/onos_topology.py b/hackfest/onos_api/onos_topology.py index c008263d2..eca3285bd 100644 --- a/hackfest/onos_api/onos_topology.py +++ b/hackfest/onos_api/onos_topology.py @@ -1,4 +1,18 @@ #!/usr/bin/python +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + # -*- coding: utf-8 -*- import requests diff --git a/hackfest/openconfig/generated.go b/hackfest/openconfig/generated.go index f4ab51ad2..51c51d41a 100644 --- a/hackfest/openconfig/generated.go +++ b/hackfest/openconfig/generated.go @@ -1,3 +1,17 @@ +// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +// +// 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. + /* Package gostruct is a generated package which contains definitions of structs which represent a YANG schema. The generated schema can be diff --git a/hackfest/p4/__init__.py b/hackfest/p4/__init__.py index 70a332512..1549d9811 100644 --- a/hackfest/p4/__init__.py +++ b/hackfest/p4/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/hackfest/p4/deploy_specs.sh b/hackfest/p4/deploy_specs.sh index b486474e2..b988123d5 100644 --- a/hackfest/p4/deploy_specs.sh +++ b/hackfest/p4/deploy_specs.sh @@ -1,3 +1,17 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + # Set the URL of your local Docker registry where the images will be uploaded to. export TFS_REGISTRY_IMAGE="http://localhost:32000/tfs/" diff --git a/hackfest/p4/mininet/topo-simple.py b/hackfest/p4/mininet/topo-simple.py old mode 100755 new mode 100644 diff --git a/hackfest/p4/run_test_01_bootstrap.sh b/hackfest/p4/run_test_01_bootstrap.sh old mode 100755 new mode 100644 index 42e647be1..af35fa3dc --- a/hackfest/p4/run_test_01_bootstrap.sh +++ b/hackfest/p4/run_test_01_bootstrap.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/hackfest/p4/run_test_02_create_service.sh b/hackfest/p4/run_test_02_create_service.sh old mode 100755 new mode 100644 index 8fb9038d8..1b5c55994 --- a/hackfest/p4/run_test_02_create_service.sh +++ b/hackfest/p4/run_test_02_create_service.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/hackfest/p4/run_test_03_delete_service.sh b/hackfest/p4/run_test_03_delete_service.sh old mode 100755 new mode 100644 index 96f79c071..d641d8c4f --- a/hackfest/p4/run_test_03_delete_service.sh +++ b/hackfest/p4/run_test_03_delete_service.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/hackfest/p4/run_test_04_cleanup.sh b/hackfest/p4/run_test_04_cleanup.sh old mode 100755 new mode 100644 index 5cb265f6f..d87ef1a00 --- a/hackfest/p4/run_test_04_cleanup.sh +++ b/hackfest/p4/run_test_04_cleanup.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/hackfest/p4/setup.sh b/hackfest/p4/setup.sh old mode 100755 new mode 100644 index 195327a03..3ab0faf9e --- a/hackfest/p4/setup.sh +++ b/hackfest/p4/setup.sh @@ -1,4 +1,18 @@ #! /bin/bash +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + export POD_NAME=$(kubectl get pods -n=tfs | grep device | awk '{print $1}') diff --git a/hackfest/p4/tests/BuildDescriptors.py b/hackfest/p4/tests/BuildDescriptors.py index 5c5419190..98b788633 100644 --- a/hackfest/p4/tests/BuildDescriptors.py +++ b/hackfest/p4/tests/BuildDescriptors.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/hackfest/p4/tests/LoadDescriptors.py b/hackfest/p4/tests/LoadDescriptors.py index 33bc699af..b232935f4 100644 --- a/hackfest/p4/tests/LoadDescriptors.py +++ b/hackfest/p4/tests/LoadDescriptors.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/hackfest/p4/tests/Objects.py b/hackfest/p4/tests/Objects.py index dcef02552..97557d739 100644 --- a/hackfest/p4/tests/Objects.py +++ b/hackfest/p4/tests/Objects.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/hackfest/p4/tests/__init__.py b/hackfest/p4/tests/__init__.py index 70a332512..1549d9811 100644 --- a/hackfest/p4/tests/__init__.py +++ b/hackfest/p4/tests/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/hackfest/p4/tests/test_functional_bootstrap.py b/hackfest/p4/tests/test_functional_bootstrap.py index 0254ffd26..8ad3c8a9c 100644 --- a/hackfest/p4/tests/test_functional_bootstrap.py +++ b/hackfest/p4/tests/test_functional_bootstrap.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/hackfest/p4/tests/test_functional_cleanup.py b/hackfest/p4/tests/test_functional_cleanup.py index ccbcb9843..5e84f47e2 100644 --- a/hackfest/p4/tests/test_functional_cleanup.py +++ b/hackfest/p4/tests/test_functional_cleanup.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/hackfest/p4/tests/test_functional_create_service.py b/hackfest/p4/tests/test_functional_create_service.py index 501536bdb..73200b893 100644 --- a/hackfest/p4/tests/test_functional_create_service.py +++ b/hackfest/p4/tests/test_functional_create_service.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/hackfest/p4/tests/test_functional_delete_service.py b/hackfest/p4/tests/test_functional_delete_service.py index 1be7e3240..4a03ed158 100644 --- a/hackfest/p4/tests/test_functional_delete_service.py +++ b/hackfest/p4/tests/test_functional_delete_service.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/hackfest/restconf/connection.yaml b/hackfest/restconf/connection.yaml index abc119f26..c704ed742 100644 --- a/hackfest/restconf/connection.yaml +++ b/hackfest/restconf/connection.yaml @@ -1,3 +1,17 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + --- swagger: "2.0" info: diff --git a/hackfest/restconf/connectionserver/swagger_server/database.py b/hackfest/restconf/connectionserver/swagger_server/database.py index 9a5ea9fb2..8794f873f 100644 --- a/hackfest/restconf/connectionserver/swagger_server/database.py +++ b/hackfest/restconf/connectionserver/swagger_server/database.py @@ -1,4 +1,18 @@ #!/usr/bin/env python3 +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + from swagger_server.models.connection_connection import ConnectionConnection diff --git a/hackfest/restconf/connectionserver/swagger_server/swagger/swagger.yaml b/hackfest/restconf/connectionserver/swagger_server/swagger/swagger.yaml index 85af55204..0dc82659c 100644 --- a/hackfest/restconf/connectionserver/swagger_server/swagger/swagger.yaml +++ b/hackfest/restconf/connectionserver/swagger_server/swagger/swagger.yaml @@ -1,3 +1,17 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + openapi: 3.0.1 info: title: connection API diff --git a/hackfest/restconf/topology.yaml b/hackfest/restconf/topology.yaml index ebb0b7e3c..71f106744 100644 --- a/hackfest/restconf/topology.yaml +++ b/hackfest/restconf/topology.yaml @@ -1,3 +1,17 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + --- swagger: "2.0" info: diff --git a/hackfest/restconf/topologyserver/swagger_server/swagger/swagger.yaml b/hackfest/restconf/topologyserver/swagger_server/swagger/swagger.yaml index c35919208..f8ed88ea8 100644 --- a/hackfest/restconf/topologyserver/swagger_server/swagger/swagger.yaml +++ b/hackfest/restconf/topologyserver/swagger_server/swagger/swagger.yaml @@ -1,3 +1,17 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + openapi: 3.0.1 info: title: topology API diff --git a/hackfest/tapi/client/tapi-client.sh b/hackfest/tapi/client/tapi-client.sh old mode 100755 new mode 100644 index a591a2006..084d63dee --- a/hackfest/tapi/client/tapi-client.sh +++ b/hackfest/tapi/client/tapi-client.sh @@ -1,3 +1,17 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + #Example CURL for TAPI 2.0 #Get Context diff --git a/hackfest/tapi/server/run.sh b/hackfest/tapi/server/run.sh old mode 100755 new mode 100644 index 6b6969217..9beaec828 --- a/hackfest/tapi/server/run.sh +++ b/hackfest/tapi/server/run.sh @@ -1,3 +1,17 @@ #!/bin/bash +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + python3 -m tapi_server 8080 database/mini-ols-context.json diff --git a/hackfest/tapi/server/tapi_server/__main__.py b/hackfest/tapi/server/tapi_server/__main__.py index 580c6f80f..14a73dae3 100644 --- a/hackfest/tapi/server/tapi_server/__main__.py +++ b/hackfest/tapi/server/tapi_server/__main__.py @@ -1,4 +1,18 @@ #!/usr/bin/env python3 +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + import connexion import json diff --git a/hackfest/tapi/server/tapi_server/database.py b/hackfest/tapi/server/tapi_server/database.py index 1e3e3da6a..f1450ab5a 100644 --- a/hackfest/tapi/server/tapi_server/database.py +++ b/hackfest/tapi/server/tapi_server/database.py @@ -1,4 +1,18 @@ #!/usr/bin/env python3 +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + from tapi_server.models.tapi_common_context import TapiCommonContext from tapi_server.models.tapi_connectivity_cep_list import TapiConnectivityCepList diff --git a/hackfest/tapi/server/tapi_server/swagger/swagger.yaml b/hackfest/tapi/server/tapi_server/swagger/swagger.yaml index abb88f1d1..99928b9dc 100644 --- a/hackfest/tapi/server/tapi_server/swagger/swagger.yaml +++ b/hackfest/tapi/server/tapi_server/swagger/swagger.yaml @@ -1,3 +1,17 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + openapi: 3.0.1 info: title: "tapi-notification,tapi-connectivity,tapi-topology,tapi-common,tapi-path-computation\ diff --git a/hackfest/tapi/tapi-connectivity.yaml b/hackfest/tapi/tapi-connectivity.yaml index 6cc5d3903..f70ccbdc3 100644 --- a/hackfest/tapi/tapi-connectivity.yaml +++ b/hackfest/tapi/tapi-connectivity.yaml @@ -1,3 +1,17 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + --- swagger: "2.0" info: diff --git a/hackfest/tapi/tapi_app/requirements.sh b/hackfest/tapi/tapi_app/requirements.sh index 95832bb66..56a5b20b4 100644 --- a/hackfest/tapi/tapi_app/requirements.sh +++ b/hackfest/tapi/tapi_app/requirements.sh @@ -1,4 +1,18 @@ #!/bin/bash +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + sudo apt install graphviz pip install -r requirements.txt diff --git a/hackfest/tapi/tapi_app/tapi_app.py b/hackfest/tapi/tapi_app/tapi_app.py index 195306c7b..d0306028c 100644 --- a/hackfest/tapi/tapi_app/tapi_app.py +++ b/hackfest/tapi/tapi_app/tapi_app.py @@ -1,4 +1,18 @@ #!/usr/bin/python +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + # -*- coding: utf-8 -*- import json, requests, networkx as nx diff --git a/hackfest/yang/connection/connection.py b/hackfest/yang/connection/connection.py index c404d2f5c..1b5effbd8 100644 --- a/hackfest/yang/connection/connection.py +++ b/hackfest/yang/connection/connection.py @@ -1,3 +1,17 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + from binding_connection import connection from pyangbind.lib.serialise import pybindIETFXMLEncoder import pyangbind.lib.pybindJSON as pybindJSON diff --git a/hackfest/yang/topology.py b/hackfest/yang/topology.py index 441300fb5..24f8f0d97 100644 --- a/hackfest/yang/topology.py +++ b/hackfest/yang/topology.py @@ -1,3 +1,17 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + from binding_topology import topology from pyangbind.lib.serialise import pybindIETFXMLEncoder import pyangbind.lib.pybindJSON as pybindJSON diff --git a/hackfest/yang/topology.xml b/hackfest/yang/topology.xml index 93af48085..9baab0342 100644 --- a/hackfest/yang/topology.xml +++ b/hackfest/yang/topology.xml @@ -1,3 +1,19 @@ + + diff --git a/install_requirements.sh b/install_requirements.sh old mode 100755 new mode 100644 index ea9385729..f2013d275 --- a/install_requirements.sh +++ b/install_requirements.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/manifests/.gitlab-ci.yml b/manifests/.gitlab-ci.yml index 9ce323c58..9444afea5 100644 --- a/manifests/.gitlab-ci.yml +++ b/manifests/.gitlab-ci.yml @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/manifests/cockroachdb/single-node.yaml b/manifests/cockroachdb/single-node.yaml index f207d2594..72454a090 100644 --- a/manifests/cockroachdb/single-node.yaml +++ b/manifests/cockroachdb/single-node.yaml @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/manifests/computeservice.yaml b/manifests/computeservice.yaml index 89a4a39e5..7e40ef988 100644 --- a/manifests/computeservice.yaml +++ b/manifests/computeservice.yaml @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/manifests/contextservice.yaml b/manifests/contextservice.yaml index 805808d5d..b1e6eb89d 100644 --- a/manifests/contextservice.yaml +++ b/manifests/contextservice.yaml @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/manifests/dbscanservingservice.yaml b/manifests/dbscanservingservice.yaml index e1f73a237..ae9201434 100644 --- a/manifests/dbscanservingservice.yaml +++ b/manifests/dbscanservingservice.yaml @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/manifests/deviceservice.yaml b/manifests/deviceservice.yaml index 3580df088..ca2c81f0f 100644 --- a/manifests/deviceservice.yaml +++ b/manifests/deviceservice.yaml @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/manifests/dltservice.yaml b/manifests/dltservice.yaml index c067960b7..5e8f745f7 100644 --- a/manifests/dltservice.yaml +++ b/manifests/dltservice.yaml @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/manifests/interdomainservice.yaml b/manifests/interdomainservice.yaml index b21434361..79acf96de 100644 --- a/manifests/interdomainservice.yaml +++ b/manifests/interdomainservice.yaml @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/manifests/l3_attackmitigatorservice.yaml b/manifests/l3_attackmitigatorservice.yaml index 592143089..dec1bc4d9 100644 --- a/manifests/l3_attackmitigatorservice.yaml +++ b/manifests/l3_attackmitigatorservice.yaml @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/manifests/l3_centralizedattackdetectorservice.yaml b/manifests/l3_centralizedattackdetectorservice.yaml index 8672cab95..0ef23ba51 100644 --- a/manifests/l3_centralizedattackdetectorservice.yaml +++ b/manifests/l3_centralizedattackdetectorservice.yaml @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/manifests/l3_distributedattackdetectorservice.yaml b/manifests/l3_distributedattackdetectorservice.yaml index 8765b7171..b363c1d5c 100644 --- a/manifests/l3_distributedattackdetectorservice.yaml +++ b/manifests/l3_distributedattackdetectorservice.yaml @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/manifests/load_generatorservice.yaml b/manifests/load_generatorservice.yaml index 4d7b32d1b..b94e11e72 100644 --- a/manifests/load_generatorservice.yaml +++ b/manifests/load_generatorservice.yaml @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/manifests/mock_blockchain.yaml b/manifests/mock_blockchain.yaml index 17b32a47e..1093610f8 100644 --- a/manifests/mock_blockchain.yaml +++ b/manifests/mock_blockchain.yaml @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/manifests/monitoringservice.yaml b/manifests/monitoringservice.yaml index 77e62518d..4447a1427 100644 --- a/manifests/monitoringservice.yaml +++ b/manifests/monitoringservice.yaml @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/manifests/nginx_ingress_http.yaml b/manifests/nginx_ingress_http.yaml index fe262d328..5db05d4af 100644 --- a/manifests/nginx_ingress_http.yaml +++ b/manifests/nginx_ingress_http.yaml @@ -1,3 +1,17 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + apiVersion: networking.k8s.io/v1 kind: Ingress metadata: diff --git a/manifests/opticalattackmitigatorservice.yaml b/manifests/opticalattackmitigatorservice.yaml index 0252eec21..bfac05e40 100644 --- a/manifests/opticalattackmitigatorservice.yaml +++ b/manifests/opticalattackmitigatorservice.yaml @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/manifests/opticalcentralizedattackdetectorservice.yaml b/manifests/opticalcentralizedattackdetectorservice.yaml index 4a49f8b13..13d4d97c2 100644 --- a/manifests/opticalcentralizedattackdetectorservice.yaml +++ b/manifests/opticalcentralizedattackdetectorservice.yaml @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/manifests/pathcompservice.yaml b/manifests/pathcompservice.yaml index 4f7a65c45..fd3599f42 100644 --- a/manifests/pathcompservice.yaml +++ b/manifests/pathcompservice.yaml @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/manifests/prometheus.yaml b/manifests/prometheus.yaml index 221123eea..43a766b6e 100644 --- a/manifests/prometheus.yaml +++ b/manifests/prometheus.yaml @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/manifests/questdb/manifest.yaml b/manifests/questdb/manifest.yaml index 1da4bf2c5..50a2ce2c6 100644 --- a/manifests/questdb/manifest.yaml +++ b/manifests/questdb/manifest.yaml @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/manifests/servicemonitors.yaml b/manifests/servicemonitors.yaml index ad5f042ba..06c3390f4 100644 --- a/manifests/servicemonitors.yaml +++ b/manifests/servicemonitors.yaml @@ -1,3 +1,17 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: diff --git a/manifests/serviceservice.yaml b/manifests/serviceservice.yaml index 02c9e25db..3fa4a6e0d 100644 --- a/manifests/serviceservice.yaml +++ b/manifests/serviceservice.yaml @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/manifests/sliceservice.yaml b/manifests/sliceservice.yaml index 56c5eb1b5..447f6a1c7 100644 --- a/manifests/sliceservice.yaml +++ b/manifests/sliceservice.yaml @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/manifests/webuiservice.yaml b/manifests/webuiservice.yaml index d0a64871a..f25dbf6e5 100644 --- a/manifests/webuiservice.yaml +++ b/manifests/webuiservice.yaml @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/my_deploy.sh b/my_deploy.sh index f909e9ebd..6f0e64afe 100644 --- a/my_deploy.sh +++ b/my_deploy.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/proto/acl.proto b/proto/acl.proto index d3717e9c4..3dba735dc 100644 --- a/proto/acl.proto +++ b/proto/acl.proto @@ -1,4 +1,4 @@ -// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/proto/attack_mitigator.proto b/proto/attack_mitigator.proto index e538a9d2e..0ec503bda 100644 --- a/proto/attack_mitigator.proto +++ b/proto/attack_mitigator.proto @@ -1,4 +1,4 @@ -// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/proto/automation.proto b/proto/automation.proto index 929723676..e2dbe3322 100644 --- a/proto/automation.proto +++ b/proto/automation.proto @@ -1,4 +1,4 @@ -// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/proto/centralized_attack_detector.proto b/proto/centralized_attack_detector.proto index 4ce34cfa4..7b4fc35f0 100644 --- a/proto/centralized_attack_detector.proto +++ b/proto/centralized_attack_detector.proto @@ -1,4 +1,4 @@ -// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/proto/compute.proto b/proto/compute.proto index 0e7c7a738..ecc9a075f 100644 --- a/proto/compute.proto +++ b/proto/compute.proto @@ -1,4 +1,4 @@ -// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/proto/context.proto b/proto/context.proto index 3ab3597e4..e403c4a22 100644 --- a/proto/context.proto +++ b/proto/context.proto @@ -1,4 +1,4 @@ -// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/proto/context_policy.proto b/proto/context_policy.proto index efad68df6..f6dae4830 100644 --- a/proto/context_policy.proto +++ b/proto/context_policy.proto @@ -1,4 +1,4 @@ -// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/proto/dbscanserving.proto b/proto/dbscanserving.proto index d7d0512b6..21ff45dfa 100644 --- a/proto/dbscanserving.proto +++ b/proto/dbscanserving.proto @@ -1,4 +1,4 @@ -// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/proto/device.proto b/proto/device.proto index f41e2891a..30e60079d 100644 --- a/proto/device.proto +++ b/proto/device.proto @@ -1,4 +1,4 @@ -// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/proto/distributed_cybersecurity.proto b/proto/distributed_cybersecurity.proto index 664e1383f..bc95fcc3d 100644 --- a/proto/distributed_cybersecurity.proto +++ b/proto/distributed_cybersecurity.proto @@ -1,4 +1,4 @@ -// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/proto/dlt_connector.proto b/proto/dlt_connector.proto index cee0c70bd..3a4d11dd9 100644 --- a/proto/dlt_connector.proto +++ b/proto/dlt_connector.proto @@ -1,4 +1,4 @@ -// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/proto/dlt_gateway.proto b/proto/dlt_gateway.proto index 84fe0fef6..6ae4fbb75 100644 --- a/proto/dlt_gateway.proto +++ b/proto/dlt_gateway.proto @@ -1,4 +1,4 @@ -// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/proto/forecaster.proto b/proto/forecaster.proto index 576afb101..5a4403b01 100644 --- a/proto/forecaster.proto +++ b/proto/forecaster.proto @@ -1,4 +1,4 @@ -// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/proto/generate_code_python.sh b/proto/generate_code_python.sh old mode 100755 new mode 100644 index b0df357eb..5c5db5444 --- a/proto/generate_code_python.sh +++ b/proto/generate_code_python.sh @@ -1,5 +1,5 @@ #!/bin/bash -eu -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -20,7 +20,7 @@ mkdir -p src/python rm -rf src/python/*.py tee src/python/__init__.py << EOF > /dev/null -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/proto/generate_uml.sh b/proto/generate_uml.sh old mode 100755 new mode 100644 index 6f20b6f4c..8bdd76ac5 --- a/proto/generate_uml.sh +++ b/proto/generate_uml.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/proto/health.proto b/proto/health.proto index 0252f5d87..f3057a7e7 100644 --- a/proto/health.proto +++ b/proto/health.proto @@ -1,4 +1,4 @@ -// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/proto/interdomain.proto b/proto/interdomain.proto index b8a31c249..3e44fb447 100644 --- a/proto/interdomain.proto +++ b/proto/interdomain.proto @@ -1,4 +1,4 @@ -// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/proto/kpi_sample_types.proto b/proto/kpi_sample_types.proto index 4419a8df4..1ade4d69b 100644 --- a/proto/kpi_sample_types.proto +++ b/proto/kpi_sample_types.proto @@ -1,4 +1,4 @@ -// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/proto/l3_attackmitigator.proto b/proto/l3_attackmitigator.proto index 39333718a..5ce9428b6 100644 --- a/proto/l3_attackmitigator.proto +++ b/proto/l3_attackmitigator.proto @@ -1,4 +1,4 @@ -// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/proto/l3_centralizedattackdetector.proto b/proto/l3_centralizedattackdetector.proto index 3cb1b0991..2aeb8826e 100644 --- a/proto/l3_centralizedattackdetector.proto +++ b/proto/l3_centralizedattackdetector.proto @@ -1,4 +1,4 @@ -// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/proto/load_generator.proto b/proto/load_generator.proto index 00ddb254c..98f6eefda 100644 --- a/proto/load_generator.proto +++ b/proto/load_generator.proto @@ -1,4 +1,4 @@ -// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/proto/monitoring.proto b/proto/monitoring.proto index f9c408c96..3862973e0 100644 --- a/proto/monitoring.proto +++ b/proto/monitoring.proto @@ -1,4 +1,4 @@ -// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/proto/optical_attack_mitigator.proto b/proto/optical_attack_mitigator.proto index 881f9fde3..1dbb4e19a 100644 --- a/proto/optical_attack_mitigator.proto +++ b/proto/optical_attack_mitigator.proto @@ -1,4 +1,4 @@ -// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/proto/optical_centralized_attack_detector.proto b/proto/optical_centralized_attack_detector.proto index d480054f2..98ffeddc8 100644 --- a/proto/optical_centralized_attack_detector.proto +++ b/proto/optical_centralized_attack_detector.proto @@ -1,4 +1,4 @@ -// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/proto/pathcomp.proto b/proto/pathcomp.proto index 08f33efe9..181f05cc2 100644 --- a/proto/pathcomp.proto +++ b/proto/pathcomp.proto @@ -1,4 +1,4 @@ -// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/proto/policy.proto b/proto/policy.proto index 9d0c34a33..a6f160150 100644 --- a/proto/policy.proto +++ b/proto/policy.proto @@ -1,4 +1,4 @@ -// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/proto/policy_action.proto b/proto/policy_action.proto index 8f681adf3..17dd72119 100644 --- a/proto/policy_action.proto +++ b/proto/policy_action.proto @@ -1,4 +1,4 @@ -// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/proto/policy_condition.proto b/proto/policy_condition.proto index 7cd657667..2037af93c 100644 --- a/proto/policy_condition.proto +++ b/proto/policy_condition.proto @@ -1,4 +1,4 @@ -// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/proto/service.proto b/proto/service.proto index 90a2f2ecf..21e569941 100644 --- a/proto/service.proto +++ b/proto/service.proto @@ -1,4 +1,4 @@ -// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/proto/slice.proto b/proto/slice.proto index 69fa242e2..cad483c0f 100644 --- a/proto/slice.proto +++ b/proto/slice.proto @@ -1,4 +1,4 @@ -// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/proto/src/python/__init__.py b/proto/src/python/__init__.py index 9953c8205..38d04994f 100644 --- a/proto/src/python/__init__.py +++ b/proto/src/python/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/proto/te.proto b/proto/te.proto index d639cb7f4..983f6602b 100644 --- a/proto/te.proto +++ b/proto/te.proto @@ -1,4 +1,4 @@ -// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/run_tests_docker.sh b/run_tests_docker.sh old mode 100755 new mode 100644 index fd8851409..d27c4e7d8 --- a/run_tests_docker.sh +++ b/run_tests_docker.sh @@ -1,4 +1,18 @@ #!/bin/bash +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + ######################################################################################################################## # Define your deployment settings here diff --git a/scripts/add_license_header_to_files.sh b/scripts/add_license_header_to_files.sh old mode 100755 new mode 100644 index 4da238944..4c11fc316 --- a/scripts/add_license_header_to_files.sh +++ b/scripts/add_license_header_to_files.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -26,6 +26,5 @@ docker run -it -v ${PWD}:/src ghcr.io/google/addlicense \ -ignore "src/**/target/generated-sources/grpc/*" -ignore "src/**/target/generated-sources/grpc/**" \ -ignore "src/**/*_pb2.py" -ignore "src/**/*_pb2_grpc.py" \ -ignore "src/device/service/drivers/openconfig/templates/**/*.xml" \ - -ignore "src/dlt/*" -ignore "src/dlt/**" \ -ignore "src/**/.mvn/*" -ignore "src/**/.mvn/**" \ * diff --git a/scripts/build_run_report_tests_locally.sh b/scripts/build_run_report_tests_locally.sh old mode 100755 new mode 100644 index 9bdc81d98..7a44eef02 --- a/scripts/build_run_report_tests_locally.sh +++ b/scripts/build_run_report_tests_locally.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/cockroachdb_client.sh b/scripts/cockroachdb_client.sh old mode 100755 new mode 100644 index edd979446..0300bb294 --- a/scripts/cockroachdb_client.sh +++ b/scripts/cockroachdb_client.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/create_component.sh b/scripts/create_component.sh old mode 100755 new mode 100644 index 17f6abc64..549f09bf4 --- a/scripts/create_component.sh +++ b/scripts/create_component.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/dump_logs.sh b/scripts/dump_logs.sh old mode 100755 new mode 100644 index a6db945d2..f50f8b133 --- a/scripts/dump_logs.sh +++ b/scripts/dump_logs.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/old/configure_dashboards_in_kubernetes.sh b/scripts/old/configure_dashboards_in_kubernetes.sh old mode 100755 new mode 100644 index 4a32d76de..545e13cff --- a/scripts/old/configure_dashboards_in_kubernetes.sh +++ b/scripts/old/configure_dashboards_in_kubernetes.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/old/deploy_in_kubernetes.sh b/scripts/old/deploy_in_kubernetes.sh old mode 100755 new mode 100644 index c85354137..c13a23666 --- a/scripts/old/deploy_in_kubernetes.sh +++ b/scripts/old/deploy_in_kubernetes.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/old/open_dashboard.sh b/scripts/old/open_dashboard.sh old mode 100755 new mode 100644 index d0529a009..4ea206f45 --- a/scripts/old/open_dashboard.sh +++ b/scripts/old/open_dashboard.sh @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/old/open_webui.sh b/scripts/old/open_webui.sh old mode 100755 new mode 100644 index d539c1970..5bb0082e1 --- a/scripts/old/open_webui.sh +++ b/scripts/old/open_webui.sh @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/report_coverage_all.sh b/scripts/report_coverage_all.sh old mode 100755 new mode 100644 index 3b7df170c..cf3a05c03 --- a/scripts/report_coverage_all.sh +++ b/scripts/report_coverage_all.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/report_coverage_common.sh b/scripts/report_coverage_common.sh old mode 100755 new mode 100644 index f69c57a01..f7f1076bd --- a/scripts/report_coverage_common.sh +++ b/scripts/report_coverage_common.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/report_coverage_compute.sh b/scripts/report_coverage_compute.sh old mode 100755 new mode 100644 index 15e9e3422..4d986b5c3 --- a/scripts/report_coverage_compute.sh +++ b/scripts/report_coverage_compute.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/report_coverage_context.sh b/scripts/report_coverage_context.sh old mode 100755 new mode 100644 index b39c45833..2784bdf10 --- a/scripts/report_coverage_context.sh +++ b/scripts/report_coverage_context.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/report_coverage_device.sh b/scripts/report_coverage_device.sh old mode 100755 new mode 100644 index d7a1dc084..c1bbb8473 --- a/scripts/report_coverage_device.sh +++ b/scripts/report_coverage_device.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/report_coverage_l3_attackmitigator.sh b/scripts/report_coverage_l3_attackmitigator.sh old mode 100755 new mode 100644 index c34283dbb..80496eaf8 --- a/scripts/report_coverage_l3_attackmitigator.sh +++ b/scripts/report_coverage_l3_attackmitigator.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/report_coverage_l3_centralizedattackdetector.sh b/scripts/report_coverage_l3_centralizedattackdetector.sh old mode 100755 new mode 100644 index 1060bae05..d662dadb7 --- a/scripts/report_coverage_l3_centralizedattackdetector.sh +++ b/scripts/report_coverage_l3_centralizedattackdetector.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/report_coverage_l3_distributedattackdetector.sh b/scripts/report_coverage_l3_distributedattackdetector.sh old mode 100755 new mode 100644 index 94c2a16f4..e83dd01e6 --- a/scripts/report_coverage_l3_distributedattackdetector.sh +++ b/scripts/report_coverage_l3_distributedattackdetector.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/report_coverage_pathcomp.sh b/scripts/report_coverage_pathcomp.sh old mode 100755 new mode 100644 index 3af2790f8..9e91fb258 --- a/scripts/report_coverage_pathcomp.sh +++ b/scripts/report_coverage_pathcomp.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/report_coverage_service.sh b/scripts/report_coverage_service.sh old mode 100755 new mode 100644 index 4a3c5cc06..41c25bfab --- a/scripts/report_coverage_service.sh +++ b/scripts/report_coverage_service.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/report_coverage_slice.sh b/scripts/report_coverage_slice.sh old mode 100755 new mode 100644 index f9b17e8bd..64c68d492 --- a/scripts/report_coverage_slice.sh +++ b/scripts/report_coverage_slice.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/run_tests_locally-compute.sh b/scripts/run_tests_locally-compute.sh old mode 100755 new mode 100644 index d48fe4171..3fed523e5 --- a/scripts/run_tests_locally-compute.sh +++ b/scripts/run_tests_locally-compute.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/run_tests_locally-context.sh b/scripts/run_tests_locally-context.sh old mode 100755 new mode 100644 index 9d29ac587..79bac938a --- a/scripts/run_tests_locally-context.sh +++ b/scripts/run_tests_locally-context.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/run_tests_locally-device-all.sh b/scripts/run_tests_locally-device-all.sh old mode 100755 new mode 100644 index a60eab0be..b44db77ce --- a/scripts/run_tests_locally-device-all.sh +++ b/scripts/run_tests_locally-device-all.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/run_tests_locally-device-emulated.sh b/scripts/run_tests_locally-device-emulated.sh old mode 100755 new mode 100644 index 541017f7a..0f1c74df0 --- a/scripts/run_tests_locally-device-emulated.sh +++ b/scripts/run_tests_locally-device-emulated.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/run_tests_locally-device-microwave.sh b/scripts/run_tests_locally-device-microwave.sh old mode 100755 new mode 100644 index 21f3e5ab6..e4cab1796 --- a/scripts/run_tests_locally-device-microwave.sh +++ b/scripts/run_tests_locally-device-microwave.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/run_tests_locally-device-openconfig.sh b/scripts/run_tests_locally-device-openconfig.sh old mode 100755 new mode 100644 index f87346fed..06a8c8e10 --- a/scripts/run_tests_locally-device-openconfig.sh +++ b/scripts/run_tests_locally-device-openconfig.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/run_tests_locally-device-p4.sh b/scripts/run_tests_locally-device-p4.sh old mode 100755 new mode 100644 index 4e6754e4d..0d73e3564 --- a/scripts/run_tests_locally-device-p4.sh +++ b/scripts/run_tests_locally-device-p4.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/run_tests_locally-device-tapi.sh b/scripts/run_tests_locally-device-tapi.sh old mode 100755 new mode 100644 index d37e4e2b7..3a00f5857 --- a/scripts/run_tests_locally-device-tapi.sh +++ b/scripts/run_tests_locally-device-tapi.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/run_tests_locally-pathcomp-frontend.sh b/scripts/run_tests_locally-pathcomp-frontend.sh old mode 100755 new mode 100644 index 1bcf5e7f3..4318b2f47 --- a/scripts/run_tests_locally-pathcomp-frontend.sh +++ b/scripts/run_tests_locally-pathcomp-frontend.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/run_tests_locally-service.sh b/scripts/run_tests_locally-service.sh old mode 100755 new mode 100644 index 8816b9faa..e671b0fc8 --- a/scripts/run_tests_locally-service.sh +++ b/scripts/run_tests_locally-service.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/run_tests_locally-slice.sh b/scripts/run_tests_locally-slice.sh old mode 100755 new mode 100644 index fa3af4eba..9e5f47c18 --- a/scripts/run_tests_locally-slice.sh +++ b/scripts/run_tests_locally-slice.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/run_tests_locally.sh b/scripts/run_tests_locally.sh old mode 100755 new mode 100644 index 486107994..b609fbb39 --- a/scripts/run_tests_locally.sh +++ b/scripts/run_tests_locally.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/show_logs_automation.sh b/scripts/show_logs_automation.sh old mode 100755 new mode 100644 index 0c0615d99..46c0dbba9 --- a/scripts/show_logs_automation.sh +++ b/scripts/show_logs_automation.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/show_logs_compute.sh b/scripts/show_logs_compute.sh old mode 100755 new mode 100644 index 759918f11..fc992eb43 --- a/scripts/show_logs_compute.sh +++ b/scripts/show_logs_compute.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/show_logs_context.sh b/scripts/show_logs_context.sh old mode 100755 new mode 100644 index f4b6c620b..1051e6fd5 --- a/scripts/show_logs_context.sh +++ b/scripts/show_logs_context.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/show_logs_device.sh b/scripts/show_logs_device.sh old mode 100755 new mode 100644 index d3ef781c9..6a77c3815 --- a/scripts/show_logs_device.sh +++ b/scripts/show_logs_device.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/show_logs_dlt_connector.sh b/scripts/show_logs_dlt_connector.sh old mode 100755 new mode 100644 index db4c388c2..9e1f21ab9 --- a/scripts/show_logs_dlt_connector.sh +++ b/scripts/show_logs_dlt_connector.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/show_logs_dlt_gateway.sh b/scripts/show_logs_dlt_gateway.sh old mode 100755 new mode 100644 index c00be2df1..db29eebfa --- a/scripts/show_logs_dlt_gateway.sh +++ b/scripts/show_logs_dlt_gateway.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/show_logs_monitoring.sh b/scripts/show_logs_monitoring.sh old mode 100755 new mode 100644 index faa825fdf..1a152a322 --- a/scripts/show_logs_monitoring.sh +++ b/scripts/show_logs_monitoring.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/show_logs_pathcomp_backend.sh b/scripts/show_logs_pathcomp_backend.sh old mode 100755 new mode 100644 index cee99ee4b..b60b4e06c --- a/scripts/show_logs_pathcomp_backend.sh +++ b/scripts/show_logs_pathcomp_backend.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/show_logs_pathcomp_frontend.sh b/scripts/show_logs_pathcomp_frontend.sh old mode 100755 new mode 100644 index 32f92b59d..a08a67886 --- a/scripts/show_logs_pathcomp_frontend.sh +++ b/scripts/show_logs_pathcomp_frontend.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/show_logs_service.sh b/scripts/show_logs_service.sh old mode 100755 new mode 100644 index 6089d0ac6..7ca1c1c2f --- a/scripts/show_logs_service.sh +++ b/scripts/show_logs_service.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/show_logs_slice.sh b/scripts/show_logs_slice.sh old mode 100755 new mode 100644 index c7bc0b695..c71bc92ea --- a/scripts/show_logs_slice.sh +++ b/scripts/show_logs_slice.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/show_logs_webui.sh b/scripts/show_logs_webui.sh old mode 100755 new mode 100644 index 38cffd624..450527be6 --- a/scripts/show_logs_webui.sh +++ b/scripts/show_logs_webui.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/update_license_headers.py b/scripts/update_license_headers.py new file mode 100644 index 000000000..f721425f8 --- /dev/null +++ b/scripts/update_license_headers.py @@ -0,0 +1,114 @@ +#!/bin/bash +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + +# Run from ~/tfs-ctrl as: +# python scripts/update_license_headers.py + +import logging, os, re, sys +from io import TextIOWrapper + +logging.basicConfig(level=logging.INFO) +LOGGER = logging.getLogger(__name__) + +ROOT_PATH = '.' +FILE_PATH_SKIPPED = 'out-skipped.txt' +FILE_PATH_NO_HEADER = 'out-no-header.txt' +FILE_PATH_UPDATED = 'out-updated.txt' + +RE_OLD_COPYRIGHT = re.compile(r'Copyright\ 2021\-2023\ H2020\ TeraFlow\ \(https\:\/\/www\.teraflow\-h2020\.eu\/\)') +STR_NEW_COPYRIGHT = 'Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)' + +def skip_file(file_path : str) -> bool: + if file_path.endswith('.pyc'): return True + if file_path.endswith('_pb2_grpc.py'): return True + if file_path.endswith('_pb2.py'): return True + if file_path.endswith('.md'): return True + if file_path.endswith('.png'): return True + if file_path.endswith('.json'): return True + if file_path.endswith('.zip'): return True + if file_path.endswith('.zip'): return True + if file_path.endswith('.jar'): return True + if file_path.endswith('/tstat'): return True + if file_path.endswith('/.gitignore'): return True + if file_path.endswith('/.gitkeep'): return True + if file_path.endswith('/coverage/.coverage'): return True + if file_path.startswith('./netconf_openconfig/'): return True + if file_path.startswith('./tmp/'): return True + if '/manifests/cttc-ols/' in file_path: return True + if '/hackfest/netconf-oc/openconfig/' in file_path: return True + if '/.git/' in file_path: return True + if '/.vscode/' in file_path: return True + if '/.pytest_cache/' in file_path: return True + if '/__pycache__/' in file_path: return True + if '/.mvn/' in file_path: return True + if '/hackfest/kafka/kafka_2.13-2.8.0' in file_path: return True + if '/src/device/service/drivers/openconfig/templates/' in file_path: return True + if '/automation/target/generated-sources/grpc/' in file_path: return True + if '/automation/target/kubernetes/' in file_path: return True + if '/policy/target/generated-sources/grpc/' in file_path: return True + if '/policy/target/kubernetes/' in file_path: return True + if '/src/dlt/gateway/' in file_path: return True + if FILE_PATH_SKIPPED in file_path: return True + if FILE_PATH_NO_HEADER in file_path: return True + if FILE_PATH_UPDATED in file_path: return True + if file_path in {'./LICENSE', './.python-version', './.env'}: return True + return False + +def process_line(line_in : str) -> str: + line_out = RE_OLD_COPYRIGHT.sub(STR_NEW_COPYRIGHT, line_in) + if line_out != line_in: return line_out + return line_in + +def process_file( + file_path : str, file_no_header : TextIOWrapper, file_skipped : TextIOWrapper, file_updated : TextIOWrapper +) -> None: + if skip_file(file_path): + file_skipped.write(file_path + '\n') + return + + LOGGER.info(' File {:s}...'.format(str(file_path))) + + temp_file_path = file_path + '.temp' + replaced = False + try: + with open(file_path, encoding='UTF-8') as source: + with open(temp_file_path, 'w', encoding='UTF-8') as target: + for line_in in source: + line_out = process_line(line_in) + target.write(line_out) + replaced = replaced or (line_out != line_in) + except: # pylint: disable=bare-except + replaced = False + + if not replaced: + file_no_header.write(file_path + '\n') + else: + file_updated.write(file_path + '\n') + + os.rename(temp_file_path, file_path) + +def main() -> int: + with open(FILE_PATH_NO_HEADER, 'w', encoding='UTF-8') as file_no_header: + with open(FILE_PATH_SKIPPED, 'w', encoding='UTF-8') as file_skipped: + with open(FILE_PATH_UPDATED, 'w', encoding='UTF-8') as file_updated: + for dirpath, _, filenames in os.walk(ROOT_PATH): + LOGGER.info('Folder {:s}...'.format(str(dirpath))) + for filename in filenames: + file_path = os.path.join(dirpath, filename) + process_file(file_path, file_no_header, file_skipped, file_updated) + return 0 + +if __name__ == '__main__': + sys.exit(main()) diff --git a/src/__init__.py b/src/__init__.py index 70a332512..1549d9811 100644 --- a/src/__init__.py +++ b/src/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/automation/.gitlab-ci.yml b/src/automation/.gitlab-ci.yml index 9c66a1798..0dc6284a4 100644 --- a/src/automation/.gitlab-ci.yml +++ b/src/automation/.gitlab-ci.yml @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/automation/mvnw b/src/automation/mvnw old mode 100755 new mode 100644 diff --git a/src/automation/pom.xml b/src/automation/pom.xml index 4609c2c8d..2fd5fd263 100644 --- a/src/automation/pom.xml +++ b/src/automation/pom.xml @@ -1,6 +1,6 @@ + {% extends 'base.html' %} {% block content %} diff --git a/src/webui/service/templates/device/updateconfig.html b/src/webui/service/templates/device/updateconfig.html index de217733d..84df4e51c 100644 --- a/src/webui/service/templates/device/updateconfig.html +++ b/src/webui/service/templates/device/updateconfig.html @@ -1,5 +1,5 @@