-
Notifications
You must be signed in to change notification settings - Fork 153
[rally] Add Rally role #3996
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
lkuchlan
wants to merge
2
commits into
openstack-k8s-operators:main
Choose a base branch
from
lkuchlan:add-rally-role
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[rally] Add Rally role #3996
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| --- | ||
| - name: Ensure Cinder Rally prerequisites exist | ||
| hosts: "{{ cifmw_target_hook_host | default('localhost') }}" | ||
| gather_facts: false | ||
| vars: | ||
| _openstackclient_pod: openstackclient | ||
| tasks: | ||
| - name: Check m1.tiny flavor | ||
| kubernetes.core.k8s_exec: | ||
| kubeconfig: "{{ cifmw_openshift_kubeconfig }}" | ||
| namespace: "{{ namespace }}" | ||
| pod: "{{ _openstackclient_pod }}" | ||
| command: openstack flavor show m1.tiny | ||
| register: _flavor_show | ||
| failed_when: false | ||
| changed_when: false | ||
|
|
||
| - name: Create m1.tiny flavor if missing | ||
| when: _flavor_show.rc != 0 | ||
| kubernetes.core.k8s_exec: | ||
| kubeconfig: "{{ cifmw_openshift_kubeconfig }}" | ||
| namespace: "{{ namespace }}" | ||
| pod: "{{ _openstackclient_pod }}" | ||
| command: >- | ||
| openstack flavor create m1.tiny | ||
| --ram 512 --disk 1 --vcpus 1 --public | ||
|
|
||
| - name: Check lvmdriver-1 volume type | ||
| kubernetes.core.k8s_exec: | ||
| kubeconfig: "{{ cifmw_openshift_kubeconfig }}" | ||
| namespace: "{{ namespace }}" | ||
| pod: "{{ _openstackclient_pod }}" | ||
| command: openstack volume type show lvmdriver-1 | ||
| register: _volume_type_show | ||
| failed_when: false | ||
| changed_when: false | ||
|
|
||
| - name: Create lvmdriver-1 volume type if missing | ||
| when: _volume_type_show.rc != 0 | ||
| kubernetes.core.k8s_exec: | ||
| kubeconfig: "{{ cifmw_openshift_kubeconfig }}" | ||
| namespace: "{{ namespace }}" | ||
| pod: "{{ _openstackclient_pod }}" | ||
| command: openstack volume type create lvmdriver-1 --public | ||
|
|
||
| - name: Check if cirros image already exists | ||
| kubernetes.core.k8s_exec: | ||
| kubeconfig: "{{ cifmw_openshift_kubeconfig }}" | ||
| namespace: "{{ namespace }}" | ||
| pod: "{{ _openstackclient_pod }}" | ||
| command: openstack image show cirros-0.6.2-x86_64-disk | ||
| register: _cirros_image_exists | ||
| failed_when: false | ||
| changed_when: false | ||
|
|
||
| - name: Download cirros image to hypervisor | ||
| when: _cirros_image_exists.rc != 0 | ||
| ansible.builtin.get_url: | ||
| url: "https://github.com/cirros-dev/cirros/releases/download/0.6.2/cirros-0.6.2-x86_64-disk.img" | ||
| dest: "/tmp/cirros-0.6.2-x86_64-disk.img" | ||
| mode: "0644" | ||
|
|
||
| - name: Copy cirros image to openstackclient pod | ||
| when: _cirros_image_exists.rc != 0 | ||
| environment: | ||
| KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}" | ||
| PATH: "{{ cifmw_path }}" | ||
| ansible.builtin.command: >- | ||
| oc cp /tmp/cirros-0.6.2-x86_64-disk.img | ||
| {{ namespace }}/openstackclient:/home/cloud-admin/cirros-0.6.2-x86_64-disk.img | ||
|
|
||
| - name: Upload cirros image for Rally if missing | ||
|
evallesp marked this conversation as resolved.
|
||
| when: _cirros_image_exists.rc != 0 | ||
| kubernetes.core.k8s_exec: | ||
| kubeconfig: "{{ cifmw_openshift_kubeconfig }}" | ||
| namespace: "{{ namespace }}" | ||
| pod: "{{ _openstackclient_pod }}" | ||
| command: >- | ||
| openstack image create cirros-0.6.2-x86_64-disk | ||
| --disk-format qcow2 | ||
| --container-format bare | ||
| --file /home/cloud-admin/cirros-0.6.2-x86_64-disk.img | ||
| --public | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| --- | ||
| - name: Run Rally benchmarks | ||
| hosts: "{{ cifmw_target_hook_host | default('localhost') }}" | ||
| gather_facts: false | ||
| environment: | ||
| KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}" | ||
| PATH: "{{ cifmw_path }}" | ||
| tasks: | ||
| - name: Run rally role | ||
| ansible.builtin.include_role: | ||
| name: rally |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| # See the OWNERS docs at https://www.kubernetes.dev/docs/guide/owners/ | ||
|
|
||
| approvers: | ||
| - ciops-team | ||
|
|
||
| reviewers: | ||
| - ciops-team |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| # rally | ||
| Role to setup and run Rally benchmarking tests against an OpenStack deployment. | ||
|
|
||
| Rally is run inside the `quay.io/airshipit/xrally-openstack` container via podman. | ||
| OpenStack credentials are discovered automatically from the Kubernetes KeystoneAPI resource, | ||
| or can be supplied directly via `cifmw_rally_os_*` variables. | ||
|
|
||
| ## Prerequisites | ||
| - `oc` CLI available and pointing to the target OpenStack cluster (used for credential and CA discovery). | ||
| - `cifmw_openstack_namespace` must be set to the OpenStack namespace (typically `openstack`). | ||
|
|
||
| ### Manila prerequisites | ||
|
|
||
| If running Manila benchmarks, the `dhss_true` share type must exist before Rally runs. | ||
| Use `manila_create_default_resources.yml` with `share_type_name` and `extra_specs` overrides: | ||
|
|
||
| ```yaml | ||
| pre_tests_80_manila_share_type: | ||
| type: playbook | ||
| source: manila_create_default_resources.yml | ||
| extra_vars: | ||
| share_type_name: dhss_true | ||
| extra_specs: {} | ||
| ``` | ||
|
|
||
| ## Privilege escalation | ||
| become - Required to install podman and fix artifact directory ownership after the container run. | ||
|
|
||
| ## Parameters | ||
|
|
||
| * `cifmw_rally_artifacts_basedir`: (String) Directory where all Rally artifacts are stored. | ||
| Default: `{{ cifmw_basedir }}/tests/rally` | ||
| * `cifmw_rally_registry`: (String) Container registry. Default: `quay.io` | ||
| * `cifmw_rally_namespace`: (String) Registry namespace. Default: `airshipit` | ||
| * `cifmw_rally_container`: (String) Container image name. Default: `xrally-openstack` | ||
| * `cifmw_rally_image`: (String) Full image reference. Composed from registry/namespace/container. | ||
| * `cifmw_rally_image_tag`: (String) Container image tag. Default: `3.0.0` | ||
| * `cifmw_rally_dry_run`: (Boolean) Skip actual container execution. Default: `false` | ||
| * `cifmw_rally_remove_container`: (Boolean) Remove container after run. Default: `true` | ||
| * `cifmw_rally_fail_on_task_failure`: (Boolean) Fail the play if Rally exits non-zero. Default: `true` | ||
| * `cifmw_rally_deployment_name`: (String) Rally deployment name. Default: `cifmw` | ||
| * `cifmw_rally_concurrency`: (Integer) Concurrency passed to the Rally task via `--task-args`. Default: `1` | ||
| * `cifmw_rally_task_file`: (String) Absolute path to a custom Rally task YAML on the host. | ||
| Mutually exclusive with `cifmw_rally_openstack_tests`. Default: `""` | ||
| * `cifmw_rally_task_extra_args`: (String) Extra arguments passed verbatim to `rally task start`. Default: `""` | ||
| * `cifmw_rally_dns_servers`: (List) DNS servers used inside the Rally container. Default: `["192.168.122.10"]` | ||
| * `cifmw_rally_os_auth_url`: (String) OpenStack auth URL. Auto-discovered from KeystoneAPI if unset. | ||
| * `cifmw_rally_os_username`: (String) OpenStack username. Default: `admin` | ||
| * `cifmw_rally_os_password`: (String) OpenStack password. Auto-discovered from Kubernetes secret if unset. | ||
| * `cifmw_rally_os_project_name`: (String) OpenStack project. Default: `admin` | ||
| * `cifmw_rally_os_user_domain_name`: (String) User domain. Default: `Default` | ||
| * `cifmw_rally_os_project_domain_name`: (String) Project domain. Default: `Default` | ||
| * `cifmw_rally_os_region_name`: (String) OpenStack region. Default: `regionOne` | ||
| * `cifmw_rally_runs`: (List) List of run definitions for sequential multi-run mode. | ||
| When empty (default), the role runs once using the top-level `cifmw_rally_*` variables. | ||
| When non-empty, the role loops over the list; each entry may override any `cifmw_rally_*` | ||
| variable for that run and **must** include a `name` key used to namespace artifacts. | ||
| Default: `[]` | ||
|
|
||
| ## Standalone usage (single run) | ||
|
|
||
| ```yaml | ||
| - hosts: hypervisor | ||
| roles: | ||
| - role: rally | ||
| vars: | ||
| cifmw_rally_openstack_tests: "cinder" | ||
| cifmw_rally_concurrency: 2 | ||
| cifmw_rally_fail_on_task_failure: false | ||
| ``` | ||
|
|
||
| ## Usage via hook (multiple runs) | ||
|
|
||
| Add a `post_tests_*` hook in your job vars and define `cifmw_rally_runs`: | ||
|
|
||
| ```yaml | ||
| post_tests_90_rally_run: | ||
| type: playbook | ||
| source: rally_run.yaml | ||
| cifmw_rally_runs: | ||
| - name: cinder | ||
| cifmw_rally_openstack_tests: "cinder" | ||
| cifmw_rally_concurrency: 1 | ||
| - name: nova | ||
| cifmw_rally_openstack_tests: "nova" | ||
| cifmw_rally_concurrency: 2 | ||
| cifmw_rally_fail_on_task_failure: false | ||
| ``` | ||
|
|
||
| Each run stores its artifacts under `cifmw_rally_artifacts_basedir/<name>/`. | ||
|
|
||
| ## Custom task files | ||
|
|
||
| To use a custom Rally task file, set `cifmw_rally_task_file` to the absolute path of the | ||
| YAML on the hypervisor host (pre-stage it via an earlier hook if needed). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| --- | ||
| # Copyright Red Hat, 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. | ||
|
|
||
|
|
||
| # All variables intended for modification should be placed in this file. | ||
| # All variables within this role should have a prefix of "cifmw_rally" | ||
| cifmw_rally_artifacts_basedir: "{{ cifmw_basedir }}/tests/rally" | ||
| cifmw_rally_registry: "quay.io" | ||
| cifmw_rally_namespace: "airshipit" | ||
| cifmw_rally_container: "xrally-openstack" | ||
| cifmw_rally_image: "{{ cifmw_rally_registry }}/{{ cifmw_rally_namespace }}/{{ cifmw_rally_container }}" | ||
| cifmw_rally_image_tag: "3.0.0" | ||
| cifmw_rally_dry_run: false | ||
| cifmw_rally_remove_container: true | ||
| cifmw_rally_fail_on_task_failure: true | ||
| cifmw_rally_deployment_name: "cifmw" | ||
| cifmw_rally_concurrency: 1 | ||
| cifmw_rally_task_file: "" | ||
| cifmw_rally_openstack_tests: "" | ||
| cifmw_rally_task_extra_args: "" | ||
| cifmw_rally_dns_servers: | ||
| - "192.168.122.10" | ||
| cifmw_rally_runs: [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| --- | ||
| # Copyright Red Hat, 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. | ||
|
|
||
|
|
||
| galaxy_info: | ||
| author: CI Framework | ||
| description: CI Framework Role -- rally | ||
| company: Red Hat | ||
| license: Apache-2.0 | ||
| min_ansible_version: "2.14" | ||
| namespace: cifmw | ||
| galaxy_tags: | ||
| - cifmw | ||
| - rally | ||
|
|
||
| dependencies: [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| --- | ||
| # Copyright Red Hat, 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. | ||
|
|
||
|
|
||
| - name: Converge | ||
| hosts: all | ||
| vars: | ||
| cifmw_rally_dry_run: true | ||
|
evallesp marked this conversation as resolved.
|
||
| cifmw_rally_openstack_tests: "cinder" | ||
| roles: | ||
| - role: "rally" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| --- | ||
| # Mainly used to override the defaults set in .config/molecule/ | ||
| # By default, it uses the "config_podman.yml" - in CI, it will use | ||
| # "config_local.yml". | ||
| log: true | ||
|
|
||
| provisioner: | ||
| name: ansible | ||
| log: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| --- | ||
| # Copyright Red Hat, 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. | ||
|
|
||
|
|
||
| - name: Prepare | ||
| hosts: all | ||
| vars: | ||
| cifmw_basedir: "{{ ansible_user_dir }}/ci-framework-data" | ||
| cifmw_install_yamls_tasks_out: "{{ ansible_user_dir }}/zuul-jobs/roles/install_yamls_makes/tasks" | ||
| cifmw_install_yamls_defaults: | ||
| NAMESPACE: openstack | ||
| roles: | ||
| - role: test_deps | ||
| - role: ci_setup | ||
| - role: install_yamls |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.