ci/lava: Extract LAVA proxy and LAVAJob abstractions
authorGuilherme Gallo <guilherme.gallo@collabora.com>
Tue, 4 Apr 2023 10:47:09 +0000 (07:47 -0300)
committerMarge Bot <emma+marge@anholt.net>
Wed, 19 Apr 2023 14:36:37 +0000 (14:36 +0000)
commitc03f7233ca9eea24505d085c774c279af29880e4
tree2f0703719010740db737d0a93828433671a8b578
parent6f6b892dcad679d5eee3e46248d885242aa606b1
ci/lava: Extract LAVA proxy and LAVAJob abstractions

Let's make lava_job_submitter.py cleaner with only parsing and retry
mechanism capabilities.

Moved out from the submitter script:

1. proxy functions
  - moved to lava.utils.lava_proxy.py
2. LAVAJob class definition
  - moved to lava.utils.lava_job.py
  - added structural logging capabilities into LAVAJob
  - Implemented properties for job_id, is_finished, and status, with
    corresponding setter methods that update the log dictionary.
  - Added new methods show, get_lava_time, and refresh_log for improved
    log handling and data retrieval.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22500>
.gitlab-ci/lava/lava_job_submitter.py
.gitlab-ci/lava/utils/__init__.py
.gitlab-ci/lava/utils/lava_job.py [new file with mode: 0644]
.gitlab-ci/lava/utils/lava_proxy.py [new file with mode: 0644]
.gitlab-ci/lava/utils/log_follower.py
.gitlab-ci/tests/test_lava_job_submitter.py