Add a Rally scenario for a very big mistral workflow

* This workflow used to be very slow (hours) before the certain
  performance improvements we've made over the last few months.
  Now with this patch it takes about 26 minutes on the CI
  infrastructure. Having this scenario will allow us to notice
  performance regressions timely when(if) they happen.
* Made several configuration changes to make this scenario work.
  The most important ones are:
   - Setting 'oslo_rpc_executor' to 'threading'. By default, it
     was 'eventlet' and there are known issues leading to deadlocks
     in Python threads (eventlet green threads don't get along with
     MySQL some drivers) if this value is set.
   - Disabling input and output data conversion for YAQL engine.
     This speeds it up drastically.

Change-Id: I0db62a3e68c8954d7db948769d79fc1649d34e31
Signed-off-by: ali <ali.abdelal@nokia.com>
This commit is contained in:
ali 2020-04-05 12:48:55 +00:00 committed by Renat Akhmerov
parent 28202566c0
commit 3c8dafcc2a
11 changed files with 221492 additions and 1 deletions

View File

@ -10,8 +10,27 @@
devstack_local_conf:
post-config:
$MISTRAL_CONF_FILE:
default:
oslo_rpc_executor: threading
rpc_message_ttl: 3000
rpc_response_timeout: 3000
default_log_levels: mistral=DEBUG,mistral.expressions=INFO,sqlalchemy=INFO
engine:
execution_field_size_limit_kb: 8192
execution_integrity_check_delay: -1
executor:
type: local
database:
max_pool_size: 100
scheduler:
fixed_delay: 2
random_depaly: 0
batch_size: 50
yaql:
convert_input_data: false
convert_output_data: false
pecan:
auth_enable: false
required-projects:
- openstack/rally-openstack
- openstack/mistral-lib

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,46 @@
---
version: '2.0'
name: nfvo_actions
actions:
update_dsl_runtime_model:
input:
- update_dsl_runtime_model_request
- env
base: std.echo
base-input:
output: 'update_dsl_runtime_model'
create_system_job:
input:
- parent_job_id: null
- job_status: "Not Started"
- job_description: ""
- target_entity_url: ""
- owner_id: MISTRAL_WORKFLOW
- env
base: std.echo
base-input:
output: 'create_system_job'
output:
content:
id: "fake_job_id"
update_system_job:
input:
- job_id
- job_status
- job_description: ""
- target_entity_url: ""
- owner_id: MISTRAL_WORKFLOW
- bubble_status: false
- env
base: std.echo
base-input:
output: 'update_system_job'
output:
content:
id: "fake_job_id"

View File

@ -0,0 +1,37 @@
---
version: '2.0'
name: nokia.nuage
actions:
dummy_http:
input:
- url
- method: "GET"
- params: null
- body: null
- headers: null
- cookies: null
- auth: null
- timeout: null
- allow_redirects: null
- proxies: null
- verify: null
- result: {}
base: std.echo
base-input:
output: <% $.result %>
output: <% $ %>
ensure_api_key:
input:
- nfvo
- sdn_id
base: std.noop
output:
api_key: "dummy_api_key"
nuage_vsd_url: "dummy_nuage_vsd_url"
nuage_org: "dummy_nuage_org"
nuage_user: "dummy_nuage_user"
nuage_api_prefix: "dummy_nuage_api_prefix"

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,3 @@
{
}

View File

@ -0,0 +1,112 @@
# Copyright 2020 - Nokia Software.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import json
from pathlib import Path
import random
import string
from rally.common import cfg
from rally.task import validation
from rally_openstack import consts
from rally_openstack import scenario
from rally_openstack.scenarios.mistral import utils
CONF = cfg.CONF
SCENARIO_TIMEOUT_SEC = 16000
home_dir = str(Path.home())
wf_dir = '%s/.rally/extra/scenarios/big_wf/' % home_dir
action_files = ['dummy_actions.yaml', 'dummy_actions_nuage.yaml']
common_workflow_files = ['sub_wfs.yaml']
class MistralHugeWorkflowScenario(utils.MistralScenario):
main_wf_file_name = ''
params_filename = ''
wf_name = ''
def run(self):
namespace = ''.join(random.choices(string.ascii_lowercase))
CONF.openstack.mistral_execution_timeout = SCENARIO_TIMEOUT_SEC
self.create_common_workflows()
self.create_actions()
self.create_main_workflow(namespace=namespace)
params = self._read_params_from_file()
self.run_workflow(params, namespace=namespace)
def create_common_workflows(self):
for file in common_workflow_files:
with open(wf_dir + file, 'r+') as f:
definition = f.read()
self._create_workflow(definition)
def create_actions(self):
for file in action_files:
with open(wf_dir + file, 'r+') as f:
definition = f.read()
self._create_workbook(definition)
def _create_workbook(self, definition, namespace=''):
return self.clients("mistral").workbooks.create(
definition,
namespace=namespace
)
def _read_params_from_file(self):
with open(wf_dir + self.params_filename, 'r+') as f:
params_string = f.read()
params = json.loads(params_string)
return params
def run_workflow(self, params, namespace=''):
input = {}
self._create_execution(
self.wf_name,
wf_input=input,
namespace=namespace,
**params
)
def create_main_workflow(self, namespace=''):
with open(wf_dir + self.main_wf_file_name, 'r+') as f:
definition = f.read()
self._create_workflow(definition, namespace=namespace)
@validation.add("required_platform", platform="openstack", users=True)
@validation.add("required_services", services=[consts.Service.MISTRAL])
@scenario.configure(name="MistralExecutions.TerminateScenario",
platform="openstack")
class TerminateScenario(MistralHugeWorkflowScenario):
main_wf_file_name = 'terminate_wf.yaml'
params_filename = 'terminate_params.json'
wf_name = 'mistral_cmg_terminate'
@validation.add("required_platform", platform="openstack", users=True)
@validation.add("required_services", services=[consts.Service.MISTRAL])
@scenario.configure(name="MistralExecutions.DeployScenario",
platform="openstack")
class DeployScenario(MistralHugeWorkflowScenario):
main_wf_file_name = 'deploy_wf.yaml'
params_filename = 'deploy_params.json'
wf_name = 'mistral_cmg_deploy'

View File

@ -1,5 +1,20 @@
{% set extra_dir = "~/.rally/extra" %}
---
MistralExecutions.DeployScenario:
-
runner:
type: "constant"
times: 1
concurrency: 1
timeout: 17000
context:
users:
tenants: 1
users_per_tenant: 1
sla:
failure_rate:
max: 0
MistralWorkbooks.list_workbooks:
-
runner:
@ -195,4 +210,4 @@
users_per_tenant: 1
sla:
failure_rate:
max: 0
max: 0