Add Mistral benchmark
- added Mistral client initialization - added Mistral scenarios - added unit tests Change-Id: Ie60a36504a970e6acb369adc570a556e549c20e1
This commit is contained in:
parent
a0a7a7a93d
commit
2348fd1b4a
13
rally-jobs/extra/mistral_wb.yaml
Normal file
13
rally-jobs/extra/mistral_wb.yaml
Normal file
@ -0,0 +1,13 @@
|
||||
---
|
||||
version: "2.0"
|
||||
|
||||
name: wb
|
||||
|
||||
workflows:
|
||||
wf1:
|
||||
type: direct
|
||||
tasks:
|
||||
hello:
|
||||
action: std.echo output="Hello"
|
||||
publish:
|
||||
result: $
|
46
rally-jobs/rally-mistral.yaml
Normal file
46
rally-jobs/rally-mistral.yaml
Normal file
@ -0,0 +1,46 @@
|
||||
---
|
||||
MistralWorkbooks.list_workbooks:
|
||||
-
|
||||
runner:
|
||||
type: "constant"
|
||||
times: 50
|
||||
concurrency: 10
|
||||
context:
|
||||
users:
|
||||
tenants: 1
|
||||
users_per_tenant: 1
|
||||
sla:
|
||||
failure_rate:
|
||||
max: 0
|
||||
|
||||
MistralWorkbooks.create_workbook:
|
||||
-
|
||||
args:
|
||||
definition: "/home/jenkins/.rally/extra/mistral_wb.yaml"
|
||||
runner:
|
||||
type: "constant"
|
||||
times: 50
|
||||
concurrency: 10
|
||||
context:
|
||||
users:
|
||||
tenants: 1
|
||||
users_per_tenant: 1
|
||||
sla:
|
||||
failure_rate:
|
||||
max: 0
|
||||
|
||||
-
|
||||
args:
|
||||
definition: "/home/jenkins/.rally/extra/mistral_wb.yaml"
|
||||
do_delete: true
|
||||
runner:
|
||||
type: "constant"
|
||||
times: 50
|
||||
concurrency: 10
|
||||
context:
|
||||
users:
|
||||
tenants: 1
|
||||
users_per_tenant: 1
|
||||
sla:
|
||||
failure_rate:
|
||||
max: 0
|
@ -108,6 +108,7 @@ class _Service(utils.ImmutableMixin, utils.EnumMixin):
|
||||
TROVE = "trove"
|
||||
SAHARA = "sahara"
|
||||
SWIFT = "swift"
|
||||
MISTRAL = "mistral"
|
||||
|
||||
|
||||
class _ServiceType(utils.ImmutableMixin, utils.EnumMixin):
|
||||
@ -130,6 +131,7 @@ class _ServiceType(utils.ImmutableMixin, utils.EnumMixin):
|
||||
DATABASE = "database"
|
||||
DATA_PROCESSING = "data_processing"
|
||||
OBJECT_STORE = "object-store"
|
||||
WORKFLOW_EXECUTION = "workflowv2"
|
||||
|
||||
def __init__(self):
|
||||
self.__names = {
|
||||
@ -149,7 +151,8 @@ class _ServiceType(utils.ImmutableMixin, utils.EnumMixin):
|
||||
self.S3: _Service.S3,
|
||||
self.DATABASE: _Service.TROVE,
|
||||
self.DATA_PROCESSING: _Service.SAHARA,
|
||||
self.OBJECT_STORE: _Service.SWIFT
|
||||
self.OBJECT_STORE: _Service.SWIFT,
|
||||
self.WORKFLOW_EXECUTION: _Service.MISTRAL,
|
||||
}
|
||||
|
||||
def __getitem__(self, service_type):
|
||||
|
21
samples/tasks/scenarios/mistral/create-delete-workbook.json
Normal file
21
samples/tasks/scenarios/mistral/create-delete-workbook.json
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
"MistralWorkbooks.create_workbook": [
|
||||
{
|
||||
"args": {
|
||||
"definition": "rally-jobs/extra/mistral_wb.yaml",
|
||||
"do_delete": true
|
||||
},
|
||||
"runner": {
|
||||
"type": "constant",
|
||||
"times": 50,
|
||||
"concurrency": 10
|
||||
},
|
||||
"context": {
|
||||
"users": {
|
||||
"tenants": 1,
|
||||
"users_per_tenant": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
15
samples/tasks/scenarios/mistral/create-delete-workbook.yaml
Normal file
15
samples/tasks/scenarios/mistral/create-delete-workbook.yaml
Normal file
@ -0,0 +1,15 @@
|
||||
---
|
||||
MistralWorkbooks.create_workbook:
|
||||
-
|
||||
args:
|
||||
definition: rally-jobs/extra/mistral_wb.yaml
|
||||
do_delete: true
|
||||
runner:
|
||||
type: "constant"
|
||||
times: 50
|
||||
concurrency: 10
|
||||
context:
|
||||
users:
|
||||
tenants: 1
|
||||
users_per_tenant: 1
|
||||
|
20
samples/tasks/scenarios/mistral/create-workbook.json
Normal file
20
samples/tasks/scenarios/mistral/create-workbook.json
Normal file
@ -0,0 +1,20 @@
|
||||
{
|
||||
"MistralWorkbooks.create_workbook": [
|
||||
{
|
||||
"args": {
|
||||
"definition": "rally-jobs/extra/mistral_wb.yaml"
|
||||
},
|
||||
"runner": {
|
||||
"type": "constant",
|
||||
"times": 50,
|
||||
"concurrency": 10
|
||||
},
|
||||
"context": {
|
||||
"users": {
|
||||
"tenants": 1,
|
||||
"users_per_tenant": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
14
samples/tasks/scenarios/mistral/create-workbook.yaml
Normal file
14
samples/tasks/scenarios/mistral/create-workbook.yaml
Normal file
@ -0,0 +1,14 @@
|
||||
---
|
||||
MistralWorkbooks.create_workbook:
|
||||
-
|
||||
args:
|
||||
definition: rally-jobs/extra/mistral_wb.yaml
|
||||
runner:
|
||||
type: "constant"
|
||||
times: 50
|
||||
concurrency: 10
|
||||
context:
|
||||
users:
|
||||
tenants: 1
|
||||
users_per_tenant: 1
|
||||
|
17
samples/tasks/scenarios/mistral/list-workbooks.json
Normal file
17
samples/tasks/scenarios/mistral/list-workbooks.json
Normal file
@ -0,0 +1,17 @@
|
||||
{
|
||||
"MistralWorkbooks.list_workbooks": [
|
||||
{
|
||||
"runner": {
|
||||
"type": "constant",
|
||||
"times": 50,
|
||||
"concurrency": 10
|
||||
},
|
||||
"context": {
|
||||
"users": {
|
||||
"tenants": 1,
|
||||
"users_per_tenant": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
11
samples/tasks/scenarios/mistral/list-workbooks.yaml
Normal file
11
samples/tasks/scenarios/mistral/list-workbooks.yaml
Normal file
@ -0,0 +1,11 @@
|
||||
---
|
||||
MistralWorkbooks.list_workbooks:
|
||||
-
|
||||
runner:
|
||||
type: "constant"
|
||||
times: 50
|
||||
concurrency: 10
|
||||
context:
|
||||
users:
|
||||
tenants: 1
|
||||
users_per_tenant: 1
|
@ -279,6 +279,12 @@ class FakeAvailabilityZone(FakeResource):
|
||||
self.hosts = mock.MagicMock()
|
||||
|
||||
|
||||
class FakeWorkbook(FakeResource):
|
||||
def __init__(self, manager=None):
|
||||
super(FakeWorkbook, self).__init__(manager)
|
||||
self.workbook = mock.MagicMock()
|
||||
|
||||
|
||||
class FakeManager(object):
|
||||
|
||||
def __init__(self):
|
||||
@ -806,6 +812,15 @@ class FakeAvailabilityZonesManager(FakeManager):
|
||||
return [self.zones]
|
||||
|
||||
|
||||
class FakeWorkbookManager(FakeManager):
|
||||
def __init__(self):
|
||||
super(FakeWorkbookManager, self).__init__()
|
||||
self.workbook = FakeWorkbook()
|
||||
|
||||
def list(self):
|
||||
return [self.workbook]
|
||||
|
||||
|
||||
class FakeServiceCatalog(object):
|
||||
def get_endpoints(self):
|
||||
return {"image": [{"publicURL": "http://fake.to"}],
|
||||
@ -1188,6 +1203,12 @@ class FakeTroveClient(object):
|
||||
self.instances = FakeDbInstanceManager()
|
||||
|
||||
|
||||
class FakeMistralClient(object):
|
||||
|
||||
def __init__(self):
|
||||
self.workbook = FakeWorkbookManager()
|
||||
|
||||
|
||||
class FakeClients(object):
|
||||
|
||||
def __init__(self, endpoint_=None):
|
||||
@ -1202,6 +1223,7 @@ class FakeClients(object):
|
||||
self._ceilometer = None
|
||||
self._zaqar = None
|
||||
self._trove = None
|
||||
self._mistral = None
|
||||
self._endpoint = endpoint_ or objects.Endpoint(
|
||||
"http://fake.example.org:5000/v2.0/",
|
||||
"fake_username",
|
||||
@ -1266,6 +1288,11 @@ class FakeClients(object):
|
||||
self._trove = FakeTroveClient()
|
||||
return self._trove
|
||||
|
||||
def mistral(self):
|
||||
if not self._mistral:
|
||||
self._mistral = FakeMistralClient()
|
||||
return self._mistral
|
||||
|
||||
|
||||
class FakeRunner(object):
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user