From dbdac76c912efee1d67f41cd2c64d81909937142 Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Tue, 16 Jun 2015 20:16:08 +0000 Subject: [PATCH] Try dynamic fedmsg endpoints out on nuancier. --- inventory/group_vars/nuancier | 15 +++++++++------ inventory/group_vars/nuancier-stg | 15 +++++++++------ roles/fedmsg/base/tasks/main.yml | 9 +++++++++ .../base/templates/endpoints-nuancier.py.j2 | 18 ------------------ roles/nuancier/templates/nuancier.conf | 2 +- 5 files changed, 28 insertions(+), 31 deletions(-) delete mode 100644 roles/fedmsg/base/templates/endpoints-nuancier.py.j2 diff --git a/inventory/group_vars/nuancier b/inventory/group_vars/nuancier index 4d90e9cff7..c774420efc 100644 --- a/inventory/group_vars/nuancier +++ b/inventory/group_vars/nuancier @@ -4,15 +4,18 @@ lvm_size: 20000 mem_size: 2048 num_cpus: 2 -# for systems that do not match the above - specify the same parameter in -# the host_vars/$hostname file +# Definining these vars has a number of effects +# 1) mod_wsgi is configured to use the vars for its own setup +# 2) iptables opens enough ports for all threads for fedmsg +# 3) roles/fedmsg/base/ declares enough fedmsg endpoints for all threads +wsgi_fedmsg_service: nuancier +wsgi_procs: 2 +wsgi_threads: 2 -tcp_ports: [ 80, 443, +tcp_ports: [ 80, # This port is required by gluster 6996, - # These 16 ports are used by fedmsg. One for each wsgi thread. - 3000, 3001, 3002, 3003, 3004, 3005, 3006, 3007, - 3008, 3009, 3010, 3011, 3012, 3013, 3014, 3015] + ] fas_client_groups: sysadmin-noc,sysadmin-web diff --git a/inventory/group_vars/nuancier-stg b/inventory/group_vars/nuancier-stg index 9fd9ca5280..6d2faaf9cd 100644 --- a/inventory/group_vars/nuancier-stg +++ b/inventory/group_vars/nuancier-stg @@ -4,15 +4,18 @@ lvm_size: 20000 mem_size: 1024 num_cpus: 2 -# for systems that do not match the above - specify the same parameter in -# the host_vars/$hostname file +# Definining these vars has a number of effects +# 1) mod_wsgi is configured to use the vars for its own setup +# 2) iptables opens enough ports for all threads for fedmsg +# 3) roles/fedmsg/base/ declares enough fedmsg endpoints for all threads +wsgi_fedmsg_service: nuancier +wsgi_procs: 2 +wsgi_threads: 2 -tcp_ports: [ 80, 443, +tcp_ports: [ 80, # This port is required by gluster 6996, - # These 16 ports are used by fedmsg. One for each wsgi thread. - 3000, 3001, 3002, 3003, 3004, 3005, 3006, 3007, - 3008, 3009, 3010, 3011, 3012, 3013, 3014, 3015] + ] fas_client_groups: sysadmin-noc,sysadmin-web diff --git a/roles/fedmsg/base/tasks/main.yml b/roles/fedmsg/base/tasks/main.yml index 365a58137a..0a72abeff6 100644 --- a/roles/fedmsg/base/tasks/main.yml +++ b/roles/fedmsg/base/tasks/main.yml @@ -34,6 +34,15 @@ - config - fedmsg/base +- name: remove any old static endpoints files + file: dest="/etc/fedmsg.d/{{item}}" state=absent + with_items: + - endpoints-nuancier.py + tags: + - config + - fedmsgdconfig + - fedmsg/base + # Any files that change need to restart any services that depend on them. A # trick here is that some hosts have an httpd that uses fedmsg, while others do # not. Some hosts have a fedmsg-hub that uses this config, while others do not. diff --git a/roles/fedmsg/base/templates/endpoints-nuancier.py.j2 b/roles/fedmsg/base/templates/endpoints-nuancier.py.j2 deleted file mode 100644 index 85d93ac8b3..0000000000 --- a/roles/fedmsg/base/templates/endpoints-nuancier.py.j2 +++ /dev/null @@ -1,18 +0,0 @@ -{% if env == 'staging' %} -suffix = 'stg.phx2.fedoraproject.org' -{% else %} -suffix = 'phx2.fedoraproject.org' -{% endif %} - -config = dict( - endpoints={ - "nuancier.nuancier01": [ - "tcp://nuancier01.%s:30%02i" % (suffix, i) - for i in range(16) - ], - "nuancier.nuancier02": [ - "tcp://nuancier02.%s:30%02i" % (suffix, i) - for i in range(16) - ], - }, -) diff --git a/roles/nuancier/templates/nuancier.conf b/roles/nuancier/templates/nuancier.conf index 7b50f5e5df..fdb1f069a3 100644 --- a/roles/nuancier/templates/nuancier.conf +++ b/roles/nuancier/templates/nuancier.conf @@ -1,6 +1,6 @@ Alias /nuancier/static /usr/lib/python2.7/site-packages/nuancier/static -WSGIDaemonProcess nuancier maximum-requests=1000 display-name=nuancier processes=4 threads=4 +WSGIDaemonProcess nuancier maximum-requests=1000 display-name=nuancier processes={{wsgi_procs}} threads={{wsgi_threads}} WSGISocketPrefix run/wsgi WSGIRestrictStdout On WSGIRestrictSignal Off