mesa/bin/ci
Vignesh Raman aa0c4078de ci: Add CustomLogger class and CLI tool
This commit introduces the CustomLogger class, which provides methods
for updating, creating, and managing dut jobs and phases in a structured
log in below json format.
{
  "_timestamp": "2023-10-05T06:16:42.603921",
  "dut_job_type": "rpi3",
  "farm": "igalia",
  "dut_jobs": [
    {
      "status": "pass",
      "submitter_start_time": "2023-10-05T06:16:42.745862",
      "dut_start_time": "2023-10-05T06:16:42.819964",
      "dut_submit_time": "2023-10-05T06:16:45.866096",
      "dut_end_time": "2023-10-05T06:24:13.533394",
      "dut_name": "igalia-ci01-rpi3-1gb",
      "dut_state": "finished",
      "dut_job_phases": [
        {
          "name": "boot",
          "start_time": "2023-10-05T06:16:45.865863",
          "end_time": "2023-10-05T06:17:14.801002"
        },
        {
          "name": "test",
          "start_time": "2023-10-05T06:17:14.801009",
          "end_time": "2023-10-05T06:24:13.610296"
        }
      ],
      "submitter_end_time": "2023-10-05T06:24:13.680729"
    }
  ],
  "job_combined_status": "pass",
  "dut_attempt_counter": 1
}

This class uses the existing StructuredLogger module,
which provides a robust and flexible logging utility supporting multiple
formats. It also includes a command-line tool for updating, creating,
and modifying dut jobs and phases through command-line arguments.
This can be used in ci job scripts to update information in structured logs.
Unit tests also have been added for the new class.

Currently, only LAVA jobs create structured log files, and this will be
extended for other jobs using this tool.

Signed-off-by: Vignesh Raman <vignesh.raman@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25179>
2023-12-19 10:09:35 +00:00
..
test ci: Add CustomLogger class and CLI tool 2023-12-19 10:09:35 +00:00
.gitignore bin/ci: add gitlab_gql.py.cache to the .gitignore 2023-01-16 15:27:38 +00:00
ci_run_n_monitor.py ci_run_n_monitor: allow picking a pipeline by its MR 2023-12-03 11:28:49 +00:00
ci_run_n_monitor.sh bin/ci/ci_run_n_monitor: use venv wrapper 2023-08-03 23:21:31 +00:00
custom_logger.py ci: Add CustomLogger class and CLI tool 2023-12-19 10:09:35 +00:00
download_gl_schema.sh ci: move the CI handling scripts into bin/ci 2022-12-19 16:36:19 +01:00
gitlab_common.py ci/marge_queue: add pretty_dutation() 2023-10-24 12:57:14 +00:00
gitlab_gql.py bin/gitlab_gql: print merged yaml as yaml instead of a python dict 2023-12-14 12:06:39 +00:00
gitlab_gql.sh bin/ci/gitlab_gql: use venv wrapper 2023-08-03 23:21:32 +00:00
job_details.gql ci: move the CI handling scripts into bin/ci 2022-12-19 16:36:19 +01:00
marge_queue.py ci/marge_queue: add pretty_dutation() 2023-10-24 12:57:14 +00:00
marge_queue.sh ci: ci_marge_queue.py 2023-10-14 11:28:56 +00:00
pipeline_details.gql ci/bin: gql: Improve queries for jobs/stages retrieval 2023-11-08 02:18:17 +00:00
pipeline_utils.gql ci/bin: Fix gitlab_gql methods that uses needs DAG 2023-11-08 02:18:17 +00:00
requirements.txt ci: Update the python env for ci_run_n_monitor.py 2023-11-14 00:48:15 +00:00
structured_logger.py bin/ci: Add StructuredLogger to improve log handling 2023-04-19 14:36:37 +00:00
update_traces_checksum.py ci_run_n_monitor: Poll mesa/mesa and user/mesa for pipelines at the same time. 2023-10-20 08:23:24 +00:00
update_traces_checksum.sh bin/ci/update_traces_checksum: use venv wrapper 2023-08-03 23:21:32 +00:00