CI: Add debug to the log aggregation script (#42562)

* CI: Add debug to the log aggregation script
This commit is contained in:
kwryankrattiger 2024-04-05 14:00:27 -05:00 committed by GitHub
parent c468697b35
commit c68d739825
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 5 deletions

View File

@ -27,12 +27,12 @@ ci:
- - spack config blame mirrors
- spack --color=always --backtrace ci rebuild --tests > >(tee ${SPACK_ARTIFACTS_ROOT}/user_data/pipeline_out.txt) 2> >(tee ${SPACK_ARTIFACTS_ROOT}/user_data/pipeline_err.txt >&2)
after_script:
- - ./bin/spack python ${CI_PROJECT_DIR}/share/spack/gitlab/cloud_pipelines/scripts/common/aggregate_package_logs.spack.py
--prefix /home/software/spack:${CI_PROJECT_DIR}/opt/spack
--log install_times.json
${SPACK_ARTIFACTS_ROOT}/user_data/install_times.json
- - cat /proc/loadavg || true
- cat /proc/meminfo | grep 'MemTotal\|MemFree' || true
- - time python ${CI_PROJECT_DIR}/share/spack/gitlab/cloud_pipelines/scripts/common/aggregate_package_logs.spack.py
--prefix /home/software/spack:${CI_PROJECT_DIR}/opt/spack
--log install_times.json
${SPACK_ARTIFACTS_ROOT}/user_data/install_times.json || true
variables:
CI_JOB_SIZE: "default"
CI_GPG_KEY_ROOT: /mnt/key

View File

@ -37,10 +37,14 @@ def find_logs(prefix, filename):
# Look in the list of prefixes for logs
for prefix in prefixes:
logs = find_logs(prefix, args.log)
print(f"Walking {prefix}")
logs = [log for log in find_logs(prefix, args.log)]
print(f" * found {len(logs)} logs")
for log in logs:
print(f" * appending data for {log}")
with open(log) as fd:
data.append(json.load(fd))
print(f"Writing {args.output_file}")
with open(args.output_file, "w") as fd:
json.dump(data, fd)