Skip to content

Commit a99981f

Browse files
committed
Update Autoscaling Job
1 parent 11dc0d0 commit a99981f

File tree

8 files changed

+36
-64
lines changed

8 files changed

+36
-64
lines changed

callback_plugins/custom_logger.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class CallbackModule(CallbackBase):
3131

3232
def __init__(self):
3333
super(CallbackModule, self).__init__()
34-
self.output_dir = os.getcwd()
34+
self.output_dir = os.path.expanduser("~/")
3535
self.results = {}
3636

3737
def playbook_on_stats(self, stats):

ci/osp18_functional_tests.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

ci/report_result.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22
- name: Move callback_plugin result to log dir
33
ansible.builtin.shell:
44
cmd: |
5-
cp {{ fvt_dir }}/test_run_result.out {{ logs_dir }}/test_run_result.log
6-
cp {{ fvt_dir }}/summary_results.log {{ logs_dir }}/summary_results.log
5+
cp ~/test_run_result.out {{ autoscaling_logs_dir }}/test_run_result.log
6+
cp ~/summary_results.log {{ autoscaling_logs_dir }}/summary_results.log
77
88
- name: Grep the number of failed tasks
99
ansible.builtin.shell:
1010
cmd: |
11-
grep "Tasks Failed:" {{ fvt_dir }}/summary_results.log | awk '{print $3}'
11+
grep "Tasks Failed:" ~/summary_results.log | awk '{print $3}'
1212
register: tasks_failed
1313

1414
- name: Determine success or failure based on the number of failed tasks
1515
ansible.builtin.assert:
1616
that:
1717
- tasks_failed.stdout == "0"
18-
fail_msg: "Tasks Failed: {{ tasks_failed.stdout }}. Check the logs in {{ logs_dir }}/summary_results.log."
18+
fail_msg: "Tasks Failed: {{ tasks_failed.stdout }}. Check the logs in {{ autoscaling_logs_dir }}/summary_results.log."
1919
success_msg: "Tasks Failed: {{ tasks_failed.stdout }}. All tasks succeeded."
Lines changed: 22 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,25 @@
11
---
2-
- name: "Run functional test playbooks"
2+
- name: Run telemetry autoscaling tests on osp18
33
hosts: "{{ cifmw_target_hook_host | default('localhost') }}"
44
gather_facts: true
55
environment:
66
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
77
PATH: "{{ cifmw_path }}"
88
vars_files:
99
- vars/common.yml
10+
- vars/osp18_env.yml
1011
tasks:
11-
- name: "Create log dir"
12-
ansible.builtin.file:
13-
path: "{{ logs_dir }}"
14-
state: directory
15-
mode: "0755"
12+
- block:
13+
- name: "Create log dir"
14+
ansible.builtin.file:
15+
path: "{{ autoscaling_logs_dir }}"
16+
state: directory
17+
mode: "0755"
1618

17-
- name: "Set dynamic KUBECONFIG and PATH vars"
18-
copy:
19-
content: |
20-
cifmw_openshift_kubeconfig: "{{ cifmw_openshift_kubeconfig }}"
21-
cifmw_path: "{{ cifmw_path }}"
22-
vars_dir: "{{ fvt_dir }}/ci/vars"
23-
dest: "{{ env_vars_file }}"
19+
- name: Include vars from the extra_vars files
20+
ansible.builtin.include_vars:
21+
dir: "{{ cifmw_basedir }}/artifacts/parameters"
2422

25-
- name: Include vars from the extra_vars files
26-
ansible.builtin.include_vars:
27-
dir: "{{ cifmw_basedir }}/artifacts/parameters"
28-
29-
# Prepare the env
30-
- name: Setup the required resources before running the autoscaling functional test
31-
block:
32-
# TODO: Look at replacing this with something NOT from install_yamls.
3323
- community.general.make:
3424
chdir: '{{ ansible_env.HOME }}/{{ zuul.projects["github.com/openstack-k8s-operators/install_yamls"].src_dir }}/devsetup'
3525
target: edpm_deploy_instance
@@ -39,7 +29,7 @@
3929
- name: Patch the openstackversions to use the master containers for aodh and heat
4030
ansible.builtin.shell:
4131
cmd: |
42-
oc patch openstackversions controlplane --type merge --patch-file ci/patch-openstack-versions.yaml
32+
oc patch openstackversions controlplane --type merge --patch-file ci/patch-openstack-versions.yaml
4333
chdir: "{{ fvt_dir }}"
4434
when: "{{ patch_openstackversions | bool }}"
4535
tags:
@@ -67,24 +57,19 @@
6757
tags:
6858
- setup
6959

70-
- name: "Run telemetry tests playbook locally on the target host"
71-
ansible.builtin.shell:
72-
cmd: |
73-
ANSIBLE_CONFIG=ci/ansible.cfg ansible-playbook -v -e @"{{ env_vars_file }}" ci/osp18_functional_tests.yml
74-
chdir: "{{ fvt_dir }}"
75-
register: output
76-
77-
- name: Save ansible output to a file
78-
ansible.builtin.copy:
79-
content: "{{ output.stdout }}"
80-
dest: "{{ logs_dir }}/ansible_run.log"
81-
always:
60+
- name: "Run Telemetry Autoscaling tests"
61+
ansible.builtin.import_role:
62+
name: telemetry_autoscaling
63+
vars:
64+
vars_path: "{{ fvt_dir }}/ci/vars"
65+
tags: autoscaling
66+
always:
8267
- name: Revert the version update
8368
ansible.builtin.shell:
8469
cmd: |
8570
oc patch openstackversions controlplane --type json -p='[{"op": "replace", "path": "/spec/customContainerImages", "value": {} }]'
8671
when: "{{ patch_openstackversions | bool }}"
8772

88-
- name: Include report result
89-
ansible.builtin.include_tasks:
90-
file: report_result.yml
73+
- name: Include report result
74+
ansible.builtin.include_tasks:
75+
file: report_result.yml

ci/vars-functional-test.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
# temp: skip os-net-setup
33
cifmw_os_net_setup_config: []
44
post_deploy_run_functional_test:
5-
source: "{{ ansible_user_dir }}/{{ zuul.projects['github.com/infrawatch/feature-verification-tests'].src_dir }}/ci/run_playbooks.yml"
5+
source: "{{ ansible_user_dir }}/{{ zuul.projects['github.com/infrawatch/feature-verification-tests'].src_dir }}/ci/run_autoscaling_osp18.yml"
66
type: playbook
7+
config_file: "{{ ansible_user_dir }}/{{ zuul.projects['github.com/infrawatch/feature-verification-tests'].src_dir }}/ci/ansible.cfg"

ci/vars/common.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
---
22
fvt_dir: "{{ ansible_env.HOME }}/{{ zuul.projects['github.com/infrawatch/feature-verification-tests'].src_dir }}"
3-
logs_dir: "{{ ansible_env.HOME }}/ci-framework-data/logs/functional-tests"
4-
env_vars_file: "/tmp/env_vars.yml"
3+
autoscaling_logs_dir: "{{ ansible_env.HOME }}/ci-framework-data/logs/autoscaling_logs"

roles/telemetry_autoscaling/tasks/creating_stack.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@
3636
ansible.builtin.debug:
3737
var: result
3838

39-
#- name: Wait for 60 sec
40-
# ansible.builtin.pause:
41-
# minutes: 1
4239

4340
- name: RHOSO-12704 Verify that the stack was created successfully
4441
ansible.builtin.shell: |
@@ -49,6 +46,10 @@
4946
timeout: 30
5047
retries: 20
5148

49+
- name: Wait for 5 mins
50+
ansible.builtin.pause:
51+
minutes: 5
52+
5253
- name: RHOSO-12650 Verify that the stack resources are created
5354
ansible.builtin.shell: |
5455
# source ~/overcloudrc;
@@ -58,7 +59,7 @@
5859
timeout: 30
5960
retries: 20
6061
until: '"CREATE_COMPLETE" in result.stdout'
61-
# failed_when: '"CREATE_COMPLETE" not in result.stdout'
62+
failed_when: '"CREATE_COMPLETE" not in result.stdout'
6263

6364
- name: RHOSO-12707 Verify that ceilometer_cpu metric exist
6465
ansible.builtin.shell: |

roles/telemetry_autoscaling/tasks/post_teardown.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@
2020
ignore_errors: true
2121
retries: 50
2222
timeout: 5
23-
23+

0 commit comments

Comments
 (0)