[Core] Add support for default platform and rally self job

* Added default credentials for all deployments.
* Added Dummy.openstack scenario that allows running
  openstack contexts with dummy scenario.
* Removed openstack users context from samples and jobs
  where it was not required.

Co-Authored-By: Anton Studenov <astudenov@mirantis.com>
Change-Id: I851f2c71e4db25bef17e25c143275e75b16595bf
This commit is contained in:
Anton Studenov 2017-03-27 20:04:14 +03:00
parent 48d8db3ec2
commit 4c146445ac
35 changed files with 311 additions and 284 deletions

View File

@ -263,6 +263,81 @@
failure_rate:
max: 0
Dummy.openstack:
-
args:
sleep: 0.01
runner:
type: "constant"
times: 1
concurrency: 1
context:
users:
tenants: 8
users_per_tenant: 4
sla:
failure_rate:
max: 0
-
args:
sleep: 0.6
runner:
type: "constant"
concurrency: 2
times: 4
timeout: 1
context:
users:
tenants: 1
users_per_tenant: 1
sla:
failure_rate:
max: 0
-
args:
sleep: 0.6
runner:
type: "rps"
rps: 2
times: 5
timeout: 1
context:
users:
tenants: 1
users_per_tenant: 1
sla:
failure_rate:
max: 0
-
args:
sleep: 0.01
runner:
type: "constant"
times: 1
concurrency: 1
context:
quotas:
nova:
instances: 200
cores: 200
ram: -1
floating_ips: 200
fixed_ips: 200
metadata_items: -1
injected_files: -1
injected_file_content_bytes: -1
injected_file_path_bytes: -1
key_pairs: 500
security_groups: 400
security_group_rules: 600
cinder:
gigabytes: -1
snapshots: -1
volumes: -1
sla:
failure_rate:
max: 0
Dummy.dummy:
-
args:
@ -361,80 +436,6 @@
sla:
failure_rate:
max: 0
-
args:
sleep: 0.01
runner:
type: "constant"
times: 1
concurrency: 1
context:
users:
tenants: 8
users_per_tenant: 4
sla:
failure_rate:
max: 0
-
args:
sleep: 0.01
runner:
type: "constant"
times: 1
concurrency: 1
context:
quotas:
nova:
instances: 200
cores: 200
ram: -1
floating_ips: 200
fixed_ips: 200
metadata_items: -1
injected_files: -1
injected_file_content_bytes: -1
injected_file_path_bytes: -1
key_pairs: 500
security_groups: 400
security_group_rules: 600
cinder:
gigabytes: -1
snapshots: -1
volumes: -1
sla:
failure_rate:
max: 0
-
args:
sleep: 0.6
runner:
type: "rps"
rps: 2
times: 5
timeout: 1
context:
users:
tenants: 1
users_per_tenant: 1
sla:
failure_rate:
max: 0
-
args:
sleep: 0.6
runner:
type: "constant"
concurrency: 2
times: 4
timeout: 1
context:
users:
tenants: 1
users_per_tenant: 1
sla:
failure_rate:
max: 0
-
args:
sleep: 0.75
@ -679,10 +680,6 @@
type: "constant"
times: 20
concurrency: 5
context:
users:
tenants: 1
users_per_tenant: 1
sla:
failure_rate:
min: 25

View File

@ -1,5 +1,5 @@
---
Dummy.dummy:
Dummy.openstack:
-
runner:
type: "constant"

View File

@ -1,5 +1,5 @@
---
Dummy.dummy:
Dummy.openstack:
-
runner:
type: "constant"

View File

@ -277,6 +277,82 @@
failure_rate:
max: 0
Dummy.openstack:
-
args:
sleep: 0.01
runner:
type: "constant"
times: 1
concurrency: 1
context:
users:
tenants: 8
users_per_tenant: 4
sla:
failure_rate:
max: 0
-
args:
sleep: 0.6
runner:
type: "constant"
concurrency: 2
times: 4
timeout: 1
context:
users:
tenants: 1
users_per_tenant: 1
sla:
failure_rate:
max: 0
-
args:
sleep: 0.6
runner:
type: "rps"
rps: 2
times: 5
timeout: 1
context:
users:
tenants: 1
users_per_tenant: 1
sla:
failure_rate:
max: 0
-
description: "Check 'quotas' context."
args:
sleep: 0.01
runner:
type: "constant"
times: 1
concurrency: 1
context:
quotas:
nova:
instances: 200
cores: 200
ram: -1
floating_ips: 200
fixed_ips: 200
metadata_items: -1
injected_files: -1
injected_file_content_bytes: -1
injected_file_path_bytes: -1
key_pairs: 500
security_groups: 400
security_group_rules: 600
cinder:
gigabytes: -1
snapshots: -1
volumes: -1
sla:
failure_rate:
max: 0
Dummy.dummy:
-
args:
@ -381,80 +457,6 @@
sla:
failure_rate:
max: 0
-
args:
sleep: 0.01
runner:
type: "constant"
times: 1
concurrency: 1
context:
users:
tenants: 8
users_per_tenant: 4
sla:
failure_rate:
max: 0
-
description: "Check 'quotas' context."
args:
sleep: 0.01
runner:
type: "constant"
times: 1
concurrency: 1
context:
quotas:
nova:
instances: 200
cores: 200
ram: -1
floating_ips: 200
fixed_ips: 200
metadata_items: -1
injected_files: -1
injected_file_content_bytes: -1
injected_file_path_bytes: -1
key_pairs: 500
security_groups: 400
security_group_rules: 600
cinder:
gigabytes: -1
snapshots: -1
volumes: -1
sla:
failure_rate:
max: 0
-
args:
sleep: 0.6
runner:
type: "rps"
rps: 2
times: 5
timeout: 1
context:
users:
tenants: 1
users_per_tenant: 1
sla:
failure_rate:
max: 0
-
args:
sleep: 0.6
runner:
type: "constant"
concurrency: 2
times: 4
timeout: 1
context:
users:
tenants: 1
users_per_tenant: 1
sla:
failure_rate:
max: 0
-
args:
@ -711,10 +713,6 @@
type: "constant"
times: 20
concurrency: 5
context:
users:
tenants: 1
users_per_tenant: 1
sla:
failure_rate:
min: 25

View File

@ -0,0 +1,64 @@
---
RallyProfile.generate_names_in_atomic:
-
args:
number_of_names: 100
runner:
type: "constant"
times: 1000
concurrency: 10
sla:
max_avg_duration_per_atomic:
generate_100_names: 0.015
failure_rate:
max: 0
-
args:
number_of_names: 1000
runner:
type: "constant"
times: 500
concurrency: 10
sla:
max_avg_duration_per_atomic:
generate_1000_names: 0.1
failure_rate:
max: 0
-
args:
number_of_names: 10000
runner:
type: "constant"
times: 200
concurrency: 10
sla:
max_avg_duration_per_atomic:
generate_10000_names: 1
failure_rate:
max: 0
RallyProfile.calculate_atomic:
-
args:
number_of_atomics: 100
runner:
type: "constant"
times: 300
concurrency: 10
sla:
max_avg_duration_per_atomic:
calculate_100_atomics: 0.04
failure_rate:
max: 0
-
args:
number_of_atomics: 500
runner:
type: "constant"
times: 100
concurrency: 10
sla:
max_avg_duration_per_atomic:
calculate_500_atomics: 0.5
failure_rate:
max: 0

View File

@ -0,0 +1,22 @@
# Copyright 2017: Mirantis Inc.
# All Rights Reserved.
#
# 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.
from rally.plugins.common.scenarios.dummy import dummy
from rally.task import scenario
@scenario.configure(name="Dummy.openstack", namespace="openstack")
class DummyOpenStack(dummy.Dummy):
"""Clone of Dummy.dummy for OpenStack"""

View File

@ -17,8 +17,8 @@
import os
from rally import consts
from rally.plugins.openstack import scenario
from rally.plugins.openstack.scenarios.murano import utils
from rally.task import scenario
from rally.task import validation

View File

@ -8,12 +8,6 @@
"type": "constant_for_duration",
"concurrency": 5,
"duration": 30
},
"context": {
"users": {
"tenants": 1,
"users_per_tenant": 1
}
}
}
]

View File

@ -7,7 +7,3 @@
type: "constant_for_duration"
concurrency: 5
duration: 30
context:
users:
tenants: 1
users_per_tenant: 1

View File

@ -9,12 +9,6 @@
"times": 20,
"concurrency": 5,
"timeout": 5
},
"context": {
"users": {
"tenants": 1,
"users_per_tenant": 1
}
}
}
]

View File

@ -8,7 +8,3 @@
times: 20
concurrency: 5
timeout: 5
context:
users:
tenants: 1
users_per_tenant: 1

View File

@ -9,12 +9,6 @@
"times": 20,
"rps": 3,
"timeout": 6
},
"context": {
"users": {
"tenants": 1,
"users_per_tenant": 1
}
}
}
]

View File

@ -8,7 +8,3 @@
times: 20
rps: 3
timeout: 6
context:
users:
tenants: 1
users_per_tenant: 1

View File

@ -7,12 +7,6 @@
"runner": {
"type": "serial",
"times": 20
},
"context": {
"users": {
"tenants": 1,
"users_per_tenant": 1
}
}
}
]

View File

@ -6,7 +6,3 @@
runner:
type: "serial"
times: 20
context:
users:
tenants: 1
users_per_tenant: 1

View File

@ -8,12 +8,6 @@
"type": "constant",
"times": 1000,
"concurrency": 1
},
"context": {
"users": {
"tenants": 1,
"users_per_tenant": 1
}
}
}
]

View File

@ -7,7 +7,3 @@
type: "constant"
times: 1000
concurrency: 1
context:
users:
tenants: 1
users_per_tenant: 1

View File

@ -8,12 +8,6 @@
"type": "constant",
"times": 20,
"concurrency": 5
},
"context": {
"users": {
"tenants": 1,
"users_per_tenant": 1
}
}
}
]

View File

@ -7,7 +7,3 @@
type: "constant"
times: 20
concurrency: 5
context:
users:
tenants: 1
users_per_tenant: 1

View File

@ -11,12 +11,6 @@
"type": "constant",
"times": 20,
"concurrency": 5
},
"context": {
"users": {
"tenants": 1,
"users_per_tenant": 1
}
}
}
]

View File

@ -10,7 +10,3 @@
type: "constant"
times: 20
concurrency: 5
context:
users:
tenants: 1
users_per_tenant: 1

View File

@ -0,0 +1,11 @@
{
"Dummy.openstack": [
{
"runner": {
"type": "constant",
"times": 1,
"concurrency": 1
}
}
]
}

View File

@ -0,0 +1,7 @@
---
Dummy.openstack:
-
runner:
type: "constant"
times: 1
concurrency: 1

View File

@ -8,12 +8,6 @@
"type": "constant",
"times": 50,
"concurrency": 5
},
"context": {
"users": {
"tenants": 1,
"users_per_tenant": 1
}
}
}
]

View File

@ -7,7 +7,3 @@
type: "constant"
times: 50
concurrency: 5
context:
users:
tenants: 1
users_per_tenant: 1

View File

@ -10,12 +10,6 @@
"type": "constant",
"times": 5,
"concurrency": 5
},
"context": {
"users": {
"tenants": 1,
"users_per_tenant": 1
}
}
}
]

View File

@ -9,7 +9,3 @@
type: "constant"
times: 5
concurrency: 5
context:
users:
tenants: 1
users_per_tenant: 1

View File

@ -14,12 +14,6 @@
"max_avg_duration_per_atomic": {
"action_0": 1.0
}
},
"context": {
"users": {
"tenants": 1,
"users_per_tenant": 1
}
}
}
]

View File

@ -11,7 +11,3 @@
sla:
max_avg_duration_per_atomic:
action_0: 1.0
context:
users:
tenants: 1
users_per_tenant: 1

View File

@ -8,12 +8,6 @@
"type": "constant",
"times": 20,
"concurrency": 5
},
"context": {
"users": {
"tenants": 1,
"users_per_tenant": 1
}
}
}
]

View File

@ -7,7 +7,3 @@
type: "constant"
times: 20
concurrency: 5
context:
users:
tenants: 1
users_per_tenant: 1

47
tests/ci/rally_self_job.sh Executable file
View File

@ -0,0 +1,47 @@
#!/bin/bash -ex
#
# 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.
TASK_FILE=$1
PLUGIN_PATHS=rally-jobs/plugins
if [ -n "$ZUUL_PROJECT" ]; then
HTML_REPORT=testr_results.html
else
HTML_REPORT=rally_self_results.html
fi
RND=$(head /dev/urandom | tr -dc a-z0-9 | head -c 5)
TMP_RALLY_CONF="/tmp/self-rally-$RND.conf"
TMP_RALLY_DB="/tmp/self-rally-$RND.sqlite"
TMP_RALLY_DEPLOYMENT="/tmp/self-rally-dep-$RND.json"
DBCONNSTRING="sqlite:///$TMP_RALLY_DB"
RALLY="rally --config-file $TMP_RALLY_CONF"
# Create temp db
cp etc/rally/rally.conf.sample $TMP_RALLY_CONF
sed -i.bak "s|#connection =.*|connection = \"$DBCONNSTRING\"|" $TMP_RALLY_CONF
rally-manage --config-file $TMP_RALLY_CONF db create
# Create self deployment
echo '{"type": "ExistingCloud", "creds": {}}' > $TMP_RALLY_DEPLOYMENT
$RALLY -d deployment create --file=$TMP_RALLY_DEPLOYMENT --name=self
# Run task
$RALLY -d --plugin-paths=$PLUGIN_PATHS task start $TASK_FILE
$RALLY task report --html-static --out $HTML_REPORT
if [ -n "$ZUUL_PROJECT" ]; then
gzip -9 -f $HTML_REPORT
fi
# Check sla (this may fail the job)
$RALLY task sla-check

View File

@ -65,12 +65,6 @@ class TaskTestCase(unittest.TestCase):
"times": 10,
"concurrency": 2
},
"context": {
"users": {
"tenants": 3,
"users_per_tenant": 2
}
}
}]
},
{
@ -89,12 +83,6 @@ class TaskTestCase(unittest.TestCase):
"times": 10,
"concurrency": 2
},
"context": {
"users": {
"tenants": 3,
"users_per_tenant": 2
}
}
}]
}
]

View File

@ -1846,9 +1846,13 @@ class FakeDeployment(dict):
namespace = kwargs.pop("namespace", "openstack")
kwargs["credentials"] = {
namespace: [{"admin": kwargs.pop("admin", None),
"users": kwargs.pop("users", [])}]}
"users": kwargs.pop("users", [])}],
"default": [{"admin": None, "users": []}]}
dict.__init__(self, **kwargs)
def get_platforms(self):
return [platform for platform in self["credentials"]]
def get_credentials_for(self, namespace):
return self["credentials"][namespace][0]

View File

@ -93,5 +93,4 @@ deps = bindep
commands = bindep
[testenv:self]
# TODO(astudenov): Add real script here that will run rally self test
commands = python -c 'print "SUCCESS"'
commands = {toxinidir}/tests/ci/rally_self_job.sh {toxinidir}/rally-jobs/self-rally.yaml