From 9d5c45ed3af9a2822be8d6b0ac1d813c48f9e7e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Ca=C3=B1uelo?= Date: Fri, 19 Jan 2024 10:55:19 +0100 Subject: [PATCH 1/3] kernelci.config.job: add "kind" property MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This Job property will be propagated to the node "kind" of the Node used to represent the Job. Signed-off-by: Ricardo Cañuelo --- kernelci/config/job.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/kernelci/config/job.py b/kernelci/config/job.py index bb946c8285..0ff4763733 100644 --- a/kernelci/config/job.py +++ b/kernelci/config/job.py @@ -14,9 +14,10 @@ class Job(YAMLConfigObject): yaml_tag = '!Job' # pylint: disable=too-many-arguments - def __init__(self, name, template, image=None, params=None): + def __init__(self, name, template, kind="node", image=None, params=None): self._name = name self._template = template + self._kind = kind self._image = image self._params = params or {} @@ -30,6 +31,11 @@ def template(self): """Template file name""" return self._template + @property + def kind(self): + """Job node kind""" + return self._kind + @property def image(self): """Runtime environment image name""" @@ -43,7 +49,7 @@ def params(self): @classmethod def _get_yaml_attributes(cls): attrs = super()._get_yaml_attributes() - attrs.update({'template', 'image', 'params'}) + attrs.update({'template', 'kind', 'image', 'params'}) return attrs From ef6e658f8a54b0bda1a55101693859418322f7e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Ca=C3=B1uelo?= Date: Fri, 19 Jan 2024 10:57:07 +0100 Subject: [PATCH 2/3] kernelci.api.helper: incorporate job kind in create_job_node MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ricardo Cañuelo --- kernelci/api/helper.py | 1 + 1 file changed, 1 insertion(+) diff --git a/kernelci/api/helper.py b/kernelci/api/helper.py index 8aa73fc9bf..1450609055 100644 --- a/kernelci/api/helper.py +++ b/kernelci/api/helper.py @@ -105,6 +105,7 @@ def create_job_node(self, job_config, input_node, runtime=None, platform=None): """Create a new job node based on input and configuration""" job_node = { + 'kind': job_config.kind, 'parent': input_node['id'], 'name': job_config.name, 'path': input_node['path'] + [job_config.name], From 2ccfb202f6be826cab36425e25cd0af386956076 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Ca=C3=B1uelo?= Date: Fri, 19 Jan 2024 11:22:50 +0100 Subject: [PATCH 3/3] tests: update job definitions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ricardo Cañuelo --- tests/configs/jobs.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/configs/jobs.yaml b/tests/configs/jobs.yaml index 2a76bca44b..821bde6826 100644 --- a/tests/configs/jobs.yaml +++ b/tests/configs/jobs.yaml @@ -2,12 +2,14 @@ jobs: kbuild-gcc-10-x86: template: 'kbuild.jinja2' + kind: 'kbuild' image: 'gcc-10:{arch}{fragments}' params: config: x86_64_defconfig kunit: &kunit-job template: 'kunit.jinja2' + kind: 'test' image: 'gcc-10:x86-kunit-kernelci' params: {} @@ -19,5 +21,6 @@ jobs: kver: template: 'kver.jinja2' + kind: 'test' image: 'kernelci' params: {}