|
| 1 | +# rally |
| 2 | +Role to setup and run Rally benchmarking tests against an OpenStack deployment. |
| 3 | + |
| 4 | +Rally is run inside the `quay.io/airshipit/xrally-openstack` container via podman. |
| 5 | +OpenStack credentials are discovered automatically from the Kubernetes KeystoneAPI resource, |
| 6 | +or can be supplied directly via `cifmw_rally_os_*` variables. |
| 7 | + |
| 8 | +## Prerequisites |
| 9 | +- `oc` CLI available and pointing to the target OpenStack cluster (used for credential and CA discovery). |
| 10 | +- `cifmw_openstack_namespace` must be set to the OpenStack namespace (typically `openstack`). |
| 11 | + |
| 12 | +## Privilege escalation |
| 13 | +become - Required to install podman and fix artifact directory ownership after the container run. |
| 14 | + |
| 15 | +## Parameters |
| 16 | + |
| 17 | +* `cifmw_rally_artifacts_basedir`: (String) Directory where all Rally artifacts are stored. |
| 18 | + Default: `{{ cifmw_basedir }}/tests/rally` |
| 19 | +* `cifmw_rally_registry`: (String) Container registry. Default: `quay.io` |
| 20 | +* `cifmw_rally_namespace`: (String) Registry namespace. Default: `airshipit` |
| 21 | +* `cifmw_rally_container`: (String) Container image name. Default: `xrally-openstack` |
| 22 | +* `cifmw_rally_image`: (String) Full image reference. Composed from registry/namespace/container. |
| 23 | +* `cifmw_rally_image_tag`: (String) Container image tag. Default: `3.0.0` |
| 24 | +* `cifmw_rally_dry_run`: (Boolean) Skip actual container execution. Default: `false` |
| 25 | +* `cifmw_rally_remove_container`: (Boolean) Remove container after run. Default: `true` |
| 26 | +* `cifmw_rally_fail_on_task_failure`: (Boolean) Fail the play if Rally exits non-zero. Default: `true` |
| 27 | +* `cifmw_rally_deployment_name`: (String) Rally deployment name. Default: `cifmw` |
| 28 | +* `cifmw_rally_concurrency`: (Integer) Concurrency passed to the Rally task via `--task-args`. Default: `1` |
| 29 | +* `cifmw_rally_task_file`: (String) Filename of the Rally task YAML inside the tasks directory. |
| 30 | + Must exist in the role's `files/` directory or be pre-staged in `cifmw_rally_artifacts_basedir/tasks/` |
| 31 | + via a pre-test hook. Default: `default-task.yaml` |
| 32 | +* `cifmw_rally_task_extra_args`: (String) Extra arguments passed verbatim to `rally task start`. Default: `""` |
| 33 | +* `cifmw_rally_dns_servers`: (List) DNS servers used inside the Rally container. Default: `["192.168.122.10"]` |
| 34 | +* `cifmw_rally_os_auth_url`: (String) OpenStack auth URL. Auto-discovered from KeystoneAPI if unset. |
| 35 | +* `cifmw_rally_os_username`: (String) OpenStack username. Default: `admin` |
| 36 | +* `cifmw_rally_os_password`: (String) OpenStack password. Auto-discovered from Kubernetes secret if unset. |
| 37 | +* `cifmw_rally_os_project_name`: (String) OpenStack project. Default: `admin` |
| 38 | +* `cifmw_rally_os_user_domain_name`: (String) User domain. Default: `Default` |
| 39 | +* `cifmw_rally_os_project_domain_name`: (String) Project domain. Default: `Default` |
| 40 | +* `cifmw_rally_os_region_name`: (String) OpenStack region. Default: `regionOne` |
| 41 | + |
| 42 | +## Standalone usage |
| 43 | + |
| 44 | +```yaml |
| 45 | +- hosts: hypervisor |
| 46 | + roles: |
| 47 | + - role: rally |
| 48 | + vars: |
| 49 | + cifmw_rally_concurrency: 2 |
| 50 | + cifmw_rally_task_file: my-benchmark.yaml |
| 51 | + cifmw_rally_fail_on_task_failure: false |
| 52 | +``` |
| 53 | +
|
| 54 | +Set `cifmw_run_test_role: rally` in a scenario `05-tests.yaml` to invoke this role |
| 55 | +from the cifmw_setup workflow without using the test_operator. |
| 56 | + |
| 57 | +## Usage as a test_operator stage |
| 58 | + |
| 59 | +Add a `rally` stage to `cifmw_test_operator_stages` in your scenario's `05-tests.yaml`: |
| 60 | + |
| 61 | +```yaml |
| 62 | +cifmw_run_tests: true |
| 63 | +cifmw_run_test_role: test_operator |
| 64 | +cifmw_test_operator_stages: |
| 65 | + - name: tempest |
| 66 | + type: tempest |
| 67 | + - name: rally |
| 68 | + type: rally |
| 69 | + test_vars: |
| 70 | + cifmw_test_operator_rally_concurrency: 2 |
| 71 | + cifmw_test_operator_rally_fail_on_task_failure: false |
| 72 | +``` |
| 73 | + |
| 74 | +## Custom task files |
| 75 | + |
| 76 | +To use a custom Rally task file, either: |
| 77 | + |
| 78 | +1. Add it to the role's `files/` directory and set `cifmw_rally_task_file` to its filename. |
| 79 | +2. Pre-stage it in `cifmw_rally_artifacts_basedir/tasks/` via a `pre_test_stage_hooks` hook |
| 80 | + and set `cifmw_rally_task_file` to the filename. |
0 commit comments