summaryrefslogtreecommitdiffstats
path: root/utils/infra_setup
diff options
context:
space:
mode:
authorYu Yang (Gabriel) <Gabriel.yuyang@huawei.com>2018-03-12 02:51:26 +0000
committerGerrit Code Review <gerrit@opnfv.org>2018-03-12 02:51:26 +0000
commit75bf3ebba105798ce450b321a5d770fcee985896 (patch)
treef06384343e86d96e6b25bf99df07eea14d280c1e /utils/infra_setup
parent952db3aa4d1fe889c524d1d70bde0479e638f53e (diff)
parentadf6a02bae295455f584ebab762592dd57e2422c (diff)
Merge "bottlenecks offiline support"
Diffstat (limited to 'utils/infra_setup')
-rw-r--r--utils/infra_setup/heat/manager.py2
-rw-r--r--utils/infra_setup/runner/docker_env.py2
-rw-r--r--utils/infra_setup/runner/yardstick.py15
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