Skip to content

Commit 4a8cece

Browse files
committed
CI: Collect diagnostic information at end of aio jobs
Use the new diagnostics.yml playbook. (cherry picked from commit 834110b)
1 parent caa2f63 commit 4a8cece

File tree

2 files changed

+44
-12
lines changed

2 files changed

+44
-12
lines changed

.github/workflows/stackhpc-all-in-one.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ jobs:
156156
OS_APPLICATION_CREDENTIAL_SECRET: ${{ secrets.OS_APPLICATION_CREDENTIAL_SECRET }}
157157

158158
- name: Terraform Apply
159+
id: tf_apply
159160
run: |
160161
for attempt in $(seq 5); do
161162
if terraform apply -auto-approve; then
@@ -290,6 +291,7 @@ jobs:
290291
KAYOBE_AUTOMATION_SSH_PRIVATE_KEY: ${{ steps.ssh_key.outputs.ssh_key }}
291292

292293
- name: Tempest tests
294+
id: tempest
293295
run: |
294296
mkdir -p tempest-artifacts
295297
docker run -t --rm \
@@ -301,11 +303,28 @@ jobs:
301303
env:
302304
KAYOBE_AUTOMATION_SSH_PRIVATE_KEY: ${{ steps.ssh_key.outputs.ssh_key }}
303305

306+
- name: Collect diagnostic information
307+
id: diagnostics
308+
run: |
309+
mkdir -p diagnostics
310+
sudo -E docker run -t --rm \
311+
-v $(pwd):/stack/kayobe-automation-env/src/kayobe-config \
312+
-v $(pwd)/diagnostics:/stack/diagnostics \
313+
-e KAYOBE_ENVIRONMENT -e KAYOBE_VAULT_PASSWORD -e KAYOBE_AUTOMATION_SSH_PRIVATE_KEY \
314+
$KAYOBE_IMAGE \
315+
/stack/kayobe-automation-env/src/kayobe-config/.automation/pipeline/playbook-run.sh '$KAYOBE_CONFIG_PATH/ansible/diagnostics.yml'
316+
env:
317+
KAYOBE_AUTOMATION_SSH_PRIVATE_KEY: ${{ steps.ssh_key.outputs.ssh_key }}
318+
if: ${{ !cancelled() && steps.tf_apply.outcome == 'success' }}
319+
304320
- name: Upload test result artifacts
305321
uses: actions/upload-artifact@v4
306322
with:
307-
name: tempest-results-${{ inputs.os_distribution }}-${{ inputs.os_release }}-${{ inputs.neutron_plugin }}
308-
path: tempest-artifacts/*
323+
name: test-results-${{ inputs.os_distribution }}-${{ inputs.os_release }}-${{ inputs.neutron_plugin }}
324+
path: |
325+
diagnostics/
326+
tempest-artifacts/
327+
if: ${{ !cancelled() && (steps.tempest.outcome == 'success' || steps.diagnostics.outcome == 'success') }}
309328

310329
- name: Fail if any Tempest tests failed
311330
run: |

etc/kayobe/ansible/diagnostics.yml

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,30 @@
3232
LOG_DIR: "{{ diagnostics_tmpdir.path }}"
3333
CONFIG_DIR: "{{ kayobe_config_path }}/../.."
3434

35+
# FIXME: The synchronize module fails on Yoga, due to not templating
36+
# the SSH user.
37+
# - name: Download diagnostic logs to localhost
38+
# ansible.posix.synchronize:
39+
# src: "{{ diagnostics_tmpdir.path }}/"
40+
# dest: "{{ diagnostics_path_local }}/{{ inventory_hostname }}"
41+
# mode: pull
42+
# archive: no
43+
# recursive: true
44+
# copy_links: true
45+
# verify_host: true
46+
# # For jump host
47+
# #use_ssh_args: true
48+
# failed_when: false
49+
3550
- name: Download diagnostic logs to localhost
36-
ansible.posix.synchronize:
37-
src: "{{ diagnostics_tmpdir.path }}/"
38-
dest: "{{ diagnostics_path_local }}/{{ inventory_hostname }}"
39-
mode: pull
40-
archive: no
41-
recursive: true
42-
copy_links: true
43-
verify_host: true
44-
# For jump host
45-
use_ssh_args: true
51+
command:
52+
cmd: >-
53+
rsync
54+
--delay-updates -F --compress --copy-links --recursive
55+
--rsh='/usr/bin/ssh -S none'
56+
'{{ ansible_user }}@{{ ansible_host }}:{{ diagnostics_tmpdir.path }}/'
57+
'{{ diagnostics_path_local }}/{{ inventory_hostname }}'
58+
changed_when: true
4659
always:
4760
- name: Clean up temporary directory
4861
ansible.builtin.file:

0 commit comments

Comments
 (0)