Handle subprocess issues with yoda and system openstacksdk

So, when you pip install openstacksdk you all install some of the
workflows for the openstack * commands, this means when you create
a virtualenv with no system site packages commands like openstack
node import don't work the same way and worse we're not testing
the same stuff we ship.

on the other hand the system version of openstacksdk often isn't
sutible for the api call functionality yoda uses, so we need to
be sure the command line functionality of yoda goes through the
system opesntack client path whereas the api monitoring functions
go through openstack sdk, to make this even more complex the
subprocess function of python insists on not behaving like a normal
shell.

This prefixes all bommands with env -i bash -c "command" which runs
bash with no way to inherit vars (like the python venv) from Browbeat
itself which can then safely rely on the openstacksdk in it's venv

Change-Id: I4da896ea793f44ecff8fa0caa82255259447facc
This commit is contained in:
jkilpatr 2017-07-26 09:39:18 -04:00
parent 9dd8fca764
commit 2dd7fe17d1
5 changed files with 9 additions and 30 deletions

View File

@ -19,7 +19,6 @@
- perfkitbenchmarker
- rally
- shaker
- yoda
- flavors
- images
environment: "{{proxy_env}}"

View File

@ -1,18 +0,0 @@
---
#
# YODA Install
#
- name: Create yoda virtualenv
command: virtualenv {{ yoda_venv }} creates={{ yoda_venv }}
- name: Install yoda requirements
pip: name={{item}} virtualenv={{yoda_venv}}
with_items:
- openstacksdk
- python-heatclient
- python-tripleoclient
- elasticsearch
- pykwalify
- python-dateutil
- git+https://github.com/jkilpatr/ostag/#egg=ostag

View File

@ -78,7 +78,6 @@
roles:
- browbeat/common
- browbeat/browbeat
- browbeat/yoda
- browbeat/template-configs
- browbeat/statsd-ironic

View File

@ -50,14 +50,14 @@ yoda:
type: introspection
enabled: true
method: individual
times: 10
times: 3
timeout: 1800
batch_size: 5
- name: introspect-{{ overcloud_size }}-bulk
type: introspection
enabled: true
method: bulk
times: 10
times: 3
timeout: 1800
- name: No-HA-Max-Compute-{{ overcloud_size }}-full-deploy
type: overcloud
@ -68,7 +68,7 @@ yoda:
enabled: true
step: 5
keep_stack: false
times: 2
times: 1
cloud:
- node: "compute"
start_scale: 1
@ -86,7 +86,7 @@ yoda:
enabled: true
step: 5
keep_stack: true
times: 2
times: 1
cloud:
- node: "compute"
start_scale: 1

View File

@ -164,7 +164,7 @@ class Yoda(WorkloadBase.WorkloadBase):
for node in nodes:
cmd = cmd_base.format(env_setup, node)
self.tools.run_async_cmd(cmd)
self.tools.run_async_cmd(cmd + "\"")
time.sleep(.5)
# Gathers metrics on the instack env import
@ -174,7 +174,7 @@ class Yoda(WorkloadBase.WorkloadBase):
cmd = "{} openstack overcloud node import {}".format(env_setup, filepath)
start_time = datetime.datetime.utcnow()
out = self.tools.run_cmd(cmd)
out = self.tools.run_cmd(cmd + "\"")
nodes = conn.bare_metal.nodes()
for node in nodes:
@ -210,7 +210,7 @@ class Yoda(WorkloadBase.WorkloadBase):
results['nodes'][node.id]["failures"] = 0
results['nodes'][node.id]["state_list"] = None
self.tools.run_async_cmd(cmd)
self.tools.run_async_cmd(cmd + "\"")
out = self.watch_introspecting_nodes(nodes, timeout, conn, results)
@ -381,7 +381,7 @@ class Yoda(WorkloadBase.WorkloadBase):
self.logger.debug("Openstack deployment command is " + cmd)
results["overcloud_deploy_command"] = cmd
deploy_process = self.tools.run_async_cmd(cmd)
deploy_process = self.tools.run_async_cmd(cmd + "\"")
results['cleaning_failures'] = self.failed_cleaning_count(conn)
results['nodes'] = {}
@ -608,8 +608,7 @@ class Yoda(WorkloadBase.WorkloadBase):
self.logger.debug("Time Stamp (Prefix): {}".format(dir_ts))
stackrc = self.config.get('yoda')['stackrc']
# venv = self.config.get('yoda')['venv']
env_setup = "source {};".format(stackrc)
env_setup = "env -i bash -c \"source {}; ".format(stackrc)
auth_vars = self.tools.load_stackrc(stackrc)
if 'OS_AUTH_URL' not in auth_vars: