Beispiel #1
0
    def __init__(self, args):
        self.logger = TangoLogger.getLogger(__name__)
        self.start_time = time.time()
        self.service_experiments = list()
        self.function_experiments = list()
        self.args = args
        self.args.debug = self.args.verbose
        self.args.ped = os.path.join(os.getcwd(), self.args.ped)
        # load config file: try different paths
        for path in [
                os.path.abspath(os.path.expanduser(args.configfile)),
                os.path.abspath(".tng-bench.conf"),
                os.path.abspath("config.yml")
        ]:
            try:
                self.args.config = self._load_config(path)
                break
            except BaseException as ex:
                self.logger.error(ex)
                self.args.config = None
        if self.args.config is None:
            print("Connot run without configuration.")
            exit(1)

        # logging setup
        coloredlogs.install(level="DEBUG" if args.verbose else "INFO")
        self.logger.info("5GTANGO benchmarking/profiling tool initialized")
        self.logger.debug("Arguments: %r" % self.args)
Beispiel #2
0
 def __init__(self, args):
     self.logger = TangoLogger.getLogger(__name__)
     self.start_time = time.time()
     self.service_experiments = list()
     self.function_experiments = list()
     self.args = args
     self.args.debug = self.args.verbose
     self.args.ped = os.path.join(os.getcwd(), self.args.ped)
     self.args.config = self._load_config(os.path.abspath(args.configfile))
     # logging setup
     coloredlogs.install(level="DEBUG" if args.verbose else "INFO")
     self.logger.info("5GTANGO benchmarking/profiling tool initialized")
     self.logger.debug("Arguments: %r" % self.args)
Beispiel #3
0
# acknowledge the contributions of their colleagues of the SONATA
# partner consortium (www.5gtango.eu).

import time
import shutil
import os
import yaml
import tarfile
from io import BytesIO
from tngsdk.benchmark.generator import ServiceConfigurationGenerator
from tngsdk.benchmark.helper import ensure_dir, read_yaml, write_yaml
from tngsdk.benchmark.helper import parse_ec_parameter_key
import tngsdk.package as tngpkg
from tngsdk.benchmark.logger import TangoLogger

LOG = TangoLogger.getLogger(__name__)

BASE_PKG_PATH = "base_pkg/"
BASE_PROJECT_PATH = "base_project/"
GEN_PROJECT_PATH = "gen_projects/"
GEN_PKG_PATH = "gen_pkgs/"
TEMPLATE_VNFD_MP = "template/tango_vnfd_mp.yml"


class OSMServiceConfigurationGenerator(ServiceConfigurationGenerator):
    """
    5GTANGO Service Configuration Generator.
    Input: 5GTANGO service package.
    Output: 5GTANGO service packages w. applied
    experiment configurations, e.g., resource limits.
    """