Awight has submitted this change and it was merged.
Change subject: Remove activemq, make fr modules use redis
......................................................................
Remove activemq, make fr modules use redis
Change-Id: I0deb6afcb254a847446c250b7931cd8cc44a2eb0
---
D puppet/modules/activemq/lib/puppet/type/tarball.rb
D puppet/modules/activemq/manifests/init.pp
D puppet/modules/activemq/templates/activemq-upstart.conf.erb
D puppet/modules/activemq/templates/activemq.xml.erb
M puppet/modules/crm/manifests/init.pp
M puppet/modules/crm/templates/DonationInterface.settings.php.erb
M puppet/modules/payments/manifests/donation_interface.pp
M puppet/modules/payments/manifests/init.pp
M puppet/modules/role/manifests/fundraising.pp
M puppet/modules/role/settings/fundraising.yaml
M puppet/modules/smashpig/templates/SmashPig.cron.d.erb
M puppet/modules/smashpig/templates/SmashPig.yaml.erb
12 files changed, 18 insertions(+), 288 deletions(-)
Approvals:
Awight: Looks good to me, approved
jenkins-bot: Verified
diff --git a/puppet/modules/activemq/lib/puppet/type/tarball.rb
b/puppet/modules/activemq/lib/puppet/type/tarball.rb
deleted file mode 100644
index bec0237..0000000
--- a/puppet/modules/activemq/lib/puppet/type/tarball.rb
+++ /dev/null
@@ -1,63 +0,0 @@
-require 'open-uri'
-
-Puppet::Type.newtype(:tarball) do
- @doc = "Fetch and extract tarballed packages"
-
- ensurable
-
- newparam(:source) do
- desc "URL where the tarball will be found"
- end
-
- newparam(:path) do
- desc "Directory in which the tarball shall be extracted"
- end
-
- newparam(:creates) do
- desc "Will create this path when untarred"
-
- isnamevar
- end
-
- newparam(:storage) do
- desc "Directory in which to store the original tarball"
- end
-
- def create
- if not File.exists? filename
- fetch
- end
- extract
- end
-
- def creates_path
- self[:creates] || filename
- end
-
- def destroy
- File.unlink creates_path
- end
-
- def exists?
- # TODO verify signature
- File.exists? creates_path
- end
-
- def extract
- notice "Unpacking tarball #{filename} into #{self[:path]}"
- system("tar", "-C", self[:path], "-xzf", filename)
- end
-
- def fetch
- # TODO safe noclobber
-
- FileUtils.copy_stream(
- open(self[:source]),
- File.open(filename, "w+")
- )
- end
-
- def filename
- File.join(self[:storage], self[:source].split(/\//).last)
- end
-end
diff --git a/puppet/modules/activemq/manifests/init.pp
b/puppet/modules/activemq/manifests/init.pp
deleted file mode 100644
index 4d2f4b1..0000000
--- a/puppet/modules/activemq/manifests/init.pp
+++ /dev/null
@@ -1,73 +0,0 @@
-# == Class: activemq
-#
-# Provisions Apache ActiveMQ
-#
-class activemq(
- $version = '5.11.4',
- $hostname = '127.0.0.1',
- $port = '61613',
-) {
- $pkgname = "apache-activemq-${version}"
- $mirror =
"http://mirrors.ibiblio.org/apache/activemq/${version}/${pkgname}-bin.tar.gz"
-
- $destdir = '/usr/local'
- $pkgdir = "${destdir}/${pkgname}"
-
- tarball { $pkgname:
- ensure => present,
- source => $mirror,
- storage => '/vagrant/cache/apt',
- path => $destdir,
- creates => $pkgdir,
- }
-
- $config = '/etc/activemq.xml'
-
- file { $config:
- owner => root,
- group => root,
- content => template('activemq/activemq.xml.erb'),
- }
-
- package { 'default-jre-headless':
- ensure => present,
- }
-
- user { 'activemq':
- ensure => present,
- managehome => true,
- home => '/home/activemq',
- }
-
- file { [ "${pkgdir}/data", "${pkgdir}/tmp" ]:
- ensure => directory,
- owner => 'activemq',
- group => 'activemq',
- mode => '0770',
- recurse => true,
- require => Tarball[$pkgname],
- }
-
- service { 'activemq':
- ensure => running,
- enable => true,
- provider => 'upstart',
- require => [
- Package['default-jre-headless'],
- Tarball[$pkgname],
- File["${pkgdir}/data"],
- User['activemq'],
- ],
- subscribe => [
- File['/etc/init/activemq.conf'],
- File[$config],
- ],
- }
-
- file { '/etc/init/activemq.conf':
- content => template('activemq/activemq-upstart.conf.erb'),
- owner => 'root',
- group => 'root',
- mode => '0644',
- }
-}
diff --git a/puppet/modules/activemq/templates/activemq-upstart.conf.erb
b/puppet/modules/activemq/templates/activemq-upstart.conf.erb
deleted file mode 100755
index 7aa71a0..0000000
--- a/puppet/modules/activemq/templates/activemq-upstart.conf.erb
+++ /dev/null
@@ -1,8 +0,0 @@
-description "ActiveMQ STOMP server"
-
-start on (local-filesystems and net-device-up IFACE!=lo)
-
-setuid activemq
-setgid activemq
-
-exec <%= @pkgdir %>/bin/activemq-admin start
diff --git a/puppet/modules/activemq/templates/activemq.xml.erb
b/puppet/modules/activemq/templates/activemq.xml.erb
deleted file mode 100644
index 5c406f2..0000000
--- a/puppet/modules/activemq/templates/activemq.xml.erb
+++ /dev/null
@@ -1,63 +0,0 @@
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You 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.
--->
-<beans
- xmlns="http://www.springframework.org/schema/beans"
- xmlns:amq="http://activemq.apache.org/schema/core"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
- http://activemq.apache.org/schema/core
http://activemq.apache.org/schema/core/activemq-core.xsd">
-
- <bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
- <property name="locations">
- <value>file:${activemq.base}/conf/credentials.properties</value>
- </property>
- </bean>
-
- <!-- Allows us to use system properties as variables in this configuration
file -->
- <bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
-
- <broker xmlns="http://activemq.apache.org/schema/core"
- brokerName="localhost"
- dataDirectory="${activemq.base}/data">
-
- <!--
- Configure message persistence for the broker. The default
persistence
- mechanism is the KahaDB store (identified by the kahaDB tag).
- For more information, see:
-
- http://activemq.apache.org/persistence.html
- -->
- <persistenceAdapter>
- <kahaDB directory="${activemq.base}/data/kahadb"/>
- </persistenceAdapter>
-
- <!--
- The transport connectors expose ActiveMQ over a given protocol to
- clients and other brokers. For more information, see:
-
- http://activemq.apache.org/configuring-transports.html
- -->
- <transportConnectors>
- <transportConnector name="stomp" uri="stomp://<%= @hostname %>:<%=
@port %>"/>
- </transportConnectors>
-
- </broker>
-
- <import resource="jetty.xml"/>
-
-</beans>
-
diff --git a/puppet/modules/crm/manifests/init.pp
b/puppet/modules/crm/manifests/init.pp
index df53a6c..4763128 100644
--- a/puppet/modules/crm/manifests/init.pp
+++ b/puppet/modules/crm/manifests/init.pp
@@ -38,7 +38,6 @@
include ::crm::apache
include ::crm::civicrm
include ::crm::tools
- include ::activemq
git::clone { $repo:
directory => $dir,
@@ -72,29 +71,23 @@
'astropay_audit_recon_completed_dir' =>
'/var/spool/audit/astropay/completed',
'astropay_audit_recon_files_dir' =>
'/var/spool/audit/astropay/incoming/',
'astropay_audit_working_log_dir' =>
'/tmp/astropay_audit/',
- 'banner_history_queue' =>
'/queue/banner-history',
- 'donationqueue_url' =>
"tcp://${::activemq::hostname}:${::activemq::port}",
- 'fredge_payments_antifraud_queue' =>
'/queue/payments-antifraud',
- 'fredge_payments_init_queue' =>
'/queue/payments-init',
+ 'banner_history_queue' =>
'banner-history',
+ 'fredge_payments_antifraud_queue' =>
'payments-antifraud',
+ 'fredge_payments_init_queue' =>
'payments-init',
'queue2civicrm_batch' => 5,
'queue2civicrm_batch_time' => 90,
'queue2civicrm_gateways_to_monitor' =>
'adyen,amazon,astropay,globalcollect,paypal',
'queue2civicrm_gmetric_dmax' => 360,
'queue2civicrm_gmetric_tmax' => 60,
- 'queue2civicrm_subscription' =>
'/queue/donations',
- 'queue2civicrm_url' =>
"tcp://${::activemq::hostname}:${::activemq::port}",
'recurring_globalcollect_batch' => 1,
'recurring_globalcollect_batch_max' => 100,
'recurring_globalcollect_failure_retry_rate' => 1,
'recurring_globalcollect_failures_before_cancellation' => 3,
'recurring_globalcollect_run_missed_days' => 7,
- 'recurring_subscription' =>
'/queue/donations_recurring',
'refund_batch' => 0,
'refund_batch_time' => 90,
- 'refund_queue' =>
'/queue/refund',
'thank_you_days' => 14,
'thank_you_batch' => 100,
- 'unsubscribe_queue' =>
'/queue/unsubscribe',
},
require => Php::Composer::Install['crm-composer'],
}
diff --git a/puppet/modules/crm/templates/DonationInterface.settings.php.erb
b/puppet/modules/crm/templates/DonationInterface.settings.php.erb
index ad550e5..10655f1 100644
--- a/puppet/modules/crm/templates/DonationInterface.settings.php.erb
+++ b/puppet/modules/crm/templates/DonationInterface.settings.php.erb
@@ -31,9 +31,12 @@
$wgGlobalCollectGatewayAvsMap;
$wgDonationInterfaceDefaultQueueServer = array(
- 'type' => 'PHPQueue\Backend\Stomp',
- 'persistent' => 1,
- 'uri' => 'tcp://<%= scope['::activemq::hostname'] %>:<%=
scope['::activemq::port'] %>',
+ 'type' => 'PHPQueue\Backend\Predis',
+ 'servers' => array(
+ 'scheme' => 'tcp',
+ 'host' => 'localhost',
+ 'port' => 6379,
+ ),
);
$wgDonationInterfaceQueues = array(
diff --git a/puppet/modules/payments/manifests/donation_interface.pp
b/puppet/modules/payments/manifests/donation_interface.pp
index b48eef2..ba5009f 100644
--- a/puppet/modules/payments/manifests/donation_interface.pp
+++ b/puppet/modules/payments/manifests/donation_interface.pp
@@ -44,49 +44,14 @@
wgDonationInterfaceUseSyslog => true,
wgDonationInterfaceDefaultQueueServer => {
- 'type' => 'PHPQueue\Backend\Stomp',
- 'uri' => 'tcp://localhost:61613',
- 'persistent' => 1
+ 'type' => 'PHPQueue\Backend\Predis',
+ 'servers' => 'tcp://localhost',
},
wgDonationInterfaceQueues => {
- 'globalcollect-cc-limbo' => {
- 'type' => 'PHPQueue\Backend\Predis',
- 'servers' => 'tcp://localhost',
- 'expiry' => 3600,
- 'order_key' => 'date',
+ 'complete' => {
+ 'queue' => 'donations',
},
- 'pending' => {
- 'type' => 'PHPQueue\Backend\Predis',
- 'servers' => 'tcp://localhost',
- 'expiry' => 3600,
- },
- 'complete-new' => {
- 'queue' => 'donations',
- 'type' => 'PHPQueue\Backend\Predis',
- 'servers' => 'tcp://localhost',
- 'expiry' => 3600,
- },
- 'banner-history' => {
- 'type' => 'PHPQueue\Backend\Predis',
- 'servers' => 'tcp://localhost',
- 'expiry' => 3600,
- },
- 'payments-antifraud' => {
- 'type' => 'PHPQueue\Backend\Predis',
- 'servers' => 'tcp://localhost',
- 'expiry' => 3600,
- },
- 'payments-init' => {
- 'type' => 'PHPQueue\Backend\Predis',
- 'servers' => 'tcp://localhost',
- 'expiry' => 3600,
- },
- },
-
- wgDonationInterfaceQueueMirrors => {
- 'globalcollect-cc-limbo' => 'pending',
- 'complete' => 'complete-new',
},
wgDonationInterfaceOrphanCron => {
diff --git a/puppet/modules/payments/manifests/init.pp
b/puppet/modules/payments/manifests/init.pp
index 1579dd3..2330318 100644
--- a/puppet/modules/payments/manifests/init.pp
+++ b/puppet/modules/payments/manifests/init.pp
@@ -50,13 +50,8 @@
mediawiki::extension { [
'payments:ParserFunctions',
+ 'payments:FundraisingEmailUnsubscribe',
]: }
-
- mediawiki::extension { 'payments:FundraisingEmailUnsubscribe':
- settings => {
- 'wgStompServer' => 'tcp://localhost:61613',
- },
- }
mediawiki::import::text { 'payments:Main_Page':
# N.b. - Creepy abnormal multiwiki syntax
diff --git a/puppet/modules/role/manifests/fundraising.pp
b/puppet/modules/role/manifests/fundraising.pp
index 3647869..2234cb3 100644
--- a/puppet/modules/role/manifests/fundraising.pp
+++ b/puppet/modules/role/manifests/fundraising.pp
@@ -5,7 +5,7 @@
class role::fundraising {
include ::role::centralnotice
include ::role::payments
- include ::activemq
+ include ::redis
include ::crm
include ::rsyslog
include ::smashpig
diff --git a/puppet/modules/role/settings/fundraising.yaml
b/puppet/modules/role/settings/fundraising.yaml
index 07f4ac1..0009362 100644
--- a/puppet/modules/role/settings/fundraising.yaml
+++ b/puppet/modules/role/settings/fundraising.yaml
@@ -1,5 +1,2 @@
vagrant_ram: 512
-# ActiveMQ admin UI
-forward_ports:
- 8161: 8161
diff --git a/puppet/modules/smashpig/templates/SmashPig.cron.d.erb
b/puppet/modules/smashpig/templates/SmashPig.cron.d.erb
index d22e4b3..42f488d 100644
--- a/puppet/modules/smashpig/templates/SmashPig.cron.d.erb
+++ b/puppet/modules/smashpig/templates/SmashPig.cron.d.erb
@@ -3,4 +3,6 @@
# Requeue delayed messages that are due for reprocessing
2-52/10 * * * * www-data php <%=
scope.lookupvar('smashpig::dir') %>/Maintenance/RequeueDelayedMessages.php
# Run jobs to process Adyen IPN messages
-4-59/5 * * * * www-data php <%= scope.lookupvar('smashpig::dir')
%>/Maintenance/StompJobRunner.php --config-node adyen
+4-59/5 * * * * www-data php <%= scope.lookupvar('smashpig::dir')
%>/Maintenance/QueueJobRunner.php --config-node adyen --queue jobs-adyen
+# Run jobs to process PayPal IPN messages
+3-58/5 * * * * www-data php <%= scope.lookupvar('smashpig::dir')
%>/Maintenance/QueueJobRunner.php --config-node paypal --queue jobs-paypal
diff --git a/puppet/modules/smashpig/templates/SmashPig.yaml.erb
b/puppet/modules/smashpig/templates/SmashPig.yaml.erb
index b2f88bd..51210a0 100644
--- a/puppet/modules/smashpig/templates/SmashPig.yaml.erb
+++ b/puppet/modules/smashpig/templates/SmashPig.yaml.erb
@@ -34,24 +34,6 @@
<<: *REDIS
queue: 'banner-history'
- recurring:
- constructor-parameters:
- -
- - recurring-stomp
- - recurring-new
-
- refund:
- constructor-parameters:
- -
- - refund-stomp
- - refund-new
-
- verified:
- constructor-parameters:
- -
- - verified-stomp
- - donations
-
payments-init:
class: PHPQueue\Backend\Predis
constructor-parameters:
--
To view, visit https://gerrit.wikimedia.org/r/317862
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I0deb6afcb254a847446c250b7931cd8cc44a2eb0
Gerrit-PatchSet: 8
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: master
Gerrit-Owner: Ejegg <[email protected]>
Gerrit-Reviewer: Awight <[email protected]>
Gerrit-Reviewer: BryanDavis <[email protected]>
Gerrit-Reviewer: Dduvall <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits