Skip to content
Merged
Show file tree
Hide file tree
Changes from 47 commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
2327ac3
WIP: Send onUserDeleteConnections notification using rabbitmq
akshaymankar Apr 19, 2023
9a34bbc
Simplified* default pwd/user for rabbitmq from env.
elland Apr 20, 2023
619585c
Use quorum queues to prefer consistency
akshaymankar Apr 20, 2023
2ec9413
WIP: Introduce backend-notification-pusher
akshaymankar Apr 20, 2023
fd31234
Make backend-notification-pusher compile
elland Apr 24, 2023
fa700ff
brig: Make rabbitmq optional
elland Apr 24, 2023
db4a64f
Include own domain in the notification pushed to rabbit
akshaymankar Apr 24, 2023
f62809c
Implement watching and pushing notifications
akshaymankar Apr 24, 2023
67024da
services/run-services: Also run backend-notification-pushser
akshaymankar Apr 24, 2023
72d456e
Ack messages
akshaymankar Apr 24, 2023
07c5f00
Add todos
akshaymankar Apr 24, 2023
6742dca
Delete brig integration test in favour of e2e test
akshaymankar Apr 25, 2023
48d1327
Cleaning house after rebase.
elland Apr 25, 2023
2cb103f
Add rabbitmq chart and use it in integration test setup
elland Apr 25, 2023
d75af25
Removed unused amqp-utils from dev setup
elland Apr 25, 2023
23bf3a2
Add helm chart for backend-notification-pusher
elland Apr 25, 2023
645afab
Rename {brig,galley,cargohold}.enableFederator -> {...}.enableFederation
elland Apr 25, 2023
939b911
backend-notification-pusher: Fix GHC options
akshaymankar Apr 25, 2023
e8561aa
rabbitMq -> rabbitmq
akshaymankar Apr 25, 2023
843f0a1
Fixed format
elland Apr 25, 2023
05d719c
charts/brig: Add config for connecting to rabbiqmq
elland Apr 25, 2023
1b0d8cb
Add rabbitmq creds to brig in integration helm vars
elland Apr 25, 2023
7bf7eb0
Helm nonsense
akshaymankar Apr 26, 2023
4233dac
Actually deploy rabbitmq in integration tests
akshaymankar Apr 26, 2023
a3db5d1
backend-notification-pusher -> background-worker
akshaymankar Apr 26, 2023
73f1d92
nix: Generate image for background-worker
akshaymankar Apr 26, 2023
e0ef2c2
Smol refactor
akshaymankar Apr 26, 2023
66a9a4a
Add TODO for investigation
akshaymankar Apr 26, 2023
46fb908
Ensure image_version is set for background-worker
akshaymankar Apr 26, 2023
5067583
whitespace
akshaymankar Apr 26, 2023
236f56c
helm-integration: Add config for backgroun-worker
akshaymankar Apr 26, 2023
f1e2e3d
Refactor helmfile, produce less noisy release names
akshaymankar Apr 26, 2023
1b26571
hack/helmfile.yaml: Separate environments and releases
akshaymankar Apr 26, 2023
b8a258b
integration: Set remoteDomains for background-worker
akshaymankar Apr 26, 2023
a8d3b08
integration-test.sh: Fixup for refactoring helmfile
akshaymankar Apr 26, 2023
a477359
background-worker: Fixup Main
akshaymankar Apr 26, 2023
17a549b
charts/brig: Provide rabbitmq creds to integration tests
akshaymankar Apr 26, 2023
f31df64
YAML YAML YAML YAML
akshaymankar Apr 26, 2023
e209d64
background-worker: Remove extra-doc-files
akshaymankar Apr 26, 2023
9c4cfba
Updated cabal file
elland May 2, 2023
07c7aac
Renamed notification to backend notification
elland May 2, 2023
2162429
Renamed imports
elland May 2, 2023
6a9a574
Merge branch 'develop' into backend-notifications-begins
elland May 2, 2023
390de5e
Merge branch 'develop' into backend-notifications-begins
elland May 3, 2023
529e5b7
Tagged self in TODOs
elland May 3, 2023
5302db9
Renamed vars for rabbitmq to avoid confusion
elland May 3, 2023
f33456a
Testing export rabbit credentials for integration
elland May 3, 2023
f6f43ab
Fix: make git-add-cassandra-schema-impl lists to many keyspaces
smatting May 3, 2023
e9a5812
Moved credentials from .envrc to run-services.
elland May 3, 2023
8dafa9e
Removed code-side changes, leavel CI setup in place.
elland May 4, 2023
a4e3873
Clean nix files
elland May 4, 2023
a639476
Removed background-worker reference from nix.
elland May 4, 2023
629c96b
Merge branch 'develop' into backend-notifications-begins
elland May 4, 2023
62c0bca
Removed background-worder from wire requirements.
elland May 4, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,6 @@ path_add "PYTHONPATH" "./hack/python"
# Locale
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8

export RABBITMQ_USERNAME=guest
export RABBITMQ_PASSWORD=alpaca-grapefruit
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ DOCKER_TAG ?= $(USER)
# default helm chart version must be 0.0.42 for local development (because 42 is the answer to the universe and everything)
HELM_SEMVER ?= 0.0.42
# The list of helm charts needed on internal kubernetes testing environments
CHARTS_INTEGRATION := wire-server databases-ephemeral redis-cluster fake-aws ingress-nginx-controller nginx-ingress-controller nginx-ingress-services fluent-bit kibana sftd restund coturn
CHARTS_INTEGRATION := wire-server databases-ephemeral redis-cluster rabbitmq fake-aws ingress-nginx-controller nginx-ingress-controller nginx-ingress-services fluent-bit kibana sftd restund coturn
# The list of helm charts to publish on S3
# FUTUREWORK: after we "inline local subcharts",
# (e.g. move charts/brig to charts/wire-server/brig)
# this list could be generated from the folder names under ./charts/ like so:
# CHARTS_RELEASE := $(shell find charts/ -maxdepth 1 -type d | xargs -n 1 basename | grep -v charts)
CHARTS_RELEASE := wire-server redis-ephemeral redis-cluster databases-ephemeral \
CHARTS_RELEASE := wire-server redis-ephemeral redis-cluster rabbitmq databases-ephemeral \
fake-aws fake-aws-s3 fake-aws-sqs aws-ingress fluent-bit kibana backoffice \
calling-test demo-smtp elasticsearch-curator elasticsearch-external \
elasticsearch-ephemeral minio-external cassandra-external \
Expand Down
5 changes: 4 additions & 1 deletion cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ packages:
, libs/wire-api-federation/
, libs/wire-message-proto-lens/
, libs/zauth/
, services/background-worker/
, services/brig/
, services/cannon/
, services/cargohold/
Expand Down Expand Up @@ -66,6 +67,8 @@ package assets
ghc-options: -Werror
package auto-whitelist
ghc-options: -Werror
package background-worker
ghc-options: -Werror
package bilge
ghc-options: -Werror
package billing-team-member-backfill
Expand Down Expand Up @@ -155,4 +158,4 @@ package wire-api-federation
package wire-message-proto-lens
ghc-options: -Werror
package zauth
ghc-options: -Werror
ghc-options: -Werror
33 changes: 33 additions & 0 deletions changelog.d/0-release-notes/helm-tag-rename
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
A few helm values related to federation have been renamed, no action is required if federation was disabled.
If federation was enabled these values must be renamed in the wire-server chart:
- tags.federator -> tags.federation
- brig.enableFederator -> brig.enableFederation
- galley.enableFederator -> galley.enableFederation
- cargohold.enableFederator -> galley.enableFederation

So, an old config which looked like this:

```yaml
tags:
federator: true
brig:
enableFederator: true
galley:
enableFederator: true
cargohold:
enableFederator: true
```

would now look like this:

```yaml
tags:
federation: true
brig:
enableFederation: true
galley:
enableFederation: true
cargohold:
enableFederation: true
```

4 changes: 4 additions & 0 deletions charts/background-worker/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
description: Backend notification pusheer
name: background-worker
version: 0.0.42
5 changes: 5 additions & 0 deletions charts/background-worker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Note that background-worker depends on some provisioned storage, namely:

- rabbitmq

These are dealt with independently from this chart.
23 changes: 23 additions & 0 deletions charts/background-worker/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: "background-worker"
labels:
app: background-worker
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
data:
{{- with .Values.config }}
background-worker.yaml: |
logFormat: {{ .logFormat }}
logLevel: {{ .logLevel }}

federatorInternal:
host: federator
port: 8080
rabbitmq:
{{toYaml .rabbitmq | indent 6 }}
remoteDomains:
{{toYaml .remoteDomains | indent 6 }}
{{- end }}
59 changes: 59 additions & 0 deletions charts/background-worker/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: background-worker
labels:
app: background-worker
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
replicas: {{ .Values.replicaCount }}
# TODO(elland): Review this
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 0
maxSurge: {{ .Values.replicaCount }}
selector:
matchLabels:
app: background-worker
template:
metadata:
labels:
app: background-worker
release: {{ .Release.Name }}
annotations:
# An annotation of the configmap checksum ensures changes to the configmap cause a redeployment upon `helm upgrade`
checksum/configmap: {{ include (print .Template.BasePath "/configmap.yaml") . | sha256sum }}
checksum/secret: {{ include (print .Template.BasePath "/secret.yaml") . | sha256sum }}
fluentbit.io/parser: json
spec:
serviceAccountName: {{ .Values.serviceAccount.name }}
volumes:
- name: "background-worker-config"
configMap:
name: "background-worker"
- name: "background-worker-secrets"
secret:
secretName: "background-worker"
containers:
- name: background-worker
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ default "" .Values.imagePullPolicy | quote }}
volumeMounts:
- name: "background-worker-config"
mountPath: "/etc/wire/background-worker/conf"
env:
- name: RABBITMQ_USERNAME
valueFrom:
secretKeyRef:
name: background-worker
key: rabbitmqUsername
- name: RABBITMQ_PASSWORD
valueFrom:
secretKeyRef:
name: background-worker
key: rabbitmqPassword
resources:
{{ toYaml .Values.resources | indent 12 }}
18 changes: 18 additions & 0 deletions charts/background-worker/templates/secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: v1
kind: Secret
metadata:
name: background-worker
labels:
app: background-worker
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
type: Opaque
data:
{{/* for_helm_linting is necessary only since the 'with' block below does not throw an error upon an empty .Values.secrets */}}
for_helm_linting: {{ required "No .secrets found in configuration. Did you forget to helm <command> -f path/to/secrets.yaml ?" .Values.secrets | quote | b64enc | quote }}

{{- with .Values.secrets }}
rabbitmqUsername: {{ .rabbitmq.username | b64enc | quote }}
rabbitmqPassword: {{ .rabbitmq.password | b64enc | quote }}
{{- end }}
16 changes: 16 additions & 0 deletions charts/background-worker/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ .Values.serviceAccount.name }}
labels:
app: brig
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken }}
{{- end }}
35 changes: 35 additions & 0 deletions charts/background-worker/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
replicaCount: 1
image:
repository: quay.io/wire/background-worker
tag: do-not-use
# FUTUREWORK: Review these values when we have some experience
resources:
requests:
memory: "200Mi"
cpu: "100m"
limits:
memory: "512Mi"
# TODO(elland): Create issue for a metrics endpoint
# metrics:
# serviceMonitor:
# enabled: false
config:
# TODO(elland): Proper logging
logLevel: Info
logFormat: StructuredJSON
rabbitmq:
host: rabbitmq
port: 5672
vHost: /
remoteDomains: []

serviceAccount:
# When setting this to 'false', either make sure that a service account named
# 'background-worker' exists or change the 'name' field to 'default'
create: true
name: background-worker
annotations: {}
automountServiceAccountToken: true


secrets: {}
4 changes: 3 additions & 1 deletion charts/brig/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ data:
host: gundeck
port: 8080

{{- if .enableFederator }}
{{- if .enableFederation }}
# TODO remove this
federator:
host: federator
Expand All @@ -57,6 +57,8 @@ data:
federatorInternal:
host: federator
port: 8080
rabbitmq:
{{ toYaml .rabbitmq | indent 6}}
{{- end }}

{{- with .aws }}
Expand Down
14 changes: 13 additions & 1 deletion charts/brig/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,19 @@ spec:
- name: NO_PROXY
value: {{ join "," .noProxyList | quote }}
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.config.enableFederation }}
- name: RABBITMQ_USERNAME
valueFrom:
secretKeyRef:
name: brig
key: rabbitmqUsername
- name: RABBITMQ_PASSWORD
valueFrom:
secretKeyRef:
name: brig
key: rabbitmqPassword
{{- end }}
ports:
- containerPort: {{ .Values.service.internalPort }}
startupProbe:
Expand Down
7 changes: 5 additions & 2 deletions charts/brig/templates/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ data:
{{- end }}
{{- if .oauthJwkKeyPair }}
oauth_ed25519.jwk: {{ .oauthJwkKeyPair | b64enc | quote }}
{{- end }}
{{- end }}

{{- if $.Values.config.enableFederation }}
rabbitmqUsername: {{ .rabbitmq.username | b64enc | quote }}
rabbitmqPassword: {{ .rabbitmq.password | b64enc | quote }}
{{- end }}
{{- end }}
12 changes: 12 additions & 0 deletions charts/brig/templates/tests/brig-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,18 @@ spec:
- name: INTEGRATION_FEDERATION_TESTS
value: "1"
{{- end }}
{{- if .Values.config.enableFederation }}
- name: RABBITMQ_USERNAME
valueFrom:
secretKeyRef:
name: brig
key: rabbitmqUsername
- name: RABBITMQ_PASSWORD
valueFrom:
secretKeyRef:
name: brig
key: rabbitmqPassword
{{- end }}
resources:
requests:
memory: "512Mi"
Expand Down
7 changes: 6 additions & 1 deletion charts/brig/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,12 @@ config:
# -- If set to false, 'dynamoDBEndpoint' _must_ be set.
randomPrekeys: true
useSES: true
enableFederator: false # keep enableFederator default in sync with galley and cargohold chart's config.enableFederator as well as wire-server chart's tag.federator
enableFederation: false # keep enableFederation default in sync with galley and cargohold chart's config.enableFederation as well as wire-server chart's tags.federation
# Not used if enableFederation is false
rabbitmq:
host: rabbitmq
port: 5672
vHost: /
emailSMS:
general:
templateBranding:
Expand Down
2 changes: 1 addition & 1 deletion charts/cargohold/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ data:
host: 0.0.0.0
port: {{ .Values.service.internalPort }}

{{- if .Values.config.enableFederator }}
{{- if .Values.config.enableFederation }}
federator:
host: federator
port: 8080
Expand Down
2 changes: 1 addition & 1 deletion charts/cargohold/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ config:
logLevel: Info
logFormat: StructuredJSON
logNetStrings: false
enableFederator: false # keep enableFederator default in sync with brig and galley chart's config.enableFederator as well as wire-server chart's tag.federator
enableFederation: false # keep enableFederation default in sync with brig and galley chart's config.enableFederation as well as wire-server chart's tags.federation
aws:
region: "eu-west-1"
s3Bucket: assets
Expand Down
2 changes: 1 addition & 1 deletion charts/galley/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ data:
host: spar
port: 8080

{{- if .enableFederator }}
{{- if .enableFederation }}
federator:
host: federator
port: 8080
Expand Down
2 changes: 1 addition & 1 deletion charts/galley/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ config:
cassandra:
host: aws-cassandra
replicaCount: 3
enableFederator: false # keep enableFederator default in sync with brig and cargohold chart's config.enableFederator as well as wire-server chart's tag.federator
enableFederation: false # keep enableFederation default in sync with brig and cargohold chart's config.enableFederation as well as wire-server chart's tags.federation
settings:
httpPoolSize: 128
maxTeamSize: 10000
Expand Down
4 changes: 4 additions & 0 deletions charts/rabbitmq/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
description: Wrapper chart for bitnami/rabbitmq
name: rabbitmq
version: 0.0.42
4 changes: 4 additions & 0 deletions charts/rabbitmq/requirements.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dependencies:
- name: rabbitmq
version: 11.13.0
repository: https://charts.bitnami.com/bitnami
Empty file added charts/rabbitmq/values.yaml
Empty file.
9 changes: 9 additions & 0 deletions charts/wire-server/requirements.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,15 @@ dependencies:
repository: "file://../federator"
tags:
- federator
- federation
- haskellServices
- services
- name: background-worker
version: "0.0.42"
repository: "file://../background-worker"
tags:
- background-worker
- federation
- haskellServices
- services
- name: sftd
Expand Down
Loading