pbsready-export.cfg.in 2.49 KB
Newer Older
1
[buildout]
2

3
extends = ${pbsready:output}
4

5 6 7 8 9 10
# Explicitely define extended parts from pbsready
# then add local parts
parts =
  logrotate
  logrotate-entry-cron
  logrotate-entry-equeue
11
  logrotate-entry-resilient
12 13
  cron
  cron-entry-logrotate
14
  resilient-sshkeys-authority
15 16 17 18 19 20
  sshd-raw-server
  sshd-graceful
  sshkeys-sshd
  sshd-promise
  resilient-sshkeys-sshd-promise
  sshd-pbs-authorized-key
21
  notifier
22
  notifier-exporter-promise
23

24
  cron-entry-backup
25

26 27 28 29 30 31
[resilient-directory]
recipe = slapos.cookbook:mkdirectory
home = $${buildout:directory}
var = $${:home}/var
pid = $${:var}/pid

32 33 34
# Define port of ssh server. It has to be different from import so that it
# supports export/import using same IP (slaprunner, slapos-in-partition,
# ipv4...)
35 36 37 38 39
[sshd-port]
recipe = slapos.cookbook:free_port
minimum = 22200
maximum = 22209
ip = $${slap-network-information:global-ipv6}
40

41 42 43 44 45 46
[notifier-port]
recipe = slapos.cookbook:free_port
minimum = 65526
maximum = 65535
ip = $${notifier:host}

47
[resilient-publish-connection-parameter]
48 49 50
notification-id = http://[$${notifier:host}]:$${notifier:port}/get/$${notifier-exporter:name}

[notifier-exporter]
Marco Mariani's avatar
Marco Mariani committed
51 52
# notifier.notify launches an (exporter) executable, and when finished,
# notifies the the pull-backup-servers.
53 54 55 56 57 58 59
<= notifier
recipe = slapos.cookbook:notifier.notify
name = exporter
title = Dumping $${slap-parameter:namebase}
executable = $${exporter:wrapper}
wrapper = $${rootdirectory:bin}/exporter
notify = $${slap-parameter:notify}
60
pidfile = $${resilient-directory:pid}/$${:name}.pid
61
max-run = 3
62

63 64 65
[logrotate-entry-notifier]
output = $${rootdirectory:etc}/logrotate_notifier.conf

66 67 68 69 70 71 72
[notifier-exporter-promise]
recipe = slapos.recipe.template:jinja2
mode = 700
template = inline:
  #!${bash:location}/bin/bash
  EXPORTER_FEED="$${notifier-exporter:log-file}"
  FAILURE_PATTERN="FAILURE"
73 74 75
  if [ -s "$EXPORTER_FEED" ]; then
    tail -n 1 $EXPORTER_FEED | grep -vq FAILURE_PATTERN
  fi
76 77
rendered = $${basedirectory:promises}/exporter-status

78
[cron-entry-backup]
Marco Mariani's avatar
Marco Mariani committed
79 80
# Schedule the periodic database dump.
# Through notifications, this triggers (one or more) incremental backups on PBS instances.
81 82 83
<= cron
recipe = slapos.cookbook:cron.d
name = backup
84
frequency = $${slap-parameter:resiliency-backup-periodicity}
85
once-a-day = true
86
command = ${logrotate:location}/sbin/logrotate -s $${basedirectory:run}/logrotate.status $${logrotate-entry-notifier:output}; $${notifier-exporter:wrapper} --transaction-id `date +%s`
87 88

[slap-parameter]
89
# In cron.d format (i.e things like */15 * * * * are accepted).
90
resiliency-backup-periodicity =