#!/usr/bin/python ############################################################################### # Copyright (c) 2015 Ericsson AB and others. # jonas.bjurel@ericsson.com # All rights reserved. This program and the accompanying materials # are made available under the terms of the Apache License, Version 2.0 # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################### ############################################################################### # Description # This script constructs the final deployment dea.yaml and dha.yaml files # The dea.yaml get's constructed from (in reverse priority): # 1) dea-base # 2) dea-pod-override # 3) deployment-scenario dea-override-config section # # The dha.yaml get's constructed from (in reverse priority): # 1) pod dha # 2) deployment-scenario dha-override-config section ############################################################################### import os import yaml import sys import urllib2 import calendar import time import collections import hashlib from functools import reduce from operator import or_ from common import ( log, exec_cmd, err, warn, check_file_exists, create_dir_if_not_exists, delete, check_if_root, ArgParser, ) def parse_arguments(): parser = ArgParser(prog='python %s' % __file__) parser.add_argument('-dha', dest='dha_uri', action='store', default=False, help='dha configuration file FQDN URI', required=True) parser.add_argument('-deab', dest='dea_base_uri', action='store', default=False, help='dea base configuration FQDN URI', required=True) parser.add_argument('-deao', dest='dea_pod_override_uri', action='store', default=False, help='dea POD override configuration FQDN URI', required=True) parser.add_argument('-scenario-base-uri', dest='scenario_base_uri', action='store', default=False, help='Deployment scenario base directory URI', required=True) parser.add_argument('-scenario', dest='scenario', action='store', default=False, help=('Deployment scenario short-name (priority),' 'or base file name (in the absense of a' 'shortname defenition)'), required=True) parser.add_argument('-plugins', dest='plugins_uri', action='store', default=False, help='Plugin configurations directory URI', required=True) parser.add_argument('-output', dest='output_path', action='store', default=False, help='Local path for resulting output configuration files', required=True) args = parser.parse_args() log(args) kwargs = {'dha_uri': args.dha_uri, 'dea_base_uri': args.dea_base_uri, 'dea_pod_override_uri': args.dea_pod_override_uri, 'scenario_base_uri': args.scenario_base_uri, 'scenario': args.scenario, 'plugins_uri': args.plugins_uri, 'output_path': args.output_path} return kwargs def warning(msg): red = '\033[0;31m' NC = '\033[0m' print('%(red)s WARNING: %(msg)s %(NC)s' % {'red': red, 'msg': msg, 'NC': NC}) def setup_yaml(): represent_dict_order = lambda self, data: self.represent_mapping('tag:yaml.org,2002:map', data.items()) yaml.add_representer(collections.OrderedDict, represent_dict_order) def sha_uri(uri): response = urllib2.urlopen(uri) data = response.read() sha1 = hashlib.sha1() sha1.update(data) return sha1.hexdigest() def merge_fuel_plugin_version_list(list1, list2): final_list = [] # When the plugin version in not there in list1 it will # not be copied for e_l1 in list1: plugin_version = e_l1.get('metadata', {}).get('plugin_version') plugin_version_found = False for e_l2 in list2: if plugin_version == e_l2.get('metadata', {}).get('plugin_version'): final_l
##############################################################################
# Copyright (c) 2017 Huawei Technologies Co.,Ltd and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
---
# Sample StorPerf benchmark task config file
# StorPerf is a tool to measure block and object storage performance in an NFVI
schema: "yardstick:task:0.1"
scenarios:
-
type: StorPerf
options:
agent_count: 1
agent_image: "Ubuntu-16.04"
agent_flavor: "storperf"
public_network: "ext-net"
volume_size: 2
# target:
# deadline:
# nossd:
# nowarm:
block_sizes: "4096"
queue_depths: "4"
workload: "ws"
StorPerf_ip: "192.168.23.2"
query_interval: 10
timeout: 600
runner:
type: Iteration
iterations: 1
context:
type: Dummy