Comment the FMN playbook and role
Signed-off-by: Aurélien Bompard <aurelien@bompard.org>
This commit is contained in:
parent
39ecc928f0
commit
e4deeb7731
12 changed files with 73 additions and 32 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
#
|
||||||
|
# Fedora Messaging Notifications (FMN)
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
- name: setup the database
|
- name: setup the database
|
||||||
hosts: db01.iad2.fedoraproject.org:db01.stg.iad2.fedoraproject.org
|
hosts: db01.iad2.fedoraproject.org:db01.stg.iad2.fedoraproject.org
|
||||||
gather_facts: no
|
gather_facts: no
|
||||||
|
@ -34,16 +39,22 @@
|
||||||
username: "fmn{{ env_suffix }}"
|
username: "fmn{{ env_suffix }}"
|
||||||
queue_name: "fmn{{ env_suffix }}"
|
queue_name: "fmn{{ env_suffix }}"
|
||||||
routing_keys:
|
routing_keys:
|
||||||
|
# The FMN queue is subscribed to everything
|
||||||
- "#"
|
- "#"
|
||||||
thresholds:
|
thresholds:
|
||||||
warning: 50
|
warning: 50
|
||||||
critical: 500
|
critical: 500
|
||||||
|
# FMN sends messages when a rule is changed, to invalidate its cache
|
||||||
sent_topics: ^org\.fedoraproject\.{{ env_short }}\.fmn\..*
|
sent_topics: ^org\.fedoraproject\.{{ env_short }}\.fmn\..*
|
||||||
tags:
|
tags:
|
||||||
- config
|
- config
|
||||||
- fedora-messaging
|
- fedora-messaging
|
||||||
- rabbitmq_cluster
|
- rabbitmq_cluster
|
||||||
|
|
||||||
|
# FMN also has an internal VHost for communication between the consumer
|
||||||
|
# (which listens to the Fedora Messaging bus on /pubsub) and the senders
|
||||||
|
# (which send messages to the various destinations such as email, IRC,
|
||||||
|
# Matrix).
|
||||||
- role: rabbit/vhost
|
- role: rabbit/vhost
|
||||||
vhost: /fmn
|
vhost: /fmn
|
||||||
tags:
|
tags:
|
||||||
|
@ -64,24 +75,9 @@
|
||||||
- fedora-messaging
|
- fedora-messaging
|
||||||
- rabbitmq_cluster
|
- rabbitmq_cluster
|
||||||
|
|
||||||
- name: Create the email queue in the fmn vhost
|
- name: Create the sending queues in the fmn vhost
|
||||||
rabbitmq_queue:
|
rabbitmq_queue:
|
||||||
name: email
|
name: "{{ item }}"
|
||||||
vhost: /fmn
|
|
||||||
auto_delete: no
|
|
||||||
durable: yes
|
|
||||||
# message_ttl: 300000
|
|
||||||
state: present
|
|
||||||
login_user: admin
|
|
||||||
login_password: "{{ (env == 'production')|ternary(rabbitmq_admin_password_production, rabbitmq_admin_password_staging) }}"
|
|
||||||
tags:
|
|
||||||
- config
|
|
||||||
- fedora-messaging
|
|
||||||
- rabbitmq_cluster
|
|
||||||
|
|
||||||
- name: Create the irc queue in the fmn vhost
|
|
||||||
rabbitmq_queue:
|
|
||||||
name: irc
|
|
||||||
vhost: /fmn
|
vhost: /fmn
|
||||||
auto_delete: no
|
auto_delete: no
|
||||||
durable: yes
|
durable: yes
|
||||||
|
@ -89,6 +85,10 @@
|
||||||
state: present
|
state: present
|
||||||
login_user: admin
|
login_user: admin
|
||||||
login_password: "{{ (env == 'production')|ternary(rabbitmq_admin_password_production, rabbitmq_admin_password_staging) }}"
|
login_password: "{{ (env == 'production')|ternary(rabbitmq_admin_password_production, rabbitmq_admin_password_staging) }}"
|
||||||
|
with_items:
|
||||||
|
- email
|
||||||
|
- irc
|
||||||
|
- matrix
|
||||||
tags:
|
tags:
|
||||||
- config
|
- config
|
||||||
- fedora-messaging
|
- fedora-messaging
|
||||||
|
@ -146,7 +146,6 @@
|
||||||
serviceport: web
|
serviceport: web
|
||||||
annotations:
|
annotations:
|
||||||
haproxy.router.openshift.io/timeout: 5m
|
haproxy.router.openshift.io/timeout: 5m
|
||||||
|
|
||||||
- role: openshift/route
|
- role: openshift/route
|
||||||
app: fmn
|
app: fmn
|
||||||
routename: api
|
routename: api
|
||||||
|
@ -155,7 +154,7 @@
|
||||||
serviceport: web
|
serviceport: web
|
||||||
annotations:
|
annotations:
|
||||||
haproxy.router.openshift.io/timeout: 5m
|
haproxy.router.openshift.io/timeout: 5m
|
||||||
|
# Sendria is an email sink for testing, to avoid sending actual emails.
|
||||||
- role: openshift/route
|
- role: openshift/route
|
||||||
app: fmn
|
app: fmn
|
||||||
routename: sendria
|
routename: sendria
|
||||||
|
@ -164,6 +163,7 @@
|
||||||
serviceport: web
|
serviceport: web
|
||||||
annotations:
|
annotations:
|
||||||
haproxy.router.openshift.io/timeout: 5m
|
haproxy.router.openshift.io/timeout: 5m
|
||||||
|
when: env == "staging"
|
||||||
|
|
||||||
# Secrets
|
# Secrets
|
||||||
- role: openshift/object
|
- role: openshift/object
|
||||||
|
@ -202,7 +202,6 @@
|
||||||
# FASJSON access
|
# FASJSON access
|
||||||
- role: openshift/ipa-client
|
- role: openshift/ipa-client
|
||||||
app: fmn
|
app: fmn
|
||||||
|
|
||||||
- role: openshift/keytab
|
- role: openshift/keytab
|
||||||
app: fmn
|
app: fmn
|
||||||
key: service.keytab
|
key: service.keytab
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
apiVersion: image.openshift.io/v1
|
apiVersion: image.openshift.io/v1
|
||||||
kind: List
|
kind: List
|
||||||
items:
|
items:
|
||||||
|
# The main FMN image
|
||||||
- apiVersion: image.openshift.io/v1
|
- apiVersion: image.openshift.io/v1
|
||||||
kind: ImageStream
|
kind: ImageStream
|
||||||
metadata:
|
metadata:
|
||||||
name: fmn
|
name: fmn
|
||||||
|
# The Python 3.10 builder image
|
||||||
- apiVersion: image.openshift.io/v1
|
- apiVersion: image.openshift.io/v1
|
||||||
kind: ImageStream
|
kind: ImageStream
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -21,18 +23,12 @@ items:
|
||||||
scheduled: true
|
scheduled: true
|
||||||
referencePolicy:
|
referencePolicy:
|
||||||
type: Source
|
type: Source
|
||||||
|
# Sendria (to view email notifications in staging)
|
||||||
- apiVersion: image.openshift.io/v1
|
- apiVersion: image.openshift.io/v1
|
||||||
kind: ImageStream
|
kind: ImageStream
|
||||||
metadata:
|
metadata:
|
||||||
name: sendria
|
name: sendria
|
||||||
# We need to build the sendria image until this is fixed:
|
# Redis (for caching)
|
||||||
# https://github.com/msztolcman/sendria/issues/17
|
|
||||||
# spec:
|
|
||||||
# tags:
|
|
||||||
# - name: latest
|
|
||||||
# from:
|
|
||||||
# kind: DockerImage
|
|
||||||
# name: msztolcman/sendria:v2.2.2.0
|
|
||||||
- apiVersion: image.openshift.io/v1
|
- apiVersion: image.openshift.io/v1
|
||||||
kind: ImageStream
|
kind: ImageStream
|
||||||
metadata:
|
metadata:
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Required until this is fixed:
|
# Sendria expects the container to run as root
|
||||||
# https://github.com/msztolcman/sendria/issues/17
|
# https://github.com/msztolcman/sendria/issues/17
|
||||||
|
|
||||||
FROM msztolcman/sendria:v2.2.2.0
|
FROM msztolcman/sendria:v2.2.2.0
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
#
|
||||||
|
# Fedora Messaging configuration for the API component
|
||||||
|
#
|
||||||
|
|
||||||
amqp_url = "amqps://fmn{{ env_suffix }}:@rabbitmq{{ env_suffix }}.fedoraproject.org/%2Fpubsub"
|
amqp_url = "amqps://fmn{{ env_suffix }}:@rabbitmq{{ env_suffix }}.fedoraproject.org/%2Fpubsub"
|
||||||
passive_declares = true
|
passive_declares = true
|
||||||
|
|
||||||
|
|
|
@ -28,8 +28,11 @@ spec:
|
||||||
kind: ImageStreamTag
|
kind: ImageStreamTag
|
||||||
# name: python:3.10
|
# name: python:3.10
|
||||||
# namespace: openshift
|
# namespace: openshift
|
||||||
|
# OpenShift does not have Python 3.10 (yet), use our own ImageStream
|
||||||
name: python-310:latest
|
name: python-310:latest
|
||||||
env:
|
env:
|
||||||
|
# The .s2i/bin/assemble script uses this to build the frontend with the
|
||||||
|
# correct API and Ipsilon addresses.
|
||||||
- name: FEDORA_ENV
|
- name: FEDORA_ENV
|
||||||
value: "{{ env }}"
|
value: "{{ env }}"
|
||||||
output:
|
output:
|
||||||
|
@ -49,8 +52,8 @@ spec:
|
||||||
secret: "{{ fmn_stg_github_secret }}"
|
secret: "{{ fmn_stg_github_secret }}"
|
||||||
{% endif %}
|
{% endif %}
|
||||||
---
|
---
|
||||||
# We need to build the sendria image until this is fixed:
|
# Sendria, to display email notifications in staging
|
||||||
# https://github.com/msztolcman/sendria/issues/17
|
{% if env == 'staging' %}
|
||||||
apiVersion: build.openshift.io/v1
|
apiVersion: build.openshift.io/v1
|
||||||
kind: BuildConfig
|
kind: BuildConfig
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -60,6 +63,7 @@ metadata:
|
||||||
build: sendria
|
build: sendria
|
||||||
spec:
|
spec:
|
||||||
runPolicy: Serial
|
runPolicy: Serial
|
||||||
|
# We build the sendria image with a few fixes.
|
||||||
source:
|
source:
|
||||||
type: Dockerfile
|
type: Dockerfile
|
||||||
dockerfile: |-
|
dockerfile: |-
|
||||||
|
@ -73,3 +77,4 @@ spec:
|
||||||
triggers:
|
triggers:
|
||||||
- type: ConfigChange
|
- type: ConfigChange
|
||||||
- type: ImageChange
|
- type: ImageChange
|
||||||
|
{% endif %}
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
#
|
||||||
|
# Fedora Messaging configuration for the consumer component
|
||||||
|
#
|
||||||
|
|
||||||
amqp_url = "amqps://fmn{{ env_suffix }}:@rabbitmq{{ env_suffix }}.fedoraproject.org/%2Fpubsub"
|
amqp_url = "amqps://fmn{{ env_suffix }}:@rabbitmq{{ env_suffix }}.fedoraproject.org/%2Fpubsub"
|
||||||
callback = "fmn.consumer:Consumer"
|
callback = "fmn.consumer:Consumer"
|
||||||
passive_declares = true
|
passive_declares = true
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
---
|
---
|
||||||
|
# Cleanup the counting of generated notifications in the database.
|
||||||
|
# Increase the retained duration if you want to be able to generate generation
|
||||||
|
# statistics over a longer period of time.
|
||||||
apiVersion: batch/v1
|
apiVersion: batch/v1
|
||||||
kind: CronJob
|
kind: CronJob
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -41,6 +44,9 @@ spec:
|
||||||
configMap:
|
configMap:
|
||||||
name: fmn
|
name: fmn
|
||||||
---
|
---
|
||||||
|
# Refresh the cache before it is expired.
|
||||||
|
# This will avoid message processing to be blocked while the cache is being
|
||||||
|
# rebuilt.
|
||||||
apiVersion: batch/v1
|
apiVersion: batch/v1
|
||||||
kind: CronJob
|
kind: CronJob
|
||||||
metadata:
|
metadata:
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
---
|
---
|
||||||
|
# Frontend component (Javascript served by Apache httpd)
|
||||||
apiVersion: apps.openshift.io/v1
|
apiVersion: apps.openshift.io/v1
|
||||||
kind: DeploymentConfig
|
kind: DeploymentConfig
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -63,6 +64,7 @@ spec:
|
||||||
kind: ImageStreamTag
|
kind: ImageStreamTag
|
||||||
name: fmn:latest
|
name: fmn:latest
|
||||||
---
|
---
|
||||||
|
# API component (Python/FastAPI served by Uvicorn)
|
||||||
apiVersion: apps.openshift.io/v1
|
apiVersion: apps.openshift.io/v1
|
||||||
kind: DeploymentConfig
|
kind: DeploymentConfig
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -183,6 +185,7 @@ spec:
|
||||||
kind: ImageStreamTag
|
kind: ImageStreamTag
|
||||||
name: fmn:latest
|
name: fmn:latest
|
||||||
---
|
---
|
||||||
|
# Consumer component (Fedora Messaging consume command)
|
||||||
apiVersion: apps.openshift.io/v1
|
apiVersion: apps.openshift.io/v1
|
||||||
kind: DeploymentConfig
|
kind: DeploymentConfig
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -281,6 +284,7 @@ spec:
|
||||||
kind: ImageStreamTag
|
kind: ImageStreamTag
|
||||||
name: fmn:latest
|
name: fmn:latest
|
||||||
---
|
---
|
||||||
|
# Email sending component (custom python runner)
|
||||||
apiVersion: apps.openshift.io/v1
|
apiVersion: apps.openshift.io/v1
|
||||||
kind: DeploymentConfig
|
kind: DeploymentConfig
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -345,6 +349,7 @@ spec:
|
||||||
kind: ImageStreamTag
|
kind: ImageStreamTag
|
||||||
name: fmn:latest
|
name: fmn:latest
|
||||||
---
|
---
|
||||||
|
# IRC sending component (custom python runner)
|
||||||
apiVersion: apps.openshift.io/v1
|
apiVersion: apps.openshift.io/v1
|
||||||
kind: DeploymentConfig
|
kind: DeploymentConfig
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -412,6 +417,7 @@ spec:
|
||||||
kind: ImageStreamTag
|
kind: ImageStreamTag
|
||||||
name: fmn:latest
|
name: fmn:latest
|
||||||
---
|
---
|
||||||
|
# Matrix sending component (custom python runner)
|
||||||
apiVersion: apps.openshift.io/v1
|
apiVersion: apps.openshift.io/v1
|
||||||
kind: DeploymentConfig
|
kind: DeploymentConfig
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -477,6 +483,7 @@ spec:
|
||||||
kind: ImageStreamTag
|
kind: ImageStreamTag
|
||||||
name: fmn:latest
|
name: fmn:latest
|
||||||
---
|
---
|
||||||
|
# Redis, for caching
|
||||||
apiVersion: apps.openshift.io/v1
|
apiVersion: apps.openshift.io/v1
|
||||||
kind: DeploymentConfig
|
kind: DeploymentConfig
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -515,6 +522,8 @@ spec:
|
||||||
kind: ImageStreamTag
|
kind: ImageStreamTag
|
||||||
name: redis:latest
|
name: redis:latest
|
||||||
---
|
---
|
||||||
|
# Sendria, to display email notifications in staging
|
||||||
|
{% if env == 'staging' %}
|
||||||
apiVersion: apps.openshift.io/v1
|
apiVersion: apps.openshift.io/v1
|
||||||
kind: DeploymentConfig
|
kind: DeploymentConfig
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -569,3 +578,4 @@ spec:
|
||||||
from:
|
from:
|
||||||
kind: ImageStreamTag
|
kind: ImageStreamTag
|
||||||
name: sendria:latest
|
name: sendria:latest
|
||||||
|
{% endif %}
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
#
|
||||||
|
# FMN configuration (fmn.core.config)
|
||||||
|
#
|
||||||
|
|
||||||
DATABASE__SQLALCHEMY__URL="postgresql://fmn:{{ (env == 'production')|ternary(fmn_prod_db_password, fmn_stg_db_password) }}@db01{{ env_suffix }}.iad2.fedoraproject.org/fmn"
|
DATABASE__SQLALCHEMY__URL="postgresql://fmn:{{ (env == 'production')|ternary(fmn_prod_db_password, fmn_stg_db_password) }}@db01{{ env_suffix }}.iad2.fedoraproject.org/fmn"
|
||||||
CORS_ORIGINS="https://fmn.apps.ocp{{ env_suffix }}.fedoraproject.org"
|
CORS_ORIGINS="https://fmn.apps.ocp{{ env_suffix }}.fedoraproject.org"
|
||||||
OIDC_PROVIDER_URL="https://id{{ env_suffix }}.fedoraproject.org/openidc"
|
OIDC_PROVIDER_URL="https://id{{ env_suffix }}.fedoraproject.org/openidc"
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
# Configuration for the email sender.
|
||||||
|
# This is not a Fedora Messaging configuration (even if it looks similar)
|
||||||
|
# because senders don't use Fedora Messaging, they only connect to FMN's own
|
||||||
|
# VHost on RabbitMQ.
|
||||||
|
|
||||||
amqp_url = "amqps://fmn{{ env_suffix }}:@rabbitmq{{ env_suffix }}.fedoraproject.org/%2Ffmn"
|
amqp_url = "amqps://fmn{{ env_suffix }}:@rabbitmq{{ env_suffix }}.fedoraproject.org/%2Ffmn"
|
||||||
queue = "email"
|
queue = "email"
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
# Configuration for the IRC sender.
|
||||||
|
# This is not a Fedora Messaging configuration (even if it looks similar)
|
||||||
|
# because senders don't use Fedora Messaging, they only connect to FMN's own
|
||||||
|
# VHost on RabbitMQ.
|
||||||
|
|
||||||
amqp_url = "amqps://fmn{{ env_suffix }}:@rabbitmq{{ env_suffix }}.fedoraproject.org/%2Ffmn"
|
amqp_url = "amqps://fmn{{ env_suffix }}:@rabbitmq{{ env_suffix }}.fedoraproject.org/%2Ffmn"
|
||||||
queue = "irc"
|
queue = "irc"
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
# A sample configuration for the FMN sender. This file is in the TOML format.
|
# Configuration for the Matrix sender.
|
||||||
|
# This is not a Fedora Messaging configuration (even if it looks similar)
|
||||||
|
# because senders don't use Fedora Messaging, they only connect to FMN's own
|
||||||
|
# VHost on RabbitMQ.
|
||||||
|
|
||||||
amqp_url = "amqps://fmn{{ env_suffix }}:@rabbitmq{{ env_suffix }}.fedoraproject.org/%2Ffmn"
|
amqp_url = "amqps://fmn{{ env_suffix }}:@rabbitmq{{ env_suffix }}.fedoraproject.org/%2Ffmn"
|
||||||
queue = "matrix"
|
queue = "matrix"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue