Merge "Add a Rally scenario for a very big mistral workflow"
This commit is contained in:
commit
f57d49f52c
19
.zuul.yaml
19
.zuul.yaml
@ -10,8 +10,27 @@
|
|||||||
devstack_local_conf:
|
devstack_local_conf:
|
||||||
post-config:
|
post-config:
|
||||||
$MISTRAL_CONF_FILE:
|
$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:
|
engine:
|
||||||
execution_field_size_limit_kb: 8192
|
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:
|
required-projects:
|
||||||
- openstack/rally-openstack
|
- openstack/rally-openstack
|
||||||
- openstack/mistral-lib
|
- openstack/mistral-lib
|
||||||
|
60027
rally-jobs/extra/scenarios/big_wf/deploy_params.json
Executable file
60027
rally-jobs/extra/scenarios/big_wf/deploy_params.json
Executable file
File diff suppressed because it is too large
Load Diff
92176
rally-jobs/extra/scenarios/big_wf/deploy_wf.yaml
Executable file
92176
rally-jobs/extra/scenarios/big_wf/deploy_wf.yaml
Executable file
File diff suppressed because it is too large
Load Diff
46
rally-jobs/extra/scenarios/big_wf/dummy_actions.yaml
Executable file
46
rally-jobs/extra/scenarios/big_wf/dummy_actions.yaml
Executable 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"
|
37
rally-jobs/extra/scenarios/big_wf/dummy_actions_nuage.yaml
Executable file
37
rally-jobs/extra/scenarios/big_wf/dummy_actions_nuage.yaml
Executable 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"
|
2340
rally-jobs/extra/scenarios/big_wf/sub_wfs.yaml
Executable file
2340
rally-jobs/extra/scenarios/big_wf/sub_wfs.yaml
Executable file
File diff suppressed because it is too large
Load Diff
60045
rally-jobs/extra/scenarios/big_wf/terminate_params.json
Executable file
60045
rally-jobs/extra/scenarios/big_wf/terminate_params.json
Executable file
File diff suppressed because it is too large
Load Diff
6671
rally-jobs/extra/scenarios/big_wf/terminate_wf.yaml
Executable file
6671
rally-jobs/extra/scenarios/big_wf/terminate_wf.yaml
Executable file
File diff suppressed because it is too large
Load Diff
3
rally-jobs/extra/scenarios/big_wf/wf_input.json
Executable file
3
rally-jobs/extra/scenarios/big_wf/wf_input.json
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
|
||||||
|
}
|
112
rally-jobs/plugins/mistral_huge_wf_scenario.py
Executable file
112
rally-jobs/plugins/mistral_huge_wf_scenario.py
Executable 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'
|
@ -1,5 +1,20 @@
|
|||||||
{% set extra_dir = "~/.rally/extra" %}
|
{% 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:
|
MistralWorkbooks.list_workbooks:
|
||||||
-
|
-
|
||||||
runner:
|
runner:
|
||||||
@ -195,4 +210,4 @@
|
|||||||
users_per_tenant: 1
|
users_per_tenant: 1
|
||||||
sla:
|
sla:
|
||||||
failure_rate:
|
failure_rate:
|
||||||
max: 0
|
max: 0
|
Loading…
Reference in New Issue
Block a user