Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Job types #2303

Merged
merged 3 commits into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions kernelci/api/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
10 changes: 8 additions & 2 deletions kernelci/config/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}

Expand All @@ -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"""
Expand All @@ -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


Expand Down
3 changes: 3 additions & 0 deletions tests/configs/jobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: {}

Expand All @@ -19,5 +21,6 @@ jobs:

kver:
template: 'kver.jinja2'
kind: 'test'
image: 'kernelci'
params: {}
Loading