From 5d84bdc3f2645424670c437b939868f84f91656a Mon Sep 17 00:00:00 2001 From: Joe Date: Tue, 15 Mar 2016 16:55:06 -0400 Subject: [PATCH] Add Rally Plugins Add Rally Plugin to our automation. + Restructure directory + Patch some of the code + Patched up lib/Rally, still need to finish a couple of changes + Added Plugin path to config + Remove debugging + Update the yml files for plugins Change-Id: I6059ef55ecce1bd32301bdf8ad386d993bbdf757 --- browbeat-complete.yaml | 22 ++++++++++++- lib/Rally.py | 13 ++++++-- .../netcreate_nova-boot-fip-ping.json} | 13 ++++---- .../netcreate_nova-boot-fip-ping.py} | 0 .../netcreate_boot.py} | 12 ++----- .../netcreate-boot/netcreate_boot.yml | 31 ++++++++++++++++++ rally/rally-plugins/neutron-plugin.json | 32 ------------------- .../rally-neutron/admintenant-env.json | 18 ----------- 8 files changed, 71 insertions(+), 70 deletions(-) rename rally/rally-plugins/{neutron-plugin-fip-ping.json => netcreate-boot-ping/netcreate_nova-boot-fip-ping.json} (65%) rename rally/rally-plugins/{neutron-netcreate_nova-boot-fip-ping.py => netcreate-boot-ping/netcreate_nova-boot-fip-ping.py} (100%) rename rally/rally-plugins/{neutron-netcreate_nova-boot.py => netcreate-boot/netcreate_boot.py} (77%) create mode 100644 rally/rally-plugins/netcreate-boot/netcreate_boot.yml delete mode 100644 rally/rally-plugins/neutron-plugin.json delete mode 100644 rally/rally-plugins/rally-neutron/admintenant-env.json diff --git a/browbeat-complete.yaml b/browbeat-complete.yaml index 80b758000..fa43fd516 100644 --- a/browbeat-complete.yaml +++ b/browbeat-complete.yaml @@ -2,7 +2,7 @@ browbeat: results : results/ sudo: true - connmon: true + connmon: false rerun: 3 ansible: hosts: ansible/hosts @@ -50,6 +50,9 @@ rally: sleep_before: 5 sleep_after: 5 venv: /home/stack/rally-venv/bin/activate + plugins: + - netcreate-boot: rally/rally-plugins/netcreate-boot + - netcreate-boot-ping: rally/rally-plugins/netcreate-boot-ping benchmarks: authenticate: enabled: true @@ -82,6 +85,23 @@ rally: sla_max_avg_duration: 12 sla_max_seconds: 30 sla_max_failure: 0 + plugins: + enabled: true + concurrency: + - 16 + - 32 + - 48 + - 64 + times: 128 + scenarios: + netcreate-boot: + enabled: true + image_name: cirros + flavor_name: m1.tiny + file: rally/rally-plugins/netcreate-boot/netcreate_boot.yml + sla_max_avg_duration: 12 + sla_max_seconds: 30 + sla_max_failure: 0 cinder: enabled: true concurrency: diff --git a/lib/Rally.py b/lib/Rally.py index d5cd92185..551360a4e 100644 --- a/lib/Rally.py +++ b/lib/Rally.py @@ -32,9 +32,18 @@ class Rally: if 'sleep_before' in self.config['rally']: time.sleep(self.config['rally']['sleep_before']) task_args = str(scenario_args).replace("'", "\"") + plugins = [] + if "plugins" in self.config['rally']: + if len(self.config['rally']['plugins']) > 0 : + for plugin in self.config['rally']['plugins'] : + for name in plugin : + plugins.append(plugin[name]) + plugin_string = "" + if len(plugins) > 0 : + plugin_string = "--plugin-paths {}".format(",".join(plugins)) cmd = "source {}; ".format(self.config['rally']['venv']) - cmd += "rally task start {} --task-args \'{}\' 2>&1 | tee {}.log".format(task_file, - task_args, test_name) + cmd += "rally {} task start {} --task-args \'{}\' 2>&1 | tee {}.log".format(plugin_string, + task_file,task_args, test_name) self.tools.run_cmd(cmd) if 'sleep_after' in self.config['rally']: time.sleep(self.config['rally']['sleep_after']) diff --git a/rally/rally-plugins/neutron-plugin-fip-ping.json b/rally/rally-plugins/netcreate-boot-ping/netcreate_nova-boot-fip-ping.json similarity index 65% rename from rally/rally-plugins/neutron-plugin-fip-ping.json rename to rally/rally-plugins/netcreate-boot-ping/netcreate_nova-boot-fip-ping.json index 61fa1789c..2422c31b0 100644 --- a/rally/rally-plugins/neutron-plugin-fip-ping.json +++ b/rally/rally-plugins/netcreate-boot-ping/netcreate_nova-boot-fip-ping.json @@ -1,4 +1,3 @@ -{% set flavor_name = flavor_name or "m1.medium" %} { "NeutronBootFipPingPlugin.create_network_nova_boot_ping": [ { @@ -8,23 +7,23 @@ "name": "{{flavor_name}}" }, "image": { - "name": "CentOS-7-x86_64-GenericCloud-20141129_01" + "name": "{{image_name}}" }, "ext_net": { - "id": "4d7d6ee4-4423-46c8-9e03-8f4ae8869841", + "id": "{{net_id}}" }, - "network_create_args": {}, + "network_create_args": {} }, "runner": { "type": "serial", - "times": 1, + "times": 1 }, "context": { "users": { "tenants": 1, "users_per_tenant": 1 - }, - }, + } + } } ] } diff --git a/rally/rally-plugins/neutron-netcreate_nova-boot-fip-ping.py b/rally/rally-plugins/netcreate-boot-ping/netcreate_nova-boot-fip-ping.py similarity index 100% rename from rally/rally-plugins/neutron-netcreate_nova-boot-fip-ping.py rename to rally/rally-plugins/netcreate-boot-ping/netcreate_nova-boot-fip-ping.py diff --git a/rally/rally-plugins/neutron-netcreate_nova-boot.py b/rally/rally-plugins/netcreate-boot/netcreate_boot.py similarity index 77% rename from rally/rally-plugins/neutron-netcreate_nova-boot.py rename to rally/rally-plugins/netcreate-boot/netcreate_boot.py index 8e229731a..361a2680a 100644 --- a/rally/rally-plugins/neutron-netcreate_nova-boot.py +++ b/rally/rally-plugins/netcreate-boot/netcreate_boot.py @@ -9,26 +9,18 @@ from rally.task import validation class NeutronPlugin(neutron_utils.NeutronScenario, nova_utils.NovaScenario, scenario.Scenario): - - # # Create network # Create subnet - # Attach to router # Attach guest to new network - # List - # Ping # Cleanup - # @types.set(image=types.ImageResourceType, flavor=types.FlavorResourceType) @validation.image_valid_on_flavor("flavor", "image") @validation.required_openstack(users=True) @scenario.configure(context={"cleanup": ["nova","neutron"]}) - def create_network_nova_boot(self,image,flavor,router, - network_create_args=None,subnet_create_args=None, - **kwargs): + def create_network_nova_boot(self,image,flavor,network_create_args=None, + subnet_create_args=None,**kwargs): network = self._create_network(network_create_args or {}) subnet = self._create_subnet(network, subnet_create_args or {}) - self._add_interface_router(subnet['subnet'],router) kwargs["nics"] = [{ 'net-id': network['network']['id']}] self._boot_server(image, flavor, **kwargs) diff --git a/rally/rally-plugins/netcreate-boot/netcreate_boot.yml b/rally/rally-plugins/netcreate-boot/netcreate_boot.yml new file mode 100644 index 000000000..3d66ff6ee --- /dev/null +++ b/rally/rally-plugins/netcreate-boot/netcreate_boot.yml @@ -0,0 +1,31 @@ +{% set sla_max_avg_duration = sla_max_avg_duration or 60 %} +{% set sla_max_failure = sla_max_failure or 0 %} +{% set sla_max_seconds = sla_max_seconds or 60 %} +--- +NeutronPlugin.create_network_nova_boot: + - + args: + flavor: + name: '{{flavor_name}}' + image: + name: '{{image_name}}' + network_create_args: {} + runner: + concurrency: {{concurrency}} + times: {{times}} + type: "constant" + context: + users: + tenants: 1 + users_per_tenant: 8 + quotas: + neutron: + network: -1 + port: -1 + router: -1 + subnet: -1 + sla: + max_avg_duration: {{sla_max_avg_duration}} + max_seconds_per_iteration: {{sla_max_seconds}} + failure_rate: + max: {{sla_max_failure}} diff --git a/rally/rally-plugins/neutron-plugin.json b/rally/rally-plugins/neutron-plugin.json deleted file mode 100644 index 178faa052..000000000 --- a/rally/rally-plugins/neutron-plugin.json +++ /dev/null @@ -1,32 +0,0 @@ -{% set flavor_name = flavor_name or "m1.small" %} -{ - "NeutronPlugin.create_network_nova_boot": [ - { - "args": { - "flavor": { - "name": "{{flavor_name}}" - }, - "image": { - "name": "centos7" - }, - "network": { - "id": "a8443e27-c124-4774-a12d-7a0b9905e214", - }, - "router": { - "id" : "d3a1f5a9-87b8-448d-b941-8ff40de84003", - }, - "network_create_args": {}, - }, - "runner": { - "type": "serial", - "times": 5, - }, - "context": { - "users": { - "tenants": 1, - "users_per_tenant": 1 - }, - }, - } - ] -} diff --git a/rally/rally-plugins/rally-neutron/admintenant-env.json b/rally/rally-plugins/rally-neutron/admintenant-env.json deleted file mode 100644 index 881d0154b..000000000 --- a/rally/rally-plugins/rally-neutron/admintenant-env.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "type": "ExistingCloud", - "auth_url": "http://:5000/v2.0/", - "region_name": "regionOne", - "endpoint_type": "public", - "admin": { - "username": "admin", - "password": "", - "tenant_name": "admin" - }, - "users": [ - { - "username": "admin", - "password": "", - "tenant_name": "admin" - } - ] -}