Page MenuHomeSoftware Heritage

scheduler: Add service to schedule recurrent visits
ClosedPublic

Authored by olasd on Oct 28 2021, 4:15 PM.

Details

Summary

Related to T3667
Depends on D6582
Supersedes D6574

Test Plan

octocatalog-diff on saatchi:

*** Running octocatalog-diff on host saatchi.internal.softwareheritage.org
I, [2021-10-28T16:15:27.641540 #307468]  INFO -- : Catalogs compiled for saatchi.internal.softwareheritage.org
I, [2021-10-28T16:15:27.957605 #307468]  INFO -- : Diffs computed for saatchi.internal.softwareheritage.org
diff origin/production/saatchi.internal.softwareheritage.org current/saatchi.internal.softwareheritage.org
*******************************************
  File[/etc/softwareheritage/scheduler/listener-runner.yml] =>
   parameters =>
     notify =>
      - ["Service[swh-scheduler-listener]", "Service[swh-scheduler-runner-priority]", "Service[swh-scheduler-runner]"]
      + ["Service[swh-scheduler-listener]", "Service[swh-scheduler-runner-priority]", "Service[swh-scheduler-runner]", "Service[swh-scheduler-schedule-recurrent]"]
*******************************************
+ File[/etc/systemd/system/swh-scheduler-schedule-recurrent.service] =>
   parameters =>
      "ensure": "file"
      "group": "root"
      "mode": "0444"
      "notify": "Class[Systemd::Systemctl::Daemon_reload]"
      "owner": "root"
      "show_diff": true
      "content": >>>
# Scheduler for recurrent visits
# Managed by puppet class profile::swh::deploy::scheduler::service (instance schedule-recurrent)
# Changes will be overwritten

[Unit]
Description=Software Heritage scheduler for recurrent visits
Requires=network.target rabbitmq-server.service
After=network.target rabbitmq-server.service

[Service]
User=swhscheduler
Group=swhscheduler
Type=simple
Environment=SWH_LOG_TARGET=journal
Environment=SWH_SENTRY_DSN=https://swh::deploy::scheduler::sentry_token@sentry.softwareheritage.org/7
Environment=SWH_SENTRY_ENVIRONMENT=production
Environment=SWH_MAIN_PACKAGE=swh.scheduler
ExecStart=/usr/bin/swh --log-level INFO scheduler --config-file /etc/softwareheritage/scheduler/listener-runner.yml schedule-recurrent
Restart=always
RestartSec=10

[Install]
WantedBy=multi-user.target
<<<
*******************************************
  Package[python3-swh.scheduler] =>
   parameters =>
     notify =>
      - ["Service[swh-scheduler-listener]", "Service[swh-scheduler-runner-priority]", "Service[swh-scheduler-runner]"]
      + ["Service[swh-scheduler-listener]", "Service[swh-scheduler-runner-priority]", "Service[swh-scheduler-runner]", "Service[swh-scheduler-schedule-recurrent]"]
*******************************************
+ Profile::Swh::Deploy::Scheduler::Service[schedule-recurrent] =>
   parameters =>
      "service_args": ["schedule-recurrent"]
      "service_description": "for recurrent visits"
      "service_name": "swh-scheduler-schedule-recurrent"
*******************************************
+ Service[swh-scheduler-schedule-recurrent] =>
   parameters =>
      "enable": true
      "ensure": "running"
*******************************************
+ Systemd::Unit_file[swh-scheduler-schedule-recurrent.service] =>
   parameters =>
      "ensure": "present"
      "group": "root"
      "mode": "0444"
      "notify": ["Service[swh-scheduler-schedule-recurrent]"]
      "owner": "root"
      "path": "/etc/systemd/system"
      "show_diff": true
      "content": >>>
# Scheduler for recurrent visits
# Managed by puppet class profile::swh::deploy::scheduler::service (instance schedule-recurrent)
# Changes will be overwritten

[Unit]
Description=Software Heritage scheduler for recurrent visits
Requires=network.target rabbitmq-server.service
After=network.target rabbitmq-server.service

[Service]
User=swhscheduler
Group=swhscheduler
Type=simple
Environment=SWH_LOG_TARGET=journal
Environment=SWH_SENTRY_DSN=https://swh::deploy::scheduler::sentry_token@sentry.softwareheritage.org/7
Environment=SWH_SENTRY_ENVIRONMENT=production
Environment=SWH_MAIN_PACKAGE=swh.scheduler
ExecStart=/usr/bin/swh --log-level INFO scheduler --config-file /etc/softwareheritage/scheduler/listener-runner.yml schedule-recurrent
Restart=always
RestartSec=10

[Install]
WantedBy=multi-user.target
<<<
*******************************************
*** End octocatalog-diff on saatchi.internal.softwareheritage.org

Diff Detail

Repository
rSPSITE puppet-swh-site
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

olasd requested review of this revision.Oct 28 2021, 4:15 PM
olasd created this revision.
This revision is now accepted and ready to land.Oct 28 2021, 4:24 PM