diff options
author | liyin <liyin11@huawei.com> | 2018-03-07 03:47:28 +0000 |
---|---|---|
committer | Ace Lee <liyin11@huawei.com> | 2018-03-12 02:21:54 +0000 |
commit | adf6a02bae295455f584ebab762592dd57e2422c (patch) | |
tree | 04c01b98d18eed356e4adf542bbcde53b00cafde /utils/infra_setup | |
parent | 06db2e37272bb3a030c2b5f2e255ec6a61f17472 (diff) |
bottlenecks offiline support
JIRA: BOTTLENECK-224
This patch for bottlenecks support offiline.
By use some offiline image rather than yardstick env prepare.
This will solve some problem happened in yardstick image builder.
Change-Id: I62b6606570c2ea6ce365212c79777af01c47c9a6
Signed-off-by: liyin <liyin11@huawei.com>
Diffstat (limited to 'utils/infra_setup')
-rw-r--r-- | utils/infra_setup/heat/manager.py | 2 | ||||
-rw-r--r-- | utils/infra_setup/runner/docker_env.py | 2 | ||||
-rw-r--r-- | utils/infra_setup/runner/yardstick.py | 15 |
3 files changed, 17 insertions, 2 deletions
diff --git a/utils/infra_setup/heat/manager.py b/utils/infra_setup/heat/manager.py index 5c181ae6..1a360b78 100644 --- a/utils/infra_setup/heat/manager.py +++ b/utils/infra_setup/heat/manager.py @@ -35,7 +35,7 @@ def _get_neutron_client(): return neutron_client -def stack_create_images( +def create_images( imagefile=None, image_name="bottlenecks_image"): print "========== Create image in OS ==========" diff --git a/utils/infra_setup/runner/docker_env.py b/utils/infra_setup/runner/docker_env.py index 54478ffc..438d3d19 100644 --- a/utils/infra_setup/runner/docker_env.py +++ b/utils/infra_setup/runner/docker_env.py @@ -45,7 +45,7 @@ def env_yardstick(docker_name): volume = get_self_volume() yardstick_tag = os.getenv("Yardstick_TAG") if yardstick_tag is None: - yardstick_tag = "danube.3.1" + yardstick_tag = "latest" env_docker = client.containers.run(image="opnfv/yardstick:%s" % yardstick_tag, privileged=True, diff --git a/utils/infra_setup/runner/yardstick.py b/utils/infra_setup/runner/yardstick.py index 559b9c10..616bcc52 100644 --- a/utils/infra_setup/runner/yardstick.py +++ b/utils/infra_setup/runner/yardstick.py @@ -15,15 +15,27 @@ At present, This file contain the following function: 4.how the process of task.''' import sys +import os import time import requests import json +import urllib import utils.logger as logger +from utils.parser import Parser as config +import utils.env_prepare.stack_prepare as env headers = {"Content-Type": "application/json"} LOG = logger.Logger(__name__).getLogger() +def yardstick_image_prepare(): + if not os.path.exists(config.bottlenecks_config["yardstick_image_dir"]): + urllib.urlretrieve(config.bottlenecks_config["image_url"], + config.bottlenecks_config["yardstick_image_dir"]) + env.prepare_image(config.bottlenecks_config["yardstick_image_name"], + config.bottlenecks_config["yardstick_image_dir"]) + + def yardstick_command_parser(debug, cidr, outfile, parameter): cmd = "yardstick" if debug: @@ -31,6 +43,9 @@ def yardstick_command_parser(debug, cidr, outfile, parameter): cmd += " task start " cmd += str(cidr) cmd += " --output-file " + outfile + image_name = config.bottlenecks_config["yardstick_image_name"] + parameter["image_name"] = image_name + print parameter if parameter is not None: cmd += " --task-args " + '"' + str(parameter) + '"' return cmd |