Skip to content

Commit

Permalink
Revert making log and results directory
Browse files Browse the repository at this point in the history
Reverting Commit: 2ba6da9

This needed much more testing before merging, my bad.
I strongly suggest we don't add this functionality
in a seperate commit again, it doesn't make sense
to reorg and test all of this and then the pip commit
right after. Just add it's functionality there.

Change-Id: Iee7aa439fbc077c3c71f67b625b67fc55a86f199
  • Loading branch information
jkilpatr committed Jan 26, 2017
1 parent ef04480 commit 33f30eb
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 45 deletions.
3 changes: 0 additions & 3 deletions ansible/oooq/roles/pre-install-setup/tasks/main.yml
Expand Up @@ -44,6 +44,3 @@
- name: Install Ansible
pip: name=ansible state=present
become: true

- name: Make results directory
file: "path={{ ansible_env.HOME }}/browbeat/results state=directory"
@@ -1,8 +1,7 @@
browbeat:
results : "$HOME/browbeat/results"
results : results/
rerun: 3
cloud_name: {{ browbeat_cloud_name }}
log : "$HOME/browbeat/log"
elasticsearch:
enabled: {{ elastic_enabled_template }}
host: {{ elastic_host_template }}
Expand Down
@@ -1,10 +1,9 @@
# Tests to be compleated for the install-and-check.sh script minimal and short workloads are performed
# to confirm functionality.
browbeat:
results : "$HOME/browbeat/results"
results : results/
rerun: 1
cloud_name: {{ browbeat_cloud_name }}
log : "$HOME/browbeat/log"
elasticsearch:
enabled: {{ elastic_enabled_template }}
host: {{ elastic_host_template }}
Expand Down
3 changes: 1 addition & 2 deletions browbeat-complete.yaml
@@ -1,9 +1,8 @@
# Complete set of Stress Tests, this can take a long time (day(s))
browbeat:
results : "$HOME/.browbeat/results/"
results : results/
rerun: 3
cloud_name: openstack
log : "$HOME/.browbeat/log/"
elasticsearch:
enabled: false
host: 1.1.1.1
Expand Down
3 changes: 1 addition & 2 deletions browbeat-config.yaml
@@ -1,9 +1,8 @@
# Basic set of initial stress tests to test overcloud before running complete set of benchmarks.
browbeat:
results : "$HOME/.browbeat/results"
results : results/
rerun: 1
cloud_name: openstack
log: "$HOME/.browbeat/log"
elasticsearch:
enabled: true
host: 1.1.1.1
Expand Down
18 changes: 6 additions & 12 deletions browbeat.py
Expand Up @@ -26,10 +26,10 @@

_workload_opts = ['perfkit', 'rally', 'shaker']
_config_file = 'browbeat-config.yaml'
debug_log_file = 'log/debug.log'

def main():
tools = lib.Tools.Tools()

parser = argparse.ArgumentParser(
description="Browbeat Performance and Scale testing for Openstack")
parser.add_argument(
Expand All @@ -47,14 +47,7 @@ def main():
_logger.setLevel(logging.DEBUG)
_formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)7s - %(message)s')
_formatter.converter = time.gmtime

# Load Browbeat yaml config file:
_config = tools._load_config(_cli_args.setup)
debug_log_path = tools.sub_env_vars(_config['browbeat']['log'])
# create log dir during run time
if not os.path.exists(debug_log_path):
os.makedirs(debug_log_path)
_dbg_file = logging.FileHandler(os.path.join(debug_log_path, 'debug.log'))
_dbg_file = logging.FileHandler(debug_log_file)
_dbg_file.setLevel(logging.DEBUG)
_dbg_file.setFormatter(_formatter)
_ch = logging.StreamHandler()
Expand All @@ -68,6 +61,9 @@ def main():

_logger.debug("CLI Args: {}".format(_cli_args))

# Load Browbeat yaml config file:
_config = tools._load_config(_cli_args.setup)

# Default to all workloads
if _cli_args.workloads == []:
_cli_args.workloads.append('all')
Expand Down Expand Up @@ -106,10 +102,8 @@ def main():
_cli_args.setup))
else:
_logger.error("{} is missing in {}".format(wkld_provider, _cli_args.setup))
result_dir = tools.sub_env_vars(_config['browbeat']['results'])
result_dir = _config['browbeat']['results']
lib.WorkloadBase.WorkloadBase.print_report(result_dir, time_stamp)
if not os.path.exists(result_dir):
os.makedirs(result_dir)
_logger.info("Saved browbeat result summary to {}".format(
os.path.join(result_dir,time_stamp + '.' + 'report')))
lib.WorkloadBase.WorkloadBase.print_summary()
Expand Down
3 changes: 1 addition & 2 deletions ci-scripts/config/browbeat-ci.yaml
@@ -1,10 +1,9 @@
# Tests to be compleated for the install-and-check.sh script minimal and short workloads are performed
# to confirm functionality.
browbeat:
results : "$HOME/.browbeat/results"
results : results/
rerun: 1
cloud_name: openstack
log: "$HOME/.browbeat/log"
elasticsearch:
enabled: false
host: 1.1.1.1
Expand Down
17 changes: 0 additions & 17 deletions lib/Tools.py
Expand Up @@ -126,20 +126,3 @@ def gather_metadata(self):
else:
self.logger.info("Metadata about cloud has been gathered")
return True

# Takes a string with $FOO and returns a string
# with those variables replaced with their env paths.
def sub_env_vars(self, path):
path_list = path.split('/')
new_path = []
for item in path_list:
if item.startswith('$'):
var = item.translate(None, '$')
replacement = os.environ[var]
if replacement is None:
new_path.extend(item + "/")
else:
new_path.extend(replacement + "/")
else:
new_path.extend(item + "/")
return ''.join(new_path)
3 changes: 0 additions & 3 deletions lib/validate.yaml
Expand Up @@ -15,9 +15,6 @@ mapping:
cloud_name:
type: str
required: True
log:
type: str
required: True

elasticsearch:
required: True
Expand Down
4 changes: 4 additions & 0 deletions log/.gitignore
@@ -0,0 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore
4 changes: 4 additions & 0 deletions results/.gitignore
@@ -0,0 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore

0 comments on commit 33f30eb

Please sign in to comment.