diff --git a/modules.env b/modules.env index 71860fde82..0f0f6decf5 100644 --- a/modules.env +++ b/modules.env @@ -60,6 +60,7 @@ INTEGRATION_MODULES["https://git.openstack.org/openstack-infra/puppet-ansible"]= INTEGRATION_MODULES["https://git.openstack.org/openstack-infra/puppet-asterisk"]="origin/master" INTEGRATION_MODULES["https://git.openstack.org/openstack-infra/puppet-elasticsearch"]="origin/master" INTEGRATION_MODULES["https://git.openstack.org/openstack-infra/puppet-etherpad_lite"]="origin/master" +INTEGRATION_MODULES["https://git.openstack.org/openstack-infra/puppet-elastic_recheck"]="origin/master" INTEGRATION_MODULES["https://git.openstack.org/openstack-infra/puppet-gerrit"]="origin/master" INTEGRATION_MODULES["https://git.openstack.org/openstack-infra/puppet-graphite"]="origin/master" INTEGRATION_MODULES["https://git.openstack.org/openstack-infra/puppet-storyboard"]="origin/master" diff --git a/modules/elastic_recheck/files/elastic-recheck.init b/modules/elastic_recheck/files/elastic-recheck.init deleted file mode 100644 index 68712ee418..0000000000 --- a/modules/elastic_recheck/files/elastic-recheck.init +++ /dev/null @@ -1,149 +0,0 @@ -#! /bin/sh -### BEGIN INIT INFO -# Provides: elastic-recheck -# Required-Start: $remote_fs $syslog -# Required-Stop: $remote_fs $syslog -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Elastic Recheck -# Description: Classify tempest-devstack failures using ElasticSearch -### END INIT INFO - -# Jeremy Stanley - -# Do NOT "set -e" - -# PATH should only include /usr/* if it runs after the mountnfs.sh script -PATH=/sbin:/usr/sbin:/bin:/usr/bin -DESC="Elastic Recheck" -NAME=elastic-recheck -DAEMON=/usr/local/bin/$NAME -DAEMON_ARGS=/etc/$NAME/$NAME.conf -PIDFILE=/var/run/$NAME/$NAME.pid -SCRIPTNAME=/etc/init.d/$NAME -USER=recheck - -# Exit if the package is not installed -[ -x "$DAEMON" ] || exit 0 - -# Read configuration variable file if it is present -[ -r /etc/default/$NAME ] && . /etc/default/$NAME - -# Load the VERBOSE setting and other rcS variables -. /lib/init/vars.sh - -# Define LSB log_* functions. -# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. -. /lib/lsb/init-functions - -# -# Function that starts the daemon/service -# -do_start() -{ - # Return - # 0 if daemon has been started - # 1 if daemon was already running - # 2 if daemon could not be started - - mkdir -p /var/run/$NAME - chown $USER /var/run/$NAME - start-stop-daemon --start --quiet --pidfile $PIDFILE -c $USER --exec $DAEMON --test > /dev/null \ - || return 1 - start-stop-daemon --start --quiet --pidfile $PIDFILE -c $USER --exec $DAEMON -- \ - $DAEMON_ARGS \ - || return 2 - # Add code here, if necessary, that waits for the process to be ready - # to handle requests from services started subsequently which depend - # on this one. As a last resort, sleep for some time. -} - -# -# Function that stops the daemon/service -# -do_stop() -{ - # Return - # 0 if daemon has been stopped - # 1 if daemon was already stopped - # 2 if daemon could not be stopped - # other if a failure occurred - start-stop-daemon --stop --retry TERM/15/KILL/5 --pidfile $PIDFILE - RETVAL="$?" - [ "$RETVAL" = 2 ] && return 2 - rm -f /var/run/$NAME/* - return "$RETVAL" -} - -# -# Function that sends a SIGHUP to the daemon/service -# -do_reload() { - # - # If the daemon can reload its configuration without - # restarting (for example, when it is sent a SIGHUP), - # then implement that here. - # - start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME - return 0 -} - -case "$1" in - start) - [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" - do_start - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - stop) - [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" - do_stop - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - status) - status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? - ;; - #reload|force-reload) - # - # If do_reload() is not implemented then leave this commented out - # and leave 'force-reload' as an alias for 'restart'. - # - #log_daemon_msg "Reloading $DESC" "$NAME" - #do_reload - #log_end_msg $? - #;; - restart|force-reload) - # - # If the "reload" option is implemented then remove the - # 'force-reload' alias - # - log_daemon_msg "Restarting $DESC" "$NAME" - do_stop - case "$?" in - 0|1) - do_start - case "$?" in - 0) log_end_msg 0 ;; - 1) log_end_msg 1 ;; # Old process is still running - *) log_end_msg 1 ;; # Failed to start - esac - ;; - *) - # Failed to stop - log_end_msg 1 - ;; - esac - ;; - *) - #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 - echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 - exit 3 - ;; -esac - -: diff --git a/modules/elastic_recheck/files/er_safe_run.sh b/modules/elastic_recheck/files/er_safe_run.sh deleted file mode 100755 index 0a550a30c7..0000000000 --- a/modules/elastic_recheck/files/er_safe_run.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -flock /var/lib/elastic-recheck/er_safe_run.lock $@ diff --git a/modules/elastic_recheck/files/logging.config b/modules/elastic_recheck/files/logging.config deleted file mode 100644 index 977aa5ed37..0000000000 --- a/modules/elastic_recheck/files/logging.config +++ /dev/null @@ -1,52 +0,0 @@ -[loggers] -keys=root,recheckwatchbot,elastic-recheck,irc - -[handlers] -keys=console,debug,normal - -[formatters] -keys=simple - -[logger_root] -level=DEBUG -handlers=console,debug,normal - -[logger_elastic-recheck] -level=DEBUG -handlers=console,debug,normal -qualname=elastic-recheck -propagate=0 - -[logger_recheckwatchbot] -level=DEBUG -handlers=console,debug,normal -qualname=recheckwatchbot -propagate=0 - -[logger_irc] -level=DEBUG -handlers=console,debug,normal -qualname=irc -propagate=0 - -[handler_console] -level=WARNING -class=StreamHandler -formatter=simple -args=(sys.stdout,) - -[handler_debug] -level=DEBUG -class=logging.handlers.TimedRotatingFileHandler -formatter=simple -args=('/var/log/elastic-recheck/elastic-recheck_debug.log', 'midnight', 1, 30,) - -[handler_normal] -level=INFO -class=logging.handlers.TimedRotatingFileHandler -formatter=simple -args=('/var/log/elastic-recheck/elastic-recheck.log', 'midnight', 1, 30,) - -[formatter_simple] -format=%(asctime)s %(levelname)s %(name)s: %(message)s -datefmt= diff --git a/modules/elastic_recheck/files/recheckwatchbot.yaml b/modules/elastic_recheck/files/recheckwatchbot.yaml deleted file mode 100644 index 4561648474..0000000000 --- a/modules/elastic_recheck/files/recheckwatchbot.yaml +++ /dev/null @@ -1,27 +0,0 @@ -channels: - openstack-qa: - projects: - - all - events: - - positive - - negative - -messages: - # | means don't fold newlines, > means do - found_bug: | - I noticed jenkins failed, I think you hit bug(s): - - %(bugs)s - footer: >- - For more details on this and other bugs, please see - http://status.openstack.org/elastic-recheck/ - recheck_instructions: >- - If you believe we've correctly identified the failure, feel free to leave a 'recheck' - comment to run the tests again. - unrecognized: >- - Some of the tests failed in a way that we did not understand. Please help - us classify these issues so that they can be part of Elastic Recheck - http://status.openstack.org/elastic-recheck/ - no_bugs_found: >- - I noticed jenkins failed, refer to: - http://docs.openstack.org/infra/manual/developers.html#automated-testing diff --git a/modules/elastic_recheck/manifests/bot.pp b/modules/elastic_recheck/manifests/bot.pp deleted file mode 100644 index 79a6a6ceec..0000000000 --- a/modules/elastic_recheck/manifests/bot.pp +++ /dev/null @@ -1,109 +0,0 @@ -# Copyright 2013 Hewlett-Packard Development Company, L.P. -# Copyright 2013 Samsung Electronics -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -# -# Class to install and configure an instance of the elastic-recheck -# service. -# -class elastic_recheck::bot ( - $gerrit_host, - $gerrit_ssh_host_key = '', - $recheck_gerrit_user = 'elasticrecheck', - $recheck_ssh_private_key = '', - $recheck_ssh_public_key = '', - $recheck_bot_passwd, - $recheck_bot_nick, -) { - include elastic_recheck - - file { '/etc/elastic-recheck/elastic-recheck.conf': - ensure => present, - mode => '0640', - owner => 'recheck', - group => 'recheck', - content => template('elastic_recheck/elastic-recheck.conf.erb'), - require => Class['elastic_recheck'], - } - - file { '/home/recheck': - ensure => directory, - mode => '0700', - owner => 'recheck', - group => 'recheck', - require => Class['elastic_recheck'], - } - - file { '/home/recheck/.ssh': - ensure => directory, - mode => '0700', - owner => 'recheck', - group => 'recheck', - require => Class['elastic_recheck'], - } - - if $recheck_ssh_private_key != '' { - file { '/home/recheck/.ssh/id_rsa': - owner => 'recheck', - group => 'recheck', - mode => '0600', - content => $recheck_ssh_private_key, - replace => true, - require => File['/home/recheck/.ssh/'] - } - } - - if $recheck_ssh_public_key != '' { - file { '/home/recheck/.ssh/id_rsa.pub': - owner => 'recheck', - group => 'recheck', - mode => '0600', - content => $recheck_ssh_public_key, - replace => true, - require => File['/home/recheck/.ssh/'] - } - } - - if $gerrit_ssh_host_key != '' { - file { '/home/recheck/.ssh/known_hosts': - owner => 'recheck', - group => 'recheck', - mode => '0600', - content => "${gerrit_host} ${gerrit_ssh_host_key}", - replace => true, - require => File['/home/recheck/.ssh/'] - } - } - - file { '/etc/init.d/elastic-recheck': - ensure => present, - mode => '0755', - owner => 'root', - group => 'root', - source => 'puppet:///modules/elastic_recheck/elastic-recheck.init', - } - - service { 'elastic-recheck': - ensure => running, - enable => true, - subscribe => [ - File['/etc/elastic-recheck/elastic-recheck.conf'], - Exec['install_elastic-recheck'], - ], - require => [ - Class['elastic_recheck'], - File['/etc/init.d/elastic-recheck'], - File['/etc/elastic-recheck/elastic-recheck.conf'], - ], - } -} diff --git a/modules/elastic_recheck/manifests/cron.pp b/modules/elastic_recheck/manifests/cron.pp deleted file mode 100644 index 2d498272f6..0000000000 --- a/modules/elastic_recheck/manifests/cron.pp +++ /dev/null @@ -1,53 +0,0 @@ -# Copyright 2013 Hewlett-Packard Development Company, L.P. -# Copyright 2014 Samsung Electronics -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -# -# Class to install and configure an instance of the elastic-recheck -# service. -# - -class elastic_recheck::cron () { - $er_state_path = $::elastic_recheck::recheck_state_dir - $graph_all_cmd = $::elastic_recheck::graph_all_cmd - $graph_gate_cmd = $::elastic_recheck::graph_gate_cmd - $uncat_cmd = $::elastic_recheck::uncat_cmd - - cron { 'elastic-recheck-all': - user => 'recheck', - minute => ['0', '30'], - hour => '*', - command => "cd ${er_state_path} && er_safe_run.sh ${graph_all_cmd}", - environment => 'PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin', - require => Class['elastic_recheck'] - } - - cron { 'elastic-recheck-gate': - user => 'recheck', - minute => ['10', '40'], - hour => '*', - command => "cd ${er_state_path} && er_safe_run.sh ${graph_gate_cmd}", - environment => 'PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin', - require => Class['elastic_recheck'] - } - - - cron { 'elastic-recheck-uncat': - user => 'recheck', - minute => ['20', '50'], - hour => '*', - command => "cd ${er_state_path} && er_safe_run.sh ${uncat_cmd}", - environment => 'PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin', - require => Class['elastic_recheck'] - } -} diff --git a/modules/elastic_recheck/manifests/init.pp b/modules/elastic_recheck/manifests/init.pp deleted file mode 100644 index 4cdc47b0ba..0000000000 --- a/modules/elastic_recheck/manifests/init.pp +++ /dev/null @@ -1,124 +0,0 @@ -# Copyright 2013 Hewlett-Packard Development Company, L.P. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -# -# Class to install and configure an instance of the elastic-recheck -# service. -# -class elastic_recheck ( -) { - - # For all static page generation scripts we want to run them - # both on a cron schedule (see elastic_recheck::cron) and on - # any commit. So we need to define commands in a way that - # we can trigger an exec here, as well as on cron. - $recheck_state_dir = '/var/lib/elastic-recheck' - $graph_all_cmd = 'elastic-recheck-graph /opt/elastic-recheck/queries -o all-new.json && mv all-new.json all.json' - $graph_gate_cmd = 'elastic-recheck-graph /opt/elastic-recheck/queries -o gate-new.json -q gate && mv gate-new.json gate.json' - $uncat_cmd = 'elastic-recheck-uncategorized -d /opt/elastic-recheck/queries -t /usr/local/share/elastic-recheck/templates -o uncategorized-new.html && mv uncategorized-new.html uncategorized.html' - - group { 'recheck': - ensure => 'present', - } - - user { 'recheck': - ensure => present, - home => '/home/recheck', - shell => '/bin/bash', - gid => 'recheck', - require => Group['recheck'], - } - - vcsrepo { '/opt/elastic-recheck': - ensure => latest, - provider => git, - revision => 'master', - source => 'https://git.openstack.org/openstack-infra/elastic-recheck', - } - - include pip - exec { 'install_elastic-recheck' : - command => 'pip install /opt/elastic-recheck', - path => '/usr/local/bin:/usr/bin:/bin/', - refreshonly => true, - subscribe => Vcsrepo['/opt/elastic-recheck'], - require => Class['pip'], - } - - file { '/usr/local/bin/er_safe_run.sh': - ensure => present, - source => 'puppet:///modules/elastic_recheck/er_safe_run.sh', - mode => '0755', - owner => 'root', - group => 'root', - } - - file { '/var/run/elastic-recheck': - ensure => directory, - mode => '0755', - owner => 'recheck', - group => 'recheck', - require => User['recheck'], - } - - file { '/var/lib/elastic-recheck': - ensure => directory, - mode => '0755', - owner => 'recheck', - group => 'recheck', - require => User['recheck'], - } - - file { '/var/log/elastic-recheck': - ensure => directory, - mode => '0755', - owner => 'recheck', - group => 'recheck', - require => User['recheck'], - } - - file { '/etc/elastic-recheck': - ensure => directory, - mode => '0755', - owner => 'recheck', - group => 'recheck', - require => User['recheck'], - } - - file { '/etc/elastic-recheck/logging.config': - ensure => present, - mode => '0640', - owner => 'recheck', - group => 'recheck', - source => 'puppet:///modules/elastic_recheck/logging.config', - require => File['/etc/elastic-recheck'], - } - - file { '/etc/elastic-recheck/recheckwatchbot.yaml': - ensure => present, - mode => '0640', - owner => 'recheck', - group => 'recheck', - source => 'puppet:///modules/elastic_recheck/recheckwatchbot.yaml', - require => File['/etc/elastic-recheck'], - } - - file { '/etc/elastic-recheck/queries': - ensure => link, - target => '/opt/elastic-recheck/queries', - require => [ - Vcsrepo['/opt/elastic-recheck'], - File['/etc/elastic-recheck'], - ], - } -} diff --git a/modules/elastic_recheck/templates/elastic-recheck.conf.erb b/modules/elastic_recheck/templates/elastic-recheck.conf.erb deleted file mode 100644 index c1da4bb21b..0000000000 --- a/modules/elastic_recheck/templates/elastic-recheck.conf.erb +++ /dev/null @@ -1,14 +0,0 @@ -#Must use full paths -[ircbot] -nick=<%= recheck_bot_nick %> -pass=<%= recheck_bot_passwd %> -server=irc.freenode.net -port=6667 -channel_config=/etc/elastic-recheck/recheckwatchbot.yaml -log_config=/etc/elastic-recheck/logging.config - -[gerrit] -host=<%= gerrit_host %> -user=<%= recheck_gerrit_user %> -query_file=/etc/elastic-recheck/queries -key=/home/recheck/.ssh/id_rsa