Skip to content

Commit

Permalink
scheduler: Add support for runtime parameter "platforms"
Browse files Browse the repository at this point in the history
If parameter defined, we allow runtime to use only listed
platforms.
We might have limited set of platforms available in certain lab. Lab owners should have option to define such list.
As per suggestion: kernelci/kernelci-project#350 (comment)

Signed-off-by: Denys Fedoryshchenko <[email protected]>
  • Loading branch information
nuclearcat committed May 7, 2024
1 parent 424d602 commit 800c694
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,18 @@ def _run(self, sub_id):
event = self._api_helper.receive_event_data(sub_id)
for job, runtime, platform, rules in self._sched.get_schedule(event):
input_node = self._api.node.get(event['id'])
if runtime.config.lab_type == 'lava':
supported_platforms = runtime.platforms()
if supported_platforms and platform not in supported_platforms:
# TODO: debug level
self.log.info(' '.join([
input_node['id'],
runtime.config.name,
platform.name,
job.name,
f"Platform not supported in lab {runtime.config.name}",
]))
continue
if self._api_helper.should_create_node(rules, input_node):
self._run_job(job, runtime, platform, input_node)

Expand Down

0 comments on commit 800c694

Please sign in to comment.