├── .gitignore ├── COPYING ├── MANIFEST.in ├── README.md ├── example.json ├── mbdirector ├── __init__.py ├── benchmark.py ├── main.py ├── runner.py ├── schema │ └── mbdirector_schema.json ├── serve.py ├── static │ └── css │ │ └── style.css ├── target.py └── templates │ ├── base.html │ ├── index.html │ └── run.html ├── pyproject.toml └── setup.py /.gitignore: -------------------------------------------------------------------------------- 1 | .env/ 2 | **/*.pyc 3 | *.egg-info/ 4 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc. 5 | 675 Mass Ave, Cambridge, MA 02139, USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Library General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | Appendix: How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 19yy 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License 307 | along with this program; if not, write to the Free Software 308 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) 19yy name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | , 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Library General 339 | Public License instead of this License. 340 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include mbdirector/schema/*.json 2 | include mbdirector/static/css/* 3 | include mbdirector/templates/*.html 4 | include README.md 5 | include COPYING 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Memtier-Benchmark Director 2 | ========================== 3 | 4 | This is a front-end tool that makes it easier to run successive benchmarking 5 | sessions using the memtier_benchmark tool by automating tasks such as: 6 | 7 | * Setting up and tearing down Redis instances 8 | * Running memtier_benchmark 9 | * Collecting and organizing all data, logs, etc. 10 | * Providing a simple web front to access data and a visual summary 11 | 12 | ![Screenshot](../assets/screenshot1.png?raw=true) 13 | 14 | Getting Started 15 | --------------- 16 | 17 | Clone this repo and `cd` into it. Next, set up a local Python virtualenv and 18 | install: 19 | 20 | ``` 21 | mkdir .env 22 | virtualenv .env 23 | . .env/bin/activate 24 | python setup.py install 25 | ``` 26 | 27 | To run, create a benchmark JSON file and run: 28 | 29 | ``` 30 | mbdirector benchmark -s mybenchmark.json 31 | ``` 32 | 33 | This will set up the necessary targets, execute benchmarks, and store the 34 | results in a `results` directory. To access the results run `mbdirector serve` 35 | from the same directory and point your browser to `http://localhost:8080`. 36 | 37 | Benchmark Configuration 38 | ----------------------- 39 | 40 | The benchmark configuration defines: 41 | 1. One or more *target*. A target is a Redis database which is set up for the 42 | purpose of running a benchmark and teared down when it is complete. 43 | 44 | Currently the only supported target type is a local Redis process. A useful 45 | "TODO" item would be to support Redis Enterprise API to provision a database 46 | of arbitrary configuration. 47 | 48 | 2. One or more *benchmark*. A benchmark is a description of how to run 49 | `memtier_benchmark` (i.e. with specific arguments controlling size of 50 | elements, pipelining, etc.). 51 | 52 | When executed, `mbdirector` runs a combination of all configured benchmarks and 53 | all configured targets. 54 | 55 | -------------------------------------------------------------------------------- /example.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sample-mbdirector-benchmark", 3 | "configuration": { 4 | "memtier_benchmark": { 5 | "binary": "../memtier_benchmark/memtier_benchmark", 6 | "threads": 1, 7 | "clients": 10, 8 | "test_time": 5 9 | } 10 | }, 11 | "targets": [ 12 | { 13 | "name": "redis-no-aof", 14 | "binary": "../redis/src/redis-server", 15 | "args": [] 16 | }, 17 | { 18 | "name": "redis-aof-fsync-always", 19 | "binary": "../redis/src/redis-server", 20 | "args": ["--appendonly", "yes", "--appendfsync", "always"] 21 | } 22 | ], 23 | "benchmarks": [ 24 | { 25 | "name": "small-100b-values", 26 | "args": ["--data-size", "100"] 27 | }, 28 | { 29 | "name": "large-4k-values", 30 | "args": ["--data-size", "4000"] 31 | } 32 | ] 33 | } 34 | -------------------------------------------------------------------------------- /mbdirector/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RedisLabs/mbdirector/32b52d0d4f61c2c4b3cbe0a45444da4959942023/mbdirector/__init__.py -------------------------------------------------------------------------------- /mbdirector/benchmark.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2019 Redis Labs Ltd. 2 | # 3 | # This file is part of mbdirector. 4 | # 5 | # mbdirector is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, version 2. 8 | # 9 | # mbdirector is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with memtier_benchmark. If not, see . 16 | 17 | import os.path 18 | import subprocess 19 | import logging 20 | 21 | 22 | class Benchmark(object): 23 | def __init__(self, config, **kwargs): 24 | self.config = config 25 | self.binary = self.config.mb_binary 26 | self.name = kwargs['name'] 27 | 28 | # Configure 29 | self.args = [self.binary] 30 | if not self.config.explicit_connect_args: 31 | self.args += ['--server', '127.0.0.1', 32 | '--port', str(self.config.redis_process_port) 33 | ] 34 | self.args += ['--out-file', os.path.join(config.results_dir, 35 | 'mb.stdout'), 36 | '--json-out-file', os.path.join(config.results_dir, 37 | 'mb.json')] 38 | 39 | if self.config.mb_threads is not None: 40 | self.args += ['--threads', str(self.config.mb_threads)] 41 | if self.config.mb_clients is not None: 42 | self.args += ['--clients', str(self.config.mb_clients)] 43 | if self.config.mb_pipeline is not None: 44 | self.args += ['--pipeline', str(self.config.mb_pipeline)] 45 | if self.config.mb_requests is not None: 46 | self.args += ['--requests', str(self.config.mb_requests)] 47 | if self.config.mb_test_time is not None: 48 | self.args += ['--test-time', str(self.config.mb_test_time)] 49 | 50 | self.args += kwargs['args'] 51 | 52 | @classmethod 53 | def from_json(cls, config, json): 54 | return cls(config, **json) 55 | 56 | def write_file(self, name, data): 57 | with open(os.path.join(self.config.results_dir, name), 'wb') as outfile: 58 | outfile.write(data) 59 | 60 | def run(self): 61 | logging.debug(' Command: %s', ' '.join(self.args)) 62 | process = subprocess.Popen( 63 | stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE, 64 | executable=self.binary, args=self.args) 65 | _stdout, _stderr = process.communicate() 66 | if _stderr: 67 | logging.debug(' >>> stderr <<<\n%s\n', _stderr) 68 | self.write_file('mb.stderr', _stderr) 69 | return process.wait() == 0 70 | -------------------------------------------------------------------------------- /mbdirector/main.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2019 Redis Labs Ltd. 2 | # 3 | # This file is part of mbdirector. 4 | # 5 | # mbdirector is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, version 2. 8 | # 9 | # mbdirector is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with memtier_benchmark. If not, see . 16 | 17 | """ 18 | Main module. 19 | """ 20 | import sys 21 | import os.path 22 | import json 23 | import logging 24 | import datetime 25 | import pkg_resources 26 | 27 | import click 28 | from jsonschema import validate 29 | 30 | from mbdirector.runner import Runner 31 | from mbdirector.serve import run_webserver 32 | 33 | 34 | def config_logging(log_filename, loglevel): 35 | formatter = logging.Formatter( 36 | fmt='%(asctime)s %(levelname)s %(message)s') 37 | 38 | stdout_handler = logging.StreamHandler(sys.stdout) 39 | stdout_handler.setFormatter(formatter) 40 | 41 | file_handler = logging.FileHandler(log_filename) 42 | file_handler.setFormatter(formatter) 43 | 44 | root_logger = logging.getLogger() 45 | root_logger.addHandler(stdout_handler) 46 | root_logger.addHandler(file_handler) 47 | root_logger.setLevel(getattr(logging, loglevel.upper())) 48 | 49 | 50 | @click.group() 51 | def cli(): 52 | pass 53 | 54 | 55 | @cli.command() 56 | @click.option('--spec', '-s', required=True, type=click.File('r'), 57 | help='Benchmark specifications') 58 | @click.option('--loglevel', '-l', default='info', 59 | type=click.Choice(['debug', 'info', 'error']), 60 | help='Benchmark specifications') 61 | @click.option('--skip-benchmarks', multiple=True, 62 | help='Specify benchmarks to skip') 63 | @click.option('--skip-targets', multiple=True, 64 | help='Specify targets to skip') 65 | def benchmark(spec, loglevel, skip_benchmarks, skip_targets): 66 | schema_file = pkg_resources.resource_filename( 67 | 'mbdirector', 'schema/mbdirector_schema.json') 68 | try: 69 | schema = json.load(open(schema_file)) 70 | except Exception as err: 71 | click.echo('Error: failed to load schema: {}'.format(err)) 72 | sys.exit(1) 73 | 74 | try: 75 | spec_json = json.load(spec) 76 | except Exception as err: 77 | click.echo('Error: failed to spec: {}: {}'.format( 78 | spec.name, err)) 79 | sys.exit(1) 80 | 81 | try: 82 | validate(spec_json, schema) 83 | except Exception as err: 84 | click.echo('Error: invalid test: {}: {}'.format(spec.name, err)) 85 | sys.exit(1) 86 | 87 | base_results_dir = os.path.join( 88 | 'results', '{}Z'.format(datetime.datetime.utcnow().isoformat())) 89 | os.makedirs(base_results_dir) 90 | config_logging(os.path.join(base_results_dir, 'mbdirector.log'), 91 | loglevel) 92 | 93 | _runner = Runner(base_results_dir, spec.name, spec_json, 94 | skip_benchmarks, skip_targets) 95 | _runner.run() 96 | 97 | 98 | @cli.command() 99 | @click.option('--bind', '-b', required=False, default='127.0.0.1', 100 | help='Address to bind to') 101 | @click.option('--port', '-p', required=False, default=8080, 102 | help='Port to listen on') 103 | def serve(bind, port): 104 | run_webserver(bind, port) 105 | -------------------------------------------------------------------------------- /mbdirector/runner.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2019 Redis Labs Ltd. 2 | # 3 | # This file is part of mbdirector. 4 | # 5 | # mbdirector is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, version 2. 8 | # 9 | # mbdirector is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with memtier_benchmark. If not, see . 16 | 17 | import os 18 | import logging 19 | import time 20 | import json 21 | from fnmatch import fnmatch 22 | 23 | from mbdirector.target import Target 24 | from mbdirector.benchmark import Benchmark 25 | 26 | 27 | class RunConfig(object): 28 | next_id = 1 29 | 30 | def __init__(self, base_results_dir, name, config, benchmark_config): 31 | self.id = RunConfig.next_id 32 | RunConfig.next_id += 1 33 | 34 | self.redis_process_port = config.get('redis_process_port', 6379) 35 | 36 | mbconfig = config.get('memtier_benchmark', {}) 37 | mbconfig.update(benchmark_config) 38 | self.mb_binary = mbconfig.get('binary', 'memtier_benchmark') 39 | self.mb_threads = mbconfig.get('threads') 40 | self.mb_clients = mbconfig.get('clients') 41 | self.mb_pipeline = mbconfig.get('pipeline') 42 | self.mb_requests = mbconfig.get('requests') 43 | self.mb_test_time = mbconfig.get('test_time') 44 | self.explicit_connect_args = bool( 45 | mbconfig.get('explicit_connect_args')) 46 | 47 | self.results_dir = os.path.join(base_results_dir, 48 | '{:04}_{}'.format(self.id, name)) 49 | 50 | def __repr__(self): 51 | return ''.format(self.id) 52 | 53 | 54 | class Runner(object): 55 | def __init__(self, base_results_dir, spec_filename, spec, 56 | skip_benchmarks, skip_targets): 57 | self.spec_filename = spec_filename 58 | self.spec = spec 59 | self.skip_benchmarks = skip_benchmarks 60 | self.skip_targets = skip_targets 61 | self.base_results_dir = base_results_dir 62 | self.start_time = None 63 | self.end_time = None 64 | self.errors = 0 65 | 66 | def run_benchmark(self, benchmark_json, target_json): 67 | name = '{}_{}'.format(benchmark_json['name'], 68 | target_json['name']) 69 | 70 | logging.info('===== Running benchmark "%s" =====', name) 71 | 72 | config = RunConfig(self.base_results_dir, name, 73 | self.spec['configuration'], 74 | benchmark_json.get('configuration', {})) 75 | os.makedirs(config.results_dir) 76 | 77 | # Write benchmark info 78 | with open(os.path.join(config.results_dir, 79 | "benchmark.json"), "w") as bfile: 80 | json.dump({'benchmark': benchmark_json['name'], 81 | 'target': target_json['name']}, bfile) 82 | 83 | target = Target.from_json(config, target_json) 84 | benchmark = Benchmark.from_json(config, benchmark_json) 85 | 86 | logging.info('Setting up target "%s"', target.name) 87 | try: 88 | target.setup() 89 | except Exception as err: 90 | logging.exception('Failed to set up target: %s' % err) 91 | self.errors += 1 92 | return 93 | 94 | logging.info('Running benchmark "%s"', benchmark.name) 95 | if not benchmark.run(): 96 | logging.error('Benchmark execution failed') 97 | self.errors += 1 98 | 99 | logging.info('Tearing down target "%s"', target.name) 100 | target.teardown() 101 | 102 | def write_result(self): 103 | with open(os.path.join(self.base_results_dir, 104 | 'result.json'), 'w') as rfile: 105 | json.dump({'run_time': self.end_time - self.start_time, 106 | 'errors': self.errors, 107 | 'spec_filename': self.spec_filename}, 108 | rfile) 109 | 110 | def write_spec(self): 111 | with open(os.path.join(self.base_results_dir, 112 | 'spec.json'), 'w') as sfile: 113 | json.dump(self.spec, sfile) 114 | 115 | def should_skip_benchmark(self, benchmark): 116 | for pattern in self.skip_benchmarks: 117 | if fnmatch(benchmark['name'], pattern): 118 | return True 119 | return False 120 | 121 | def should_skip_target(self, target): 122 | for pattern in self.skip_targets: 123 | if fnmatch(target['name'], pattern): 124 | return True 125 | return False 126 | 127 | def run(self): 128 | self.write_spec() 129 | self.start_time = time.time() 130 | 131 | for benchmark in self.spec['benchmarks']: 132 | if self.should_skip_benchmark(benchmark): 133 | logging.info('Skipping benchmark: %s', benchmark['name']) 134 | continue 135 | 136 | for target in self.spec['targets']: 137 | if self.should_skip_target(target): 138 | logging.info('Skipping target: %s', target['name']) 139 | continue 140 | 141 | self.run_benchmark(benchmark, target) 142 | 143 | self.end_time = time.time() 144 | self.write_result() 145 | -------------------------------------------------------------------------------- /mbdirector/schema/mbdirector_schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "id": "http://redislabs.com/mbdirector/v1", 4 | 5 | "type": "object", 6 | 7 | "properties": { 8 | "name": { 9 | "description": "Name of benchmark testcase", 10 | "type": "string" 11 | }, 12 | "configuration": { 13 | "type": "object", 14 | "properties": { 15 | "memtier_benchmark": { 16 | "description": "Default configuration for benchmarks", 17 | "type": "object", 18 | "$ref": "#/definitions/memtier_benchmark_config" 19 | }, 20 | "redis_process_port": { 21 | "type": "integer", 22 | "minValue": 1, 23 | "maxValue": 65535, 24 | "default": 6379 25 | } 26 | } 27 | }, 28 | "targets": { 29 | "description": "List of Redis targets to provision and test against", 30 | "type": "array", 31 | "minItems": 1, 32 | "items": { 33 | "$ref": "#/definitions/target" 34 | } 35 | }, 36 | "benchmarks": { 37 | "description": "List of memtier_benchmark configurations to test", 38 | "type": "array", 39 | "minItems": 1, 40 | "items": { 41 | "$ref": "#/definitions/benchmark" 42 | } 43 | } 44 | }, 45 | 46 | "required": [ "name", "targets", "benchmarks" ], 47 | "additionalItems": false, 48 | 49 | "definitions": { 50 | "target": { 51 | "type": "object", 52 | "properties": { 53 | "name": { 54 | "description": "Name of test target", 55 | "type": "string" 56 | }, 57 | "binary": { 58 | "description": "Redis executable file name", 59 | "type": "string" 60 | }, 61 | "args": { 62 | "description": "Redis extra command line arguments", 63 | "type": "array", 64 | "items": { 65 | "type": "string" 66 | } 67 | }, 68 | "auto_port_bind_args": { 69 | "description": "If true, bind/port automatic arguments are appended.", 70 | "type": "boolean", 71 | "default": true 72 | }, 73 | "skip_ping_on_setup": { 74 | "description": "If true, mbdirector does not use ping to validate server is up but simply waits 1 second after startup.", 75 | "type": "boolean", 76 | "default": false 77 | } 78 | }, 79 | "required": [ "name", "binary", "args" ], 80 | "additionalItems": false 81 | }, 82 | "memtier_benchmark_config": { 83 | "type": "object", 84 | "properties": { 85 | "binary": { 86 | "description": "Name of memtier_benchmark binary", 87 | "type": "string" 88 | }, 89 | "threads": { 90 | "description": "Number of threads", 91 | "type": "integer", 92 | "minValue": 1 93 | }, 94 | "clients": { 95 | "description": "Number of clients per thread", 96 | "type": "integer", 97 | "minValue": 1 98 | }, 99 | "pipeline": { 100 | "description": "Number of requests in pipeline", 101 | "type": "integer", 102 | "minValue": 1 103 | }, 104 | "requests": { 105 | "description": "Number of requests to perform", 106 | "type": "integer", 107 | "minValue": 1 108 | }, 109 | "test_time": { 110 | "description": "Time to execute the benchmark (seconds)", 111 | "type": "integer", 112 | "minValue": 1 113 | }, 114 | "explicit_connect_args": { 115 | "description": "Do not automatically add host and port arguments", 116 | "type": "boolean", 117 | "default": false 118 | } 119 | } 120 | }, 121 | "benchmark": { 122 | "type": "object", 123 | "properties": { 124 | "name": { 125 | "description": "Name of benchmark configuration", 126 | "type": "string" 127 | }, 128 | "configuration": { 129 | "description": "Configuration to override defaults", 130 | "type": "object", 131 | "$ref": "#/definitions/memtier_benchmark_config" 132 | }, 133 | "args": { 134 | "description": "Memtier benchmark extra command line arguments", 135 | "type": "array", 136 | "items": { 137 | "type": "string" 138 | } 139 | } 140 | }, 141 | "required": [ "args" ], 142 | "additionalItems": false 143 | } 144 | } 145 | } 146 | 147 | -------------------------------------------------------------------------------- /mbdirector/serve.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2019 Redis Labs Ltd. 2 | # 3 | # This file is part of mbdirector. 4 | # 5 | # mbdirector is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, version 2. 8 | # 9 | # mbdirector is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with memtier_benchmark. If not, see . 16 | 17 | import os.path 18 | import json 19 | 20 | from flask import (Flask, render_template, send_file, abort, Response, 21 | send_from_directory) 22 | from werkzeug.serving import run_simple 23 | 24 | 25 | class Config(object): 26 | RESULTS_BASEDIR = 'results' 27 | 28 | 29 | app = Flask(__name__) 30 | app.config.from_object('mbdirector.serve.Config') 31 | 32 | 33 | class BenchmarkResults(object): 34 | def __init__(self, dirname): 35 | self.dirname = dirname 36 | self.info = {} 37 | self.stats = {} 38 | self.read() 39 | self.name = '{}|{}'.format( 40 | self.info['benchmark'], self.info['target']) 41 | 42 | def read(self): 43 | with open(os.path.join(self.dirname, 'benchmark.json'), 'r') as bfile: 44 | self.info = json.load(bfile) 45 | 46 | try: 47 | with open(os.path.join(self.dirname, 'mb.json'), 'r') as sfile: 48 | self.json = json.load(sfile) 49 | self.stats = self.json.get('ALL STATS', {}) 50 | except Exception: 51 | self.json = {} 52 | self.stats = {} 53 | 54 | def print_json(self): 55 | return json.dumps(self.json, indent=2) 56 | 57 | def files(self): 58 | all_files = ['redis.log', 'mb.stdout'] 59 | result = [f for f in all_files 60 | if os.path.exists(os.path.join(self.dirname, f))] 61 | return result 62 | 63 | 64 | class RunResults(object): 65 | OK = 'ok' 66 | NOTFOUND = 'results-not-found' 67 | INVALID = 'results-invalid' 68 | 69 | def __init__(self, dirname): 70 | self.name = dirname 71 | self.dirname = os.path.join(app.config['RESULTS_BASEDIR'], dirname) 72 | self.results = {} 73 | self.status = self.OK 74 | self.read_results() 75 | self.benchmarks = {} 76 | self.read_benchmark_results() 77 | 78 | def read_benchmark_results(self): 79 | dirs = [] 80 | try: 81 | dirs = os.listdir(self.dirname) 82 | except OSError: 83 | pass 84 | for benchdir in dirs: 85 | path = os.path.join(self.dirname, benchdir) 86 | if os.path.isdir(path): 87 | benchmark = BenchmarkResults(path) 88 | self.benchmarks[benchmark.name] = benchmark 89 | 90 | def read_results(self): 91 | try: 92 | with open(os.path.join(self.dirname, 'result.json'), 'r') as rfile: 93 | self.results = json.load(rfile) 94 | except IOError: 95 | self.status = self.NOTFOUND 96 | except ValueError: 97 | self.status = self.INVALID 98 | 99 | def get_benchmarks(self): 100 | try: 101 | return self.benchmarks.itervalues() 102 | except AttributeError: 103 | return self.benchmarks.values() 104 | 105 | def get_benchmark_labels(self): 106 | return [b.name for b in self.get_benchmarks()] 107 | 108 | def __render_dataset(self, benchmark, section_key_list): 109 | return { 110 | 'label': '{}|{}'.format(benchmark.info['benchmark'], 111 | benchmark.info['target']), 112 | 'data': [benchmark.stats.get(sk[0], {}).get(sk[1]) 113 | for sk in section_key_list] 114 | } 115 | 116 | def render_tps_stats(self): 117 | return { 118 | 'labels': ['Total', 'Gets', 'Sets'], 119 | 'datasets': [self.__render_dataset(b, [('Totals', 'Ops/sec'), 120 | ('Gets', 'Ops/sec'), 121 | ('Sets', 'Ops/sec')]) 122 | for b in self.get_benchmarks()] 123 | } 124 | 125 | def render_latency_stats(self): 126 | return { 127 | 'labels': ['Average', 'Gets', 'Sets'], 128 | 'datasets': [self.__render_dataset(b, [('Totals', 'Latency'), 129 | ('Gets', 'Latency'), 130 | ('Sets', 'Latency')]) 131 | for b in self.get_benchmarks()] 132 | } 133 | 134 | def render_bandwidth_stats(self): 135 | return { 136 | 'labels': ['Total', 'Gets', 'Sets'], 137 | 'datasets': [self.__render_dataset(b, [('Totals', 'KB/sec'), 138 | ('Gets', 'KB/sec'), 139 | ('Sets', 'KB/sec')]) 140 | for b in self.get_benchmarks()] 141 | } 142 | 143 | 144 | def get_run_results(): 145 | dirs = [] 146 | try: 147 | dirs = os.listdir(app.config['RESULTS_BASEDIR']) 148 | except OSError: 149 | pass 150 | 151 | return [RunResults(d) for d in sorted(dirs)] 152 | 153 | 154 | @app.route('/') 155 | def index(): 156 | return render_template('index.html', results=get_run_results()) 157 | 158 | 159 | @app.route('/run/') 160 | def get_run(run): 161 | return render_template('run.html', run=RunResults(run)) 162 | 163 | 164 | @app.route('/run//spec') 165 | def get_run_spec(run): 166 | specfile = open(os.path.join( 167 | app.config['RESULTS_BASEDIR'], run, 'spec.json'), 'r') 168 | return send_file(specfile, mimetype='text/plain') 169 | 170 | 171 | @app.route('/run///json') 172 | def get_benchmark_json(run, benchmark): 173 | run = RunResults(run) 174 | if benchmark not in run.benchmarks: 175 | abort(404) 176 | return Response(run.benchmarks[benchmark].print_json(), 177 | mimetype='text/plan') 178 | 179 | 180 | @app.route('/run///file/') 181 | def get_benchmark_file(run, benchmark, filename): 182 | run = RunResults(run) 183 | if benchmark not in run.benchmarks: 184 | abort(404) 185 | return send_from_directory( 186 | os.path.abspath(run.benchmarks[benchmark].dirname), 187 | filename, mimetype='text/plan') 188 | 189 | 190 | def run_webserver(bind, port): 191 | run_simple(bind, port, app) 192 | -------------------------------------------------------------------------------- /mbdirector/static/css/style.css: -------------------------------------------------------------------------------- 1 | .flex-container { 2 | display: flex; 3 | flex-direction: row; 4 | flex-wrap: wrap; 5 | margin: -5px -5px; 6 | } 7 | 8 | .flex-item { 9 | border-top: 5px solid transparent; 10 | width: 500px; 11 | margin: 5px 5px; 12 | } 13 | 14 | .flex-report-item { 15 | vertical-align: middle; 16 | background-color: lightgray; 17 | } 18 | 19 | .flex-file-link { 20 | height: 100px; 21 | text-align: center; 22 | vertical-align: middle; 23 | line-height: 100px; 24 | background-color: lightgray; 25 | } 26 | 27 | .report-name { 28 | font-size: 1.5em; 29 | font-weight: bold; 30 | } 31 | -------------------------------------------------------------------------------- /mbdirector/target.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2019 Redis Labs Ltd. 2 | # 3 | # This file is part of mbdirector. 4 | # 5 | # mbdirector is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, version 2. 8 | # 9 | # mbdirector is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with memtier_benchmark. If not, see . 16 | 17 | """ 18 | Setup and tear down test targets. 19 | """ 20 | 21 | import os.path 22 | import subprocess 23 | import time 24 | import logging 25 | 26 | import redis 27 | 28 | 29 | class Target(object): 30 | """ 31 | Currently hard coded to RedisProcessTarget, but should be extended in 32 | the future to provision RE databases, etc. 33 | """ 34 | 35 | @classmethod 36 | def from_json(cls, config, json): 37 | """ 38 | Create a specific subclass from a generic json spec. 39 | """ 40 | return RedisProcessTarget(config, **json) 41 | 42 | 43 | class RedisProcessTarget(object): 44 | """ 45 | Implements a local Redis process target. 46 | """ 47 | 48 | def __init__(self, config, **kwargs): 49 | self.binary = kwargs['binary'] 50 | self.args = [self.binary] + list(kwargs['args']) 51 | self.config = config 52 | self.skip_ping = kwargs.get('skip_ping_on_setup', False) 53 | self.auto_port_bind_args = kwargs.get('auto_port_bind_args', True) 54 | self.name = kwargs['name'] 55 | self.process = None 56 | self._conn = None 57 | 58 | # Configure Redis 59 | if self.auto_port_bind_args: 60 | self.args += ['--port', str(config.redis_process_port), 61 | '--bind', '127.0.0.1'] 62 | self.args += ['--logfile', os.path.join(config.results_dir, 63 | 'redis.log')] 64 | 65 | def setup(self): 66 | logging.debug(' Command: %s', ' '.join(self.args)) 67 | self.process = subprocess.Popen( 68 | stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE, 69 | executable=self.binary, args=self.args) 70 | if self.skip_ping: 71 | time.sleep(1) 72 | else: 73 | self._ping() 74 | 75 | def teardown(self): 76 | if self.process is not None: 77 | self.process.terminate() 78 | self.process.wait() 79 | self.process = None 80 | 81 | def get_redis_url(self): 82 | return 'redis://127.0.0.1:6379' 83 | 84 | def __del__(self): 85 | self.teardown() 86 | 87 | def _get_conn(self, retries=10, interval=0.1): 88 | if self._conn: 89 | return self._conn 90 | 91 | while retries: 92 | try: 93 | self._conn = redis.from_url(self.get_redis_url()) 94 | self._conn.ping() 95 | return self._conn 96 | except redis.ConnectionError: 97 | retries -= 1 98 | if retries: 99 | time.sleep(interval) 100 | else: 101 | raise 102 | 103 | def _ping(self, retries=20, interval=0.2): 104 | while retries: 105 | try: 106 | return self._get_conn().ping() 107 | except redis.RedisError: 108 | retries -= 1 109 | if not retries: 110 | raise 111 | time.sleep(interval) 112 | -------------------------------------------------------------------------------- /mbdirector/templates/base.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {% block head %} 6 | {% block title %}{% endblock %} 7 | {% endblock %} 8 | 9 | 10 |
{% block content %}{% endblock %}
11 | 12 | 13 | -------------------------------------------------------------------------------- /mbdirector/templates/index.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | {% block title %}Memtier Benchmark Results{% endblock %} 3 | {% block content %} 4 |

Memtier Benchmark Results

5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | {% for r in results %} 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | {% endfor %} 22 |
RunSpec FilenameRun TimeErrorsStatus
{{ r.dirname }}{{ r.results.get('spec_filename') }}{{ '%0.2f secs' | format(r.results.get('run_time')|float) }}{{ r.results.get('errors') }}{{ r.status }}
23 | {% endblock %} 24 | -------------------------------------------------------------------------------- /mbdirector/templates/run.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | {% block title %}Memtier Benchmark Results{% endblock %} 3 | {% block head %} 4 | 5 | {% endblock %} 6 | {% block content %} 7 |

Memtier Benchmark Results

8 |

{{ run.name }}

9 | 10 |
11 |
12 | 13 | 14 |
15 |
16 | 17 | 18 |
19 |
20 | 21 | 22 |
23 |
24 |
25 | {% for benchmark in run.get_benchmarks() %} 26 |
27 | {{ benchmark.name }} 28 |
  • JSON Output
  • 29 | {% for f in benchmark.files() %} 30 |
  • {{ f }}
  • 31 | {% endfor %} 32 |
    33 | {% endfor %} 34 |
    35 | 36 | 72 | 73 | 81 | 82 | {% endblock %} 83 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool.poetry] 2 | name = "mbdirector" 3 | version = "0.1.0" 4 | description = "" 5 | authors = ["Your Name "] 6 | license = "GPL" 7 | readme = "README.md" 8 | 9 | [tool.poetry.dependencies] 10 | python = "^3.8" 11 | click = "^8.1.3" 12 | redis = "^4.5.5" 13 | Flask = "^2.3.2" 14 | jsonschema = "^4.17.3" 15 | 16 | 17 | [build-system] 18 | requires = ["poetry-core"] 19 | build-backend = "poetry.core.masonry.api" 20 | 21 | [tool.poetry.scripts] 22 | mbdirector = "mbdirector.main:cli" 23 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup, find_packages 2 | setup( 3 | name='mbdirector', 4 | version='0.1.0', 5 | url='https://github.com/RedisLabs/mbdirector', 6 | license='GPL', 7 | packages=find_packages(), 8 | include_package_data=True, 9 | zip_safe=False, 10 | package_data={ 11 | 'mbdirector': ['schema/mbdirector_schema.json', 12 | 'static/css/*', 13 | 'templates/*'] 14 | }, 15 | install_requires=[ 16 | 'jsonschema==4.17.3', 17 | 'click==8.1.3', 18 | 'redis==4.5.5', 19 | 'Flask==2.3.2' 20 | ], 21 | entry_points=''' 22 | [console_scripts] 23 | mbdirector=mbdirector.main:cli 24 | ''' 25 | ) 26 | --------------------------------------------------------------------------------