Skip to content

Commit

Permalink
src/monitor.py: rename from notifier
Browse files Browse the repository at this point in the history
This service is to monitor the API Pub/Sub events rather than sending
notifications which is more what the email report service does.  As
such, rename it from notifier to monitor.

Signed-off-by: Guillaume Tucker <[email protected]>
  • Loading branch information
gctucker committed Aug 30, 2023
1 parent 8158d81 commit 47c4f2b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ version: '3'

services:

notifier: &base-service
container_name: 'kernelci-pipeline-notifier'
monitor: &base-service
container_name: 'kernelci-pipeline-monitor'
image: 'kernelci/staging-kernelci'
env_file: ['.env']
stop_signal: 'SIGINT'
command:
- './pipeline/notifier.py'
- './pipeline/monitor.py'
- '--settings=${KCI_SETTINGS:-/home/kernelci/config/kernelci.toml}'
- 'run'
volumes: &base-volumes
Expand Down
8 changes: 4 additions & 4 deletions src/notifier.py → src/monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
from base import Service


class Notifier(Service):
class Monitor(Service):
LOG_FMT = \
"{time:26s} {commit:12s} {id:24} {state:9s} {result:8s} {name}"

def __init__(self, configs, args):
super().__init__(configs, args, 'notifier')
super().__init__(configs, args, 'monitor')
self._log_titles = self.LOG_FMT.format(
time="Time", commit="Commit", id="Node Id", state="State",
result="Result", name="Name"
Expand Down Expand Up @@ -78,11 +78,11 @@ class cmd_run(Command):
args = [Args.api_config]

def __call__(self, configs, args):
return Notifier(configs, args).run(args)
return Monitor(configs, args).run(args)


if __name__ == '__main__':
opts = parse_opts('notifier', globals())
opts = parse_opts('monitor', globals())
configs = kernelci.config.load('config/pipeline.yaml')
status = opts.command(configs, opts)
sys.exit(0 if status is True else 1)

0 comments on commit 47c4f2b

Please sign in to comment.