bots: Move zephyr-related files to api/integrations/zephyr/.

This commit is contained in:
Reid Barton 2017-05-25 19:59:08 -04:00 committed by Tim Abbott
parent 2f21290407
commit ccb4c5c26f
16 changed files with 16 additions and 15 deletions

View File

@ -18,7 +18,7 @@ open(api_key_path, "w").write(api_key + "\n")
# Setup supervisord configuration
supervisor_path = "/etc/supervisor/conf.d/%s.conf" % (program_name,)
template = "/home/zulip/zulip/bots/zmirror_private.conf.template"
template = "/home/zulip/zulip/api/integrations/zephyr/zmirror_private.conf.template"
template_data = open(template).read()
session_path = "/home/zulip/zephyr_sessions/%s" % (program_name,)

View File

@ -1,5 +1,5 @@
[program:zmirror-USERNAME]
command=/home/zulip/zulip/bots/zephyr_mirror_backend.py --root-path=/home/zulip/zulip --user=USERNAME --log-path=/home/zulip/logs/mirror-log-%(program_name)s --use-sessions --session-path=/home/zulip/zephyr_sessions/%(program_name)s --api-key-file=/home/zulip/api-keys/%(program_name)s --ignore-expired-tickets --nagios-path=/home/zulip/mirror_status/%(program_name)s --nagios-class=zulip-mirror-nagios --site=https://zephyr.zulipchat.com
command=/home/zulip/zulip/api/integrations/zephyr/zephyr_mirror_backend.py --root-path=/home/zulip/zulip --user=USERNAME --log-path=/home/zulip/logs/mirror-log-%(program_name)s --use-sessions --session-path=/home/zulip/zephyr_sessions/%(program_name)s --api-key-file=/home/zulip/api-keys/%(program_name)s --ignore-expired-tickets --nagios-path=/home/zulip/mirror_status/%(program_name)s --nagios-class=zulip-mirror-nagios --site=https://zephyr.zulipchat.com
priority=200 ; the relative start priority (default 999)
autostart=true ; start at supervisord start (default: true)
autorestart=true ; whether/when to restart (default: unexpected)

View File

@ -22,5 +22,5 @@ SHELL=/bin/bash
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h dom mon dow command
35 * * * * zulip /home/zulip/zulip/bots/zmirror-renew-kerberos
*/2 * * * * zulip /home/zulip/zulip/bots/check-mirroring --sharded &> /var/lib/nagios_state/check-mirroring-results-tmp; mv /var/lib/nagios_state/check-mirroring-results-tmp /var/lib/nagios_state/check-mirroring-results
35 * * * * zulip /home/zulip/zulip/api/integrations/zephyr/zmirror-renew-kerberos
*/2 * * * * zulip /home/zulip/zulip/api/integrations/zephyr/check-mirroring --sharded &> /var/lib/nagios_state/check-mirroring-results-tmp; mv /var/lib/nagios_state/check-mirroring-results-tmp /var/lib/nagios_state/check-mirroring-results

View File

@ -4,4 +4,4 @@ if [ "$(hostname)" = "staging.zulip.net" ]; then
else
site="https://api.zulip.com"
fi
/home/zulip/deployments/current/bots/check_send_receive.py --munin "$1" --site="$site"
/home/zulip/deployments/current/api/integrations/zephyr/check_send_receive.py --munin "$1" --site="$site"

View File

@ -98,7 +98,7 @@ define command{
define command{
command_name check_sync_public_streams
command_line /usr/lib/nagios/plugins/check_by_ssh -p $ARG1$ -l nagios -t 30 -i /var/lib/nagios/.ssh/id_rsa -H $HOSTADDRESS$ -C '/usr/lib/nagios/plugins/check_procs -u zulip -c 1:1 -a "/home/zulip/zulip/bots/sync-public-streams"'
command_line /usr/lib/nagios/plugins/check_by_ssh -p $ARG1$ -l nagios -t 30 -i /var/lib/nagios/.ssh/id_rsa -H $HOSTADDRESS$ -C '/usr/lib/nagios/plugins/check_procs -u zulip -c 1:1 -a "/home/zulip/zulip/api/integrations/zephyr/sync-public-streams"'
}
define command{

View File

@ -4,9 +4,10 @@
Nagios plugin to check that Zephyr mirror forwarding is running.
This script just checks the contents of a file. The forwarding test
itself lives in api/bots/check-mirroring and should be run out of cron.
itself lives in api/integrations/zephyr/check-mirroring and should be
run out of cron.
See bots/zephyr-mirror-crontab for the crontab details.
See puppet/zulip_ops/files/cron.d/zephyr-mirror for the crontab details.
"""
from __future__ import print_function
if False:

View File

@ -1,5 +1,5 @@
[program:zmirror]
command=/home/zulip/zulip/bots/zephyr_mirror.py --root-path=/home/zulip/ --user=tabbott/extra --forward-class-messages --log-path=/home/zulip/logs/mirror-log --on-startup-command="/home/zulip/zulip/bots/zmirror-renew-kerberos"
command=/home/zulip/zulip/api/integrations/zephyr/zephyr_mirror.py --root-path=/home/zulip/ --user=tabbott/extra --forward-class-messages --log-path=/home/zulip/logs/mirror-log --on-startup-command="/home/zulip/zulip/api/integrations/zephyr/zmirror-renew-kerberos"
priority=200 ; the relative start priority (default 999)
autostart=true ; start at supervisord start (default: true)
autorestart=true ; whether/when to restart (default: unexpected)
@ -11,7 +11,7 @@ stdout_logfile=/var/log/zulip/zmirror.log ; stdout log path, NONE for no
environment=HOME="/home/zulip",USER="zulip"
[program:sync-public-streams]
command=/home/zulip/zulip/bots/sync-public-streams
command=/home/zulip/zulip/api/integrations/zephyr/sync-public-streams
priority=200 ; the relative start priority (default 999)
autostart=true ; start at supervisord start (default: true)
autorestart=true ; whether/when to restart (default: unexpected)

View File

@ -80,7 +80,7 @@ class zulip_ops::nagios {
mode => 644,
owner => "root",
group => "root",
source => '/root/zulip/bots/zuliprc.nagios',
source => '/root/zulip/api/integrations/zephyr/zuliprc.nagios',
}
exec { "fix_nagios_permissions":

View File

@ -36,7 +36,7 @@ exclude_common += ['contrib_bots/bots']
exclude_py2 = [] # type: List[str]
exclude_py3 = """
bots/process_ccache
api/integrations/zephyr/process_ccache
""".split()
parser = argparse.ArgumentParser(description="Run mypy on files tracked by git.")

View File

@ -71,7 +71,7 @@ class ZephyrTest(ZulipTestCase):
'ssh',
'server',
'--',
'/home/zulip/zulip/bots/process_ccache',
'/home/zulip/zulip/api/integrations/zephyr/process_ccache',
'starnine',
get_user(email, realm).api_key,
'MTIzNA=='])
@ -98,7 +98,7 @@ class ZephyrTest(ZulipTestCase):
'ssh',
'server',
'--',
'/home/zulip/zulip/bots/process_ccache',
'/home/zulip/zulip/api/integrations/zephyr/process_ccache',
'starnine',
get_user(email, realm).api_key,
'MTIzNA=='])

View File

@ -47,7 +47,7 @@ def webathena_kerberos_login(request, user_profile,
# TODO: Send these data via (say) rabbitmq
try:
subprocess.check_call(["ssh", settings.PERSONAL_ZMIRROR_SERVER, "--",
"/home/zulip/zulip/bots/process_ccache",
"/home/zulip/zulip/api/integrations/zephyr/process_ccache",
force_str(user),
force_str(user_profile.api_key),
force_str(base64.b64encode(ccache))])