forked from kernelci/kernelci-pipeline
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
src/scheduler.py: rename from runner
Rename "runner" to "scheduler" as this pipeline stage is really about scheduling jobs rather than running them. Also it uses the scheduler YAML config so it's a much better match for what it's doing. Having descriptive names makes it easier to maintain the code and produce meaningful documentation. Signed-off-by: Guillaume Tucker <[email protected]>
- Loading branch information
Showing
4 changed files
with
26 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
# | ||
# SPDX-License-Identifier: LGPL-2.1-or-later | ||
# | ||
# Copyright (C) 2021, 2022 Collabora Limited | ||
# Copyright (C) 2021, 2022, 2023 Collabora Limited | ||
# Author: Guillaume Tucker <[email protected]> | ||
# Author: Jeny Sadadia <[email protected]> | ||
|
||
|
@@ -22,11 +22,11 @@ | |
from base import Service | ||
|
||
|
||
class Runner(Service): | ||
"""Service to run jobs that match received events""" | ||
class Scheduler(Service): | ||
"""Service to schedule jobs that match received events""" | ||
|
||
def __init__(self, configs, args): | ||
super().__init__(configs, args, 'runner') | ||
super().__init__(configs, args, 'scheduler') | ||
self._api_config_yaml = yaml.dump(self._api_config) | ||
self._verbose = args.verbose | ||
self._output = args.output | ||
|
@@ -117,11 +117,11 @@ class cmd_loop(Command): | |
] | ||
|
||
def __call__(self, configs, args): | ||
return Runner(configs, args).run() | ||
return Scheduler(configs, args).run() | ||
|
||
|
||
if __name__ == '__main__': | ||
opts = parse_opts('runner', globals()) | ||
opts = parse_opts('scheduler', globals()) | ||
configs = kernelci.config.load('config/pipeline.yaml') | ||
status = opts.command(configs, opts) | ||
sys.exit(0 if status is True else 1) |