diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..99482b1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,5 @@ +FROM kennethreitz/pipenv + +COPY . /app + +CMD python3 mainCLI.py diff --git a/README.md b/README.md index 49b0466..002d778 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,9 @@ SPECtate is a configuration tool that interfaces with the benchmarking software These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See usage for notes on how to use the project on a live system. +There's a pre-packaged binary for quick, out-of-the box setup without **any dependencies**! +Check out the [releases](https://github.com/PDXCapstoneF/SPECtate/releases) for binaries for the main CLI application. + ### Prerequisites * UNIX (Linux, Mac OSX), or Windows @@ -45,6 +48,21 @@ pipenv install ``` +#### Docker + +This project has a Docker file. You can build an image +yourself and run SPECtate with it: + +```shell +# build the image +docker build -t SPECtate:latest . +# run SPECtate +docker run SPECtate:latest --help +# would display the help text like you ran it yourself +# with python mainCLI.py --help +``` + + ## Example CLI Usage * Run an example configuration: diff --git a/dialogue.py b/dialogue.py index b10b1d6..809bdf4 100644 --- a/dialogue.py +++ b/dialogue.py @@ -19,14 +19,15 @@ TEMPLATE_DEFAULT = 'prop_options' TYPE_CHECK_FUNC = { - 'string' : lambda x : str(x), - 'int' : lambda x : int(x), - 'integer' : lambda x : int(x), - 'float' : lambda x : float(x), - 'bool' : lambda x : x not in set(['false', 'False']), - 'boolean' : lambda x : x not in set(['false', 'False']), + 'string': lambda x: str(x), + 'int': lambda x: int(x), + 'integer': lambda x: int(x), + 'float': lambda x: float(x), + 'bool': lambda x: x not in set(['false', 'False']), + 'boolean': lambda x: x not in set(['false', 'False']), } + def write_json(filename, python_dict): """ Serialize python_dict (dictionary) to filename (text file). @@ -45,35 +46,43 @@ def read_json(filename): with open(filename) as f: return json.load(f) + def print_dict(d): for key, value in sorted(d.items(), key=lambda x: x[0]): print("{}: {}".format(key, value)) + # Level-one layer of dialogue. # All functions take run_dict, template_dict as arguments so that they can be # called homogenously from a dictionary in `dialogue`. + def tag_in_runlist(tag, run_list): """ Returns True if a Run with tag `tag` is in the list. """ - return any(map(lambda run : run[TAG_ARG] == tag, run_list)) + return any(map(lambda run: run[TAG_ARG] == tag, run_list)) + def find(f, seq): """ Return first item in sequence where f(item) == True. """ for item in seq: - if f(item): + if f(item): return item + + def find_run_tag(tag, run_list): - return find(lambda run : run[TAG_ARG] == tag, run_list) + return find(lambda run: run[TAG_ARG] == tag, run_list) + # Level-one layer of dialogue. All functions take run_dict, template_dict as # arguments so that they can be called homogeneously from a dictionary in # `dialogue`. All functions must, in turn, *return* a tuple (run_dict, # template_dict) as arguments. + def print_all_runs(run_list, template_dict): """ Prints all runs in the RunList. Note that it gets the argument order from @@ -87,11 +96,12 @@ def print_all_runs(run_list, template_dict): print() return (run_list, template_dict) + def create_run(run_list, template_dict): new_run = {} # Inputting run type. - print('Input the template type. Current options: {}'.format( - ' '.join(sorted(template_dict.keys())))) + print('Input the template type. Current options: {}'.format(' '.join( + sorted(template_dict.keys())))) template_type = input('-> ') if template_type not in template_dict.keys(): user_input = input('{} is not currently an option. Add it? '\ @@ -121,12 +131,12 @@ def create_run(run_list, template_dict): return (run_list, template_dict) elif user_input in HELP_CONSTS: print('Annotation:\n{}\nType:\n{}\n'.format( - template_dict[template_type]['annotations'][arg], - template_dict[template_type]['types'][arg])) - else: + template_dict[template_type]['annotations'][arg], + template_dict[template_type]['types'][arg])) + else: try: - type_func = TYPE_CHECK_FUNC[ - template_dict[template_type][TEMPLATE_TYPES][arg]] + type_func = TYPE_CHECK_FUNC[template_dict[template_type] + [TEMPLATE_TYPES][arg]] user_input = type_func(user_input) new_run[RUNLIST_ARGS][arg] = user_input break @@ -142,9 +152,10 @@ def create_run(run_list, template_dict): else: if input('Discard new run {}? '.format(new_tag)) in YES_CONSTS: return run_list, template_dict - + return run_list, template_dict + def create_template(run_list, template_dict): new_template = {} new_template[TEMPLATE_ARGS] = [] @@ -183,9 +194,8 @@ def create_template(run_list, template_dict): 'Blank input skips this step. ') if new_arg_trans in EXIT_CONSTS: break - - print('Current argument:\n', - 'Arg: {}\n'.format(new_arg), + + print('Current argument:\n', 'Arg: {}\n'.format(new_arg), 'Type: {}\n'.format(new_arg_type), 'Annotation: {}\n'.format(new_arg_annotation), 'Translation: {}'.format(new_arg_trans)) @@ -196,7 +206,7 @@ def create_template(run_list, template_dict): new_template[TEMPLATE_TYPES][new_arg] = new_arg_type if new_arg_trans: new_template[TEMPLATE_TRANS][new_arg] = new_arg_trans - + # Default props. while True: default_property = input('Input a default property. Blank or \'exit\' '\ @@ -220,14 +230,13 @@ def create_template(run_list, template_dict): return run_list, template_dict + def delete_run(run_list, template_dict): print('Input the tag of the Run that you want to delete. Available tags') - print('are {}'.format( - ' '.join(run[TAG_ARG] for run in run_list))) + print('are {}'.format(' '.join(run[TAG_ARG] for run in run_list))) delete_tag = input('-> ') - new_run_list = [run for run in run_list - if run[TAG_ARG] != delete_tag] + new_run_list = [run for run in run_list if run[TAG_ARG] != delete_tag] if len(run_list) == len(new_run_list): print('Tag {} does not exist.'.format(delete_tag)) else: @@ -239,15 +248,15 @@ def delete_run(run_list, template_dict): print('Deletion of tag {} cancelled.'.format(delete_tag)) return run_list, template_dict + def copy_run(run_list, template_dict): print('Input the tag of the Run that you want to copy. Available tags') - print('are {}'.format( - ' '.join(run[TAG_ARG] for run in run_list))) + print('are {}'.format(' '.join(run[TAG_ARG] for run in run_list))) old_run_tag = input('-> ') if old_run_tag in EXIT_CONSTS: return run_list, template_dict - + old_run = find_run_tag(old_run_tag, run_list) if not old_run: print('Tag {} not found.'.format(old_run_tag)) @@ -266,7 +275,7 @@ def copy_run(run_list, template_dict): else: new_run[TAG_ARG] = new_run_tag break - + if input('Add run {} to RunList? '.format(new_run_tag)) in YES_CONSTS: print('Added run {} to RunList.'.format(new_run_tag)) run_list.append(new_run) @@ -274,6 +283,7 @@ def copy_run(run_list, template_dict): print('Run {} not copied.'.format(old_run_tag)) return run_list, template_dict + def edit_run(run_list, template_dict): edit_tag = input('Input the tag of the Run you want to edit. ') @@ -315,7 +325,7 @@ def edit_run(run_list, template_dict): except: print('Invalid input.') - + if input('Are you sure you want to change run {}? '\ .format(old_run[TAG_ARG])) in YES_CONSTS: # Find the index of old_run and create a new list with new_run in its @@ -323,13 +333,14 @@ def edit_run(run_list, template_dict): for index, run in enumerate(run_list): if run == old_run: print('Run {} changed.'.format(old_run[TAG_ARG])) - return (run_list[:index] + [new_run] + run_list[index+1:], + return (run_list[:index] + [new_run] + run_list[index + 1:], template_dict) print('Something terribly wrong has happened. Cancelled.') else: print('Edit of Run {} cancelled.'.format(old_run[TAG_ARG])) return run_list, template_dict + def delete_template(run_list, template_dict): delete_tag = input('Enter the tag of the template you want to delete. ') if delete_tag not in template_dict.keys(): @@ -343,6 +354,7 @@ def delete_template(run_list, template_dict): print('Deletion of Template {} cancelled.'.format(delete_tag)) return run_list, template_dict + def save_tate(run_list, template_dict): filename = input('Input a filename to save the TateConfig to. ') if not filename or filename in EXIT_CONSTS: @@ -351,12 +363,16 @@ def save_tate(run_list, template_dict): if input('Are you sure you want to save to {}? '.format(filename))\ in YES_CONSTS: try: - write_json(filename, {RUN_LIST : run_list, TEMPLATE_DATA : template_dict}) + write_json(filename, { + RUN_LIST: run_list, + TEMPLATE_DATA: template_dict + }) print('Saved TateConfig to {}'.format(filename)) except: print('Unable to save to {}.'.format(filename)) return run_list, template_dict + def load_tate(run_list, template_dict): filename = input('Input a filename to load the TateConfig from. ') if not filename or filename in EXIT_CONSTS: @@ -372,6 +388,7 @@ def load_tate(run_list, template_dict): print('Unable to load filename {}'.format(filename)) return run_list, template_dict + def reorder_run(run_list, template_dict): print('Select an index to reorder.') for index, run in enumerate(run_list): @@ -399,9 +416,8 @@ def reorder_run(run_list, template_dict): except: print('Invalid index.') return run_list, template_dict - + print('Reorder canceled.') - def error(run_dict, template_dict): @@ -423,29 +439,29 @@ def dialogue(): json_filename = default_json function_dict = { - 'print all' : print_all_runs, - 'create run' : create_run, - 'create template' : create_template, - 'delete run' : delete_run, - 'delete template' : delete_template, - 'copy run' : copy_run, - 'edit run' : edit_run, - 'save tate' : save_tate, - 'load tate' : load_tate, - 'reorder run' : reorder_run, + 'print all': print_all_runs, + 'create run': create_run, + 'create template': create_template, + 'delete run': delete_run, + 'delete template': delete_template, + 'copy run': copy_run, + 'edit run': edit_run, + 'save tate': save_tate, + 'load tate': load_tate, + 'reorder run': reorder_run, } option_description_dict = { - 'print all' : 'Print all runs', - 'create run' : 'Create a run', - 'create template' : 'Create a template', - 'delete run' : 'Delete a run', - 'delete template' : 'Delete a template', - 'copy run' : 'Copy a run', - 'edit run' : 'Edit a run', - 'save tate' : 'Save TateConfig', - 'load tate' : 'Load TateConfig', - 'reorder run' : 'Reorder a run', + 'print all': 'Print all runs', + 'create run': 'Create a run', + 'create template': 'Create a template', + 'delete run': 'Delete a run', + 'delete template': 'Delete a template', + 'copy run': 'Copy a run', + 'edit run': 'Edit a run', + 'save tate': 'Save TateConfig', + 'load tate': 'Load TateConfig', + 'reorder run': 'Reorder a run', } try: @@ -472,7 +488,6 @@ def dialogue(): if user_input.lower() in HELP_CONSTS: continue elif user_input.lower() not in EXIT_CONSTS: - run_list, template_dict = function_dict.get(user_input, error)(run_list, template_dict) + run_list, template_dict = function_dict.get(user_input, error)( + run_list, template_dict) print('Exiting.') - - diff --git a/docs/gifs/CLI-Run.gif b/docs/gifs/CLI-Run.gif new file mode 100644 index 0000000..25a4d85 Binary files /dev/null and b/docs/gifs/CLI-Run.gif differ diff --git a/docs/gifs/CLI-copy, rename, delete.gif b/docs/gifs/CLI-copy, rename, delete.gif new file mode 100644 index 0000000..41b5063 Binary files /dev/null and b/docs/gifs/CLI-copy, rename, delete.gif differ diff --git a/docs/gifs/CLI-create run from template.gif b/docs/gifs/CLI-create run from template.gif new file mode 100644 index 0000000..ff2a812 Binary files /dev/null and b/docs/gifs/CLI-create run from template.gif differ diff --git a/docs/gifs/CLI-create template.gif b/docs/gifs/CLI-create template.gif new file mode 100644 index 0000000..4b99d8a Binary files /dev/null and b/docs/gifs/CLI-create template.gif differ diff --git a/docs/gifs/CLI-load config.gif b/docs/gifs/CLI-load config.gif new file mode 100644 index 0000000..2839a01 Binary files /dev/null and b/docs/gifs/CLI-load config.gif differ diff --git a/docs/gifs/GUI-Run (All).gif b/docs/gifs/GUI-Run (All).gif new file mode 100644 index 0000000..1f3dd5b Binary files /dev/null and b/docs/gifs/GUI-Run (All).gif differ diff --git a/docs/gifs/GUI-Run (Single).gif b/docs/gifs/GUI-Run (Single).gif new file mode 100644 index 0000000..a0fb92c Binary files /dev/null and b/docs/gifs/GUI-Run (Single).gif differ diff --git a/docs/gifs/GUI-copy, rename, delete.gif b/docs/gifs/GUI-copy, rename, delete.gif new file mode 100644 index 0000000..70a47d6 Binary files /dev/null and b/docs/gifs/GUI-copy, rename, delete.gif differ diff --git a/docs/gifs/GUI-create run from template.gif b/docs/gifs/GUI-create run from template.gif new file mode 100644 index 0000000..0f26459 Binary files /dev/null and b/docs/gifs/GUI-create run from template.gif differ diff --git a/docs/gifs/GUI-create template.gif b/docs/gifs/GUI-create template.gif new file mode 100644 index 0000000..be73ad8 Binary files /dev/null and b/docs/gifs/GUI-create template.gif differ diff --git a/docs/gifs/GUI-load JAR.gif b/docs/gifs/GUI-load JAR.gif new file mode 100644 index 0000000..15be18b Binary files /dev/null and b/docs/gifs/GUI-load JAR.gif differ diff --git a/docs/gifs/GUI-load config.gif b/docs/gifs/GUI-load config.gif new file mode 100644 index 0000000..842e02f Binary files /dev/null and b/docs/gifs/GUI-load config.gif differ diff --git a/docs/index.md b/docs/index.md deleted file mode 120000 index 32d46ee..0000000 --- a/docs/index.md +++ /dev/null @@ -1 +0,0 @@ -../README.md \ No newline at end of file diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..002d778 --- /dev/null +++ b/docs/index.md @@ -0,0 +1,113 @@ +| Service | Master | Development | +| ------------- |:-------------:| ------------------:| +| CI Status | [![Build Status](https://travis-ci.org/PDXCapstoneF/SPECtate.svg?branch=master)](https://travis-ci.org/PDXCapstoneF/SPECtate) | [![Build Status](https://travis-ci.org/PDXCapstoneF/SPECtate.svg?branch=dev)](https://travis-ci.org/PDXCapstoneF/SPECtate) | +| Documentation Status | [![Documentation Status](https://readthedocs.org/projects/spectate/badge/?version=latest)](https://spectate.readthedocs.io/en/latest/?badge=latest) | [![Documentation Status](https://readthedocs.org/projects/spectate/badge/?version=dev)](https://spectate.readthedocs.io/en/latest/?badge=dev) | + +# SPECtate + +SPECtate is a configuration tool that interfaces with the benchmarking software [SPECjbb®2015](https://www.spec.org/jbb2015/). SPECtate is designed to to be a more user-friendly alternative for configuring and invoking the SPECjbb®2015 benchmarking software, providing: + +**Interfaces:** +* a graphical-user-interface (GUI) +* a command-line-interface (CLI) + +**Configuration:** +* processes human-readable configuration files (HJSON, JSON, YAML) + +**Invocation:** +* a python-equivalent of SPECjbb®2015's `run.sh` file + + +## Getting Started + +These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See usage for notes on how to use the project on a live system. + +There's a pre-packaged binary for quick, out-of-the box setup without **any dependencies**! +Check out the [releases](https://github.com/PDXCapstoneF/SPECtate/releases) for binaries for the main CLI application. + +### Prerequisites + +* UNIX (Linux, Mac OSX), or Windows +* [python](https://www.python.org/downloads/) >= 3.6 +* [SPECjbb®2015](https://www.spec.org/order.html) + + +### Setup + +```shell +git clone https://github.com/PDXCapstoneF/SPECtate.git +cd SPECtate/ +python -m unittest discover -s . +``` + +This project uses `pipenv` to manage dependencies. To start: + +``` +pipenv shell +pipenv install +``` + + +#### Docker + +This project has a Docker file. You can build an image +yourself and run SPECtate with it: + +```shell +# build the image +docker build -t SPECtate:latest . +# run SPECtate +docker run SPECtate:latest --help +# would display the help text like you ran it yourself +# with python mainCLI.py --help +``` + + +## Example CLI Usage + +* Run an example configuration: +``` +python mainCLI.py run example_config.json +``` + +* See what an example configuration might do: +``` +python mainCLI.py run --dry-run example_config.json +``` + +* Generate configurations: +``` +# generate you own configuration via the cli in dialogue: +python mainCLI.py dialogue +# or through the ncurses equivalent cli: +python speccurses.py +``` + + +## Documentation + +* SPECtate documentation can be found in [`docs/`](docs/) page and in the Python scripts themselves. Documentation of SPECtate can be generated by using Python's standard library [pydoc](https://docs.python.org/2/library/pydoc.html). + +Example: + +``` +cd SPECtate/ +pydoc -w dialogue; open dialogue.html +``` + +The `-w` flag in the above command will "Write out the HTML documentation for a module to a file in the current directory." + +## Testing + +* Unittests + +* [Travis-CI](https://travis-ci.org/PDXCapstoneF/SPECtate) for Continuous integration testing during development + + +## License + +This project is licensed under the MIT License - see the [LICENSE](https://github.com/PDXCapstoneF/SPECtate/blob/dev/README.md) file for details. + +## Contact + +* [Andrew Waugh](mailto:ZonrZero@gmail.com) (Product Owner) diff --git a/example_config.json b/example_config.json index 2ba7294..ffffb7b 100644 --- a/example_config.json +++ b/example_config.json @@ -1,144 +1,145 @@ { - "TemplateData": { - "HBIR": { - "args": [ - "Kit Version", - "JDK", - "RTSTART", - "JVM Options", - "NUMA Nodes", - "Data Collection", - "T1", - "T2", - "T3" - ], - "annotations" : { - "Kit Version" : "Version of SpecJBB", - "JDK" : "Version of the JVM that will run SpecJBB", - "RTSTART" : "What percentage of total output will we start at", - "JVM Options" : "What additional arguments, if any, will be passed to the JVM", - "NUMA Nodes" : "How many NUMA nodes will SpecJBB use", - "Data Collection" : "What data collection process will monitor while running SpecJBB", - "T1" : "How many threads does Tier 1 have access to", - "T2" : "How many threads does Tier 2 have access to", - "T3" : "How many threads does Tier 3 have access to" - }, - "prop_options": { - "specjbb.controller.type": "HBIR", - "specjbb.time.server": false, - "specjbb.comm.connect.client.pool.size": 192, - "specjbb.comm.connect.selector.runner.count": 4, - "specjbb.comm.connect.timeouts.connect": 650000, - "specjbb.comm.connect.timeouts.read": 650000, - "specjbb.comm.connect.timeouts.write": 650000, - "specjbb.comm.connect.worker.pool.max": 320, - "specjbb.mapreducer.pool.size": 27 - }, - "types": { - "Kit Version": "string", - "JDK": "string", - "RTSTART": "integer", - "JVM Options": "string", - "NUMA Nodes": "integer", - "Data Collection": "string", - "T1": "integer", - "T2": "integer", - "T3": "integer" - }, - "translations": { - "RTSTART": "specjbb.controller.rtcurve.start", - "T1": "specjbb.forkjoin.workers.Tier1", - "T2": "specjbb.forkjoin.workers.Tier2", - "T3": "specjbb.forkjoin.workers.Tier3", - "NUMA Nodes": "specjbb.group.count" - } - }, - "HBIR_RT": { - "args": [ - "Kit Version", - "JDK", - "RTSTART", - "JVM Options", - "NUMA Nodes", - "Data Collection", - "T1", - "T2", - "T3" - ], - "annotations" : { - "Kit Version" : "Version of SpecJBB", - "JDK" : "Version of the JVM that will run SpecJBB", - "RTSTART" : "What percentage of total output will we start at", - "JVM Options" : "What additional arguments, if any, will be passed to the JVM", - "NUMA Nodes" : "How many NUMA nodes will SpecJBB use", - "Data Collection" : "What data collection process will monitor while running SpecJBB", - "T1" : "How many threads does Tier 1 have access to", - "T2" : "How many threads does Tier 2 have access to", - "T3" : "How many threads does Tier 3 have access to" - }, - "prop_options": { - "specjbb.controller.type": "HBIR_RT", - "specjbb.time.server": false, - "specjbb.comm.connect.client.pool.size": 192, - "specjbb.comm.connect.selector.runner.count": 4, - "specjbb.comm.connect.timeouts.connect": 650000, - "specjbb.comm.connect.timeouts.read": 650000, - "specjbb.comm.connect.timeouts.write": 650000, - "specjbb.comm.connect.worker.pool.max": 320, - "specjbb.customerDriver.threads": 64, - "specjbb.customerDriver.threads.saturate": 144, - "specjbb.customerDriver.threads.probe": 96, - "specjbb.mapreducer.pool.size": 27 - }, - "types": { - "Kit Version": "string", - "JDK": "string", - "RTSTART": "integer", - "JVM Options": "string", - "NUMA Nodes": "integer", - "Data Collection": "string", - "T1": "integer", - "T2": "integer", - "T3": "integer" - }, - "translations": { - "RTSTART": "specjbb.controller.rtcurve.start", - "T1": "specjbb.forkjoin.workers.Tier1", - "T2": "specjbb.forkjoin.workers.Tier2", - "T3": "specjbb.forkjoin.workers.Tier3", - "NUMA Nodes": "specjbb.group.count" - } - } - }, - "RunList": [{ - "template_type": "HBIR", - "tag": "TAG", - "args": { - "Kit Version": "15", - "JDK": 7, - "RTSTART": "4", - "JVM Options": "options -x -y", - "NUMA Nodes": "2", - "Data Collection": "TRUE", - "T1": 1, - "T2": 2, - "T3": 3 - } - }, - { - "template_type": "HBIR_RT", - "tag" : "specjbb", - "args": { - "Kit Version": "RC3", - "RTSTART" : 30, - "JDK": "jdk.8-u121", - "JVM Options": "-Xms29g -Xmx29g -Xmn27g -XX:ParallelGCThreads=48", - "NUMA Nodes": 4, - "Data Collection": "NONE", - "T1" : 154, - "T2" : 45, - "T3" : 23 - } - } - ] + "TemplateData": { + "HBIR": { + "args": [ + "Kit Version", + "JDK", + "RTSTART", + "JVM Options", + "NUMA Nodes", + "Data Collection", + "T1", + "T2", + "T3" + ], + "annotations": { + "Kit Version": "Version of SpecJBB", + "JDK": "Version of the JVM that will run SpecJBB", + "RTSTART": "What percentage of total output will we start at", + "JVM Options": "What additional arguments, if any, will be passed to the JVM", + "NUMA Nodes": "How many NUMA nodes will SpecJBB use", + "Data Collection": "What data collection process will monitor while running SpecJBB", + "T1": "How many threads does Tier 1 have access to", + "T2": "How many threads does Tier 2 have access to", + "T3": "How many threads does Tier 3 have access to" + }, + "prop_options": { + "specjbb.controller.type": "HBIR", + "specjbb.time.server": false, + "specjbb.comm.connect.client.pool.size": 192, + "specjbb.comm.connect.selector.runner.count": 4, + "specjbb.comm.connect.timeouts.connect": 650000, + "specjbb.comm.connect.timeouts.read": 650000, + "specjbb.comm.connect.timeouts.write": 650000, + "specjbb.comm.connect.worker.pool.max": 320, + "specjbb.mapreducer.pool.size": 27 + }, + "types": { + "Kit Version": "string", + "JDK": "string", + "RTSTART": "integer", + "JVM Options": "string", + "NUMA Nodes": "integer", + "Data Collection": "string", + "T1": "integer", + "T2": "integer", + "T3": "integer" + }, + "translations": { + "RTSTART": "specjbb.controller.rtcurve.start", + "T1": "specjbb.forkjoin.workers.Tier1", + "T2": "specjbb.forkjoin.workers.Tier2", + "T3": "specjbb.forkjoin.workers.Tier3", + "NUMA Nodes": "specjbb.group.count" + } + }, + "HBIR_RT": { + "args": [ + "Kit Version", + "JDK", + "RTSTART", + "JVM Options", + "NUMA Nodes", + "Data Collection", + "T1", + "T2", + "T3" + ], + "annotations": { + "Kit Version": "Version of SpecJBB", + "JDK": "Version of the JVM that will run SpecJBB", + "RTSTART": "What percentage of total output will we start at", + "JVM Options": "What additional arguments, if any, will be passed to the JVM", + "NUMA Nodes": "How many NUMA nodes will SpecJBB use", + "Data Collection": "What data collection process will monitor while running SpecJBB", + "T1": "How many threads does Tier 1 have access to", + "T2": "How many threads does Tier 2 have access to", + "T3": "How many threads does Tier 3 have access to" + }, + "prop_options": { + "specjbb.controller.type": "HBIR_RT", + "specjbb.time.server": false, + "specjbb.comm.connect.client.pool.size": 192, + "specjbb.comm.connect.selector.runner.count": 4, + "specjbb.comm.connect.timeouts.connect": 650000, + "specjbb.comm.connect.timeouts.read": 650000, + "specjbb.comm.connect.timeouts.write": 650000, + "specjbb.comm.connect.worker.pool.max": 320, + "specjbb.customerDriver.threads": 64, + "specjbb.customerDriver.threads.saturate": 144, + "specjbb.customerDriver.threads.probe": 96, + "specjbb.mapreducer.pool.size": 27 + }, + "types": { + "Kit Version": "string", + "JDK": "string", + "RTSTART": "integer", + "JVM Options": "string", + "NUMA Nodes": "integer", + "Data Collection": "string", + "T1": "integer", + "T2": "integer", + "T3": "integer" + }, + "translations": { + "RTSTART": "specjbb.controller.rtcurve.start", + "T1": "specjbb.forkjoin.workers.Tier1", + "T2": "specjbb.forkjoin.workers.Tier2", + "T3": "specjbb.forkjoin.workers.Tier3", + "NUMA Nodes": "specjbb.group.count" + } + } + }, + "RunList": [ + { + "template_type": "HBIR", + "tag": "TAG", + "args": { + "Kit Version": "15", + "JDK": 7, + "RTSTART": "4", + "JVM Options": "options -x -y", + "NUMA Nodes": "2", + "Data Collection": "TRUE", + "T1": 1, + "T2": 2, + "T3": 3 + } + }, + { + "template_type": "HBIR_RT", + "tag": "specjbb", + "args": { + "Kit Version": "RC3", + "RTSTART": 30, + "JDK": "jdk.8-u121", + "JVM Options": "-Xms29g -Xmx29g -Xmn27g -XX:ParallelGCThreads=48", + "NUMA Nodes": 4, + "Data Collection": "NONE", + "T1": 154, + "T2": 45, + "T3": 23 + } + } + ] } diff --git a/examples/example_basic_config.json b/examples/example_basic_config.json index 7aa18f2..35fef6a 100644 --- a/examples/example_basic_config.json +++ b/examples/example_basic_config.json @@ -1,20 +1,19 @@ { - "TemplateData": { - "MyTemplate": { - "args": [ - "Host", - "Port" - ] - - } - }, - "RunList": [ - { - "template_type": "MyTemplate", - "args": { - "Host": "localhost", - "Port": 24000 - } - } - ] + "TemplateData": { + "MyTemplate": { + "args": [ + "Host", + "Port" + ] + } + }, + "RunList": [ + { + "template_type": "MyTemplate", + "args": { + "Host": "localhost", + "Port": 24000 + } + } + ] } diff --git a/examples/example_config.json b/examples/example_config.json index 76a56b6..802492e 100644 --- a/examples/example_config.json +++ b/examples/example_config.json @@ -1,53 +1,48 @@ { - "TemplateData": { - "HBIR": { - "args": [ - "arg1", - "arg2" - ] - - }, - "HBIR BUT BETTER": { - "args": [ - "arg1", - "arg2", - "arg3" - ] - - }, - "LOADLEVELS BUT NOT": { - "args": [ - "foo", - "bar", - "baz" - ] - - - } - }, - "RunList": [ - { - "template_type": "HBIR BUT BETTER", - "args": { - "arg1": "value 1", - "arg2": "value 1", - "arg3": "value 1" - } - }, - { - "template_type": "HBIR", - "args": { - "arg1": 4, - "arg2": false - } - - }, - { - "template_type": "HBIR", - "args": { - "arg1": 4, - "arg2": false - } - } - ] + "TemplateData": { + "HBIR": { + "args": [ + "arg1", + "arg2" + ] + }, + "HBIR BUT BETTER": { + "args": [ + "arg1", + "arg2", + "arg3" + ] + }, + "LOADLEVELS BUT NOT": { + "args": [ + "foo", + "bar", + "baz" + ] + } + }, + "RunList": [ + { + "template_type": "HBIR BUT BETTER", + "args": { + "arg1": "value 1", + "arg2": "value 1", + "arg3": "value 1" + } + }, + { + "template_type": "HBIR", + "args": { + "arg1": 4, + "arg2": false + } + }, + { + "template_type": "HBIR", + "args": { + "arg1": 4, + "arg2": false + } + } + ] } diff --git a/examples/example_curses_basic.json b/examples/example_curses_basic.json index 3dcd389..77089de 100644 --- a/examples/example_curses_basic.json +++ b/examples/example_curses_basic.json @@ -1,47 +1,47 @@ { - "_type": "spec_config", - "runs": [ - { - "tag": "tag-name", - "skip_report": false, - "jdk": "/usr/bin/java", - "report_level": 0, - "data_collection": "NONE", - "ignore_kit_validation": false, - "numa_nodes": 1, - "num_runs": 1, - "jvm_options": "-Xms29g -Xmx29g -Xmn27g -XX:ParallelGCThreads=48", - "props": { - "modified": [ - { - "prop": "specjbb.comm.connect.timeouts.connect", - "value": "600001" - } - ] - }, - "verbose": false, - "run_type": "composite" - }, - { - "tag": "tag-name12", - "skip_report": false, - "jdk": "/usr/bin/java", - "report_level": 0, - "data_collection": "NONE", - "ignore_kit_validation": false, - "numa_nodes": 1, - "num_runs": 1, - "jvm_options": "-Xms29g -Xmx29g -Xmn27g -XX:ParallelGCThreads=48", - "props": { - "modified": [ - { - "prop": "specjbb.comm.connect.timeouts.connect", - "value": "600001" - } - ] - }, - "verbose": false, - "run_type": "composite" - } - ] -} \ No newline at end of file + "_type": "spec_config", + "runs": [ + { + "tag": "tag-name", + "skip_report": false, + "jdk": "/usr/bin/java", + "report_level": 0, + "data_collection": "NONE", + "ignore_kit_validation": false, + "numa_nodes": 1, + "num_runs": 1, + "jvm_options": "-Xms29g -Xmx29g -Xmn27g -XX:ParallelGCThreads=48", + "props": { + "modified": [ + { + "prop": "specjbb.comm.connect.timeouts.connect", + "value": "600001" + } + ] + }, + "verbose": false, + "run_type": "composite" + }, + { + "tag": "tag-name12", + "skip_report": false, + "jdk": "/usr/bin/java", + "report_level": 0, + "data_collection": "NONE", + "ignore_kit_validation": false, + "numa_nodes": 1, + "num_runs": 1, + "jvm_options": "-Xms29g -Xmx29g -Xmn27g -XX:ParallelGCThreads=48", + "props": { + "modified": [ + { + "prop": "specjbb.comm.connect.timeouts.connect", + "value": "600001" + } + ] + }, + "verbose": false, + "run_type": "composite" + } + ] +} diff --git a/examples/example_curses_template.json b/examples/example_curses_template.json index d789015..c078b16 100644 --- a/examples/example_curses_template.json +++ b/examples/example_curses_template.json @@ -1,64 +1,64 @@ { - "TemplateData": { - "CURSES": { - "annotations": { - "JVM Options": "A string of arguments to be passed to the JVM", - "Run Type": "The run type must be 'composite', 'distributed_ctrl_txl', 'distributed_sut', or 'multi'", - "Ignore Kit Validation": "Whether or not SPECjbb will perform kit validation prior to running", - "Numa Nodes": "The number of numa nodes to use when running multiple TXINJECTOR's or BACKEND's", - "Tag": "The name of this run", - "JDK": "The full path location of a java executable to be invoked", - "Data Collection": "Currently unsupported", - "Number of Runs": "The number of times this run will execute sequentially", - "Verbose": "Whether or not SPECjbb will produce verbose output during a run", - "Skip Report": "Whether or not SPECjbb will skip producing a report after completion" - }, - "args": [ - "JDK", - "JVM Options", - "Run Type", - "Tag", - "Numa Nodes", - "Verbose", - "Report Level", - "Skip Report", - "Ignore Kit Validation", - "Number of Runs", - "Data Collection" - ], - "types": { - "JVM Options": "string", - "Run Type": "string", - "Ignore Kit Validation": "boolean", - "Numa Nodes": "integer", - "Tag": "string", - "JDK": "string", - "Data Collection": "string", - "Number of Runs": "integer", - "Verbose": "boolean", - "Skip Report": "boolean" - } - } - }, - "RunList": [ - { - "template_type": "CURSES", - "args": { - "JVM Options": "-Xms29g -Xmx29g -Xmn27g -XX:ParallelGCThreads=48", - "Run Type": "composite", - "Ignore Kit Validation": false, - "Report Level": 0, - "Tag": "tag-name", - "Number of Runs": 1, - "Skip Report": false, - "Numa Nodes": 1, - "JDK": "/usr/bin/java", - "Data Collection": "NONE", - "Verbose": false - }, - "props_extra": { - "specjbb.comm.connect.worker.pool.min": "12323" - } - } - ] + "TemplateData": { + "CURSES": { + "annotations": { + "JVM Options": "A string of arguments to be passed to the JVM", + "Run Type": "The run type must be 'composite', 'distributed_ctrl_txl', 'distributed_sut', or 'multi'", + "Ignore Kit Validation": "Whether or not SPECjbb will perform kit validation prior to running", + "Numa Nodes": "The number of numa nodes to use when running multiple TXINJECTOR's or BACKEND's", + "Tag": "The name of this run", + "JDK": "The full path location of a java executable to be invoked", + "Data Collection": "Currently unsupported", + "Number of Runs": "The number of times this run will execute sequentially", + "Verbose": "Whether or not SPECjbb will produce verbose output during a run", + "Skip Report": "Whether or not SPECjbb will skip producing a report after completion" + }, + "args": [ + "JDK", + "JVM Options", + "Run Type", + "Tag", + "Numa Nodes", + "Verbose", + "Report Level", + "Skip Report", + "Ignore Kit Validation", + "Number of Runs", + "Data Collection" + ], + "types": { + "JVM Options": "string", + "Run Type": "string", + "Ignore Kit Validation": "boolean", + "Numa Nodes": "integer", + "Tag": "string", + "JDK": "string", + "Data Collection": "string", + "Number of Runs": "integer", + "Verbose": "boolean", + "Skip Report": "boolean" + } + } + }, + "RunList": [ + { + "template_type": "CURSES", + "args": { + "JVM Options": "-Xms29g -Xmx29g -Xmn27g -XX:ParallelGCThreads=48", + "Run Type": "composite", + "Ignore Kit Validation": false, + "Report Level": 0, + "Tag": "tag-name", + "Number of Runs": 1, + "Skip Report": false, + "Numa Nodes": 1, + "JDK": "/usr/bin/java", + "Data Collection": "NONE", + "Verbose": false + }, + "props_extra": { + "specjbb.comm.connect.worker.pool.min": "12323" + } + } + ] } diff --git a/mainCLI.py b/mainCLI.py index e5b47fa..c81db72 100644 --- a/mainCLI.py +++ b/mainCLI.py @@ -34,6 +34,7 @@ log = logging.getLogger(__name__) + def to_list(s): if s["run_type"].lower() in ["hbir", "hbir_rt"]: return [ @@ -113,12 +114,19 @@ def do_run(arguments): s.run(arguments['--dry-run']) + def do_script(arguments): - call(["perl", "scripts/{}.pl".format(arguments["