From 5536d9813dd203ab8124f1b09d3556640269b83e Mon Sep 17 00:00:00 2001 From: Szymon Datko Date: Fri, 10 Jul 2026 16:17:11 +0200 Subject: [PATCH] [env_op_images] Reduce POST-RUN console output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit suppress verbose console output from Kubernetes API queries and CRI-O log collection tasks to reduce POST-RUN phase output by ~80% in Zuul jobs. The suppressed data that were previously visible in `job-output.txt` were actually redundant and already collected in ci-framework-data/ artifacts anyway as: - `operator_images.yaml` - `crio_logs/*` Keeping `job-output.txt` smaller reduces impact on the web browser when opening Zuul build logs. For debugging purposes logging can be re-enabled by setting the `cifmw_nolog: false` variable. Changes: - Add `no_log` to 4 tasks `env_op_images` role. - Reworked the CRI-O log collection tasks. Impact: - 75% reduction in console output (~60k → ~15k lines) - 90% smaller file size (~20 MB → ~2 MB) - All data still preserved for subsequent tasks + dumped as artifacts Assisted-by: Claude Sonnet 4.5 Signed-off-by: Szymon Datko --- roles/env_op_images/tasks/main.yml | 3 +++ .../tasks/verify_pulled_report_crio.yml | 22 ++++++------------- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/roles/env_op_images/tasks/main.yml b/roles/env_op_images/tasks/main.yml index c87771328..38367c5b8 100644 --- a/roles/env_op_images/tasks/main.yml +++ b/roles/env_op_images/tasks/main.yml @@ -87,6 +87,7 @@ field_selectors: - status.phase=Running register: all_pods_list + no_log: "{{ cifmw_nolog | default(true) | bool }}" - name: Retrieve openstack-operator-index pod vars: @@ -111,6 +112,7 @@ field_selectors: - status.phase=Running register: pod_list + no_log: "{{ cifmw_nolog | default(true) | bool }}" - name: Get operator images and pods when: not cifmw_env_op_images_dryrun | bool @@ -144,6 +146,7 @@ loop: "{{ selected_pods }}" loop_control: label: "{{ item.metadata.name }}" + no_log: "{{ cifmw_nolog | default(true) | bool }}" - name: Write images to file vars: diff --git a/roles/env_op_images/tasks/verify_pulled_report_crio.yml b/roles/env_op_images/tasks/verify_pulled_report_crio.yml index 673a9a699..4113a9096 100644 --- a/roles/env_op_images/tasks/verify_pulled_report_crio.yml +++ b/roles/env_op_images/tasks/verify_pulled_report_crio.yml @@ -68,26 +68,18 @@ | map(attribute='metadata.name') | list }} - - name: Fetch CRI-O unit logs per node - ansible.builtin.command: + - name: Fetch and write CRI-O logs per node + ansible.builtin.shell: cmd: >- - oc adm node-logs "{{ item }}" -u crio - --since=-24h + oc adm node-logs "{{ item }}" -u crio --since=-24h + > "{{ cifmw_env_op_images_crio_logs_dir }}/{{ item | regex_replace('[^A-Za-z0-9._-]+', '_') }}.crio.log" loop: "{{ _verify_crio_node_names | default([]) }}" + loop_control: + label: "{{ item }}" timeout: 120 failed_when: false register: _verify_crio_fetch - - # Filename is sanitised to avoid path-traversal with unusual node names. - - name: Write CRI-O logs to files per node - ansible.builtin.copy: - dest: "{{ cifmw_env_op_images_crio_logs_dir }}/{{ item.item | regex_replace('[^A-Za-z0-9._-]+', '_') }}.crio.log" - content: "{{ item.stdout }}" - mode: "0644" - loop: "{{ _verify_crio_fetch.results | default([]) }}" - loop_control: - label: "{{ item.item | default('') }}" - when: item.rc | default(1) == 0 + no_log: "{{ cifmw_nolog | default(true) | bool }}" # Non-fatal: some nodes may be unreachable (e.g. NotReady). - name: Warn when node log fetch failed for a node