Skip to content

scheduler: Add service to schedule recurrent visits

Related to T3667 Depends on !106 (closed) Supersedes !438 (closed)

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

Migrated from D6583 (view on Phabricator)

Merge request reports