-
Notifications
You must be signed in to change notification settings - Fork 334
[FS-1845] Deploy RabbitMQ on k8s for CI #3236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 22 commits
Commits
Show all changes
54 commits
Select commit
Hold shift + click to select a range
2327ac3
WIP: Send onUserDeleteConnections notification using rabbitmq
akshaymankar 9a34bbc
Simplified* default pwd/user for rabbitmq from env.
elland 619585c
Use quorum queues to prefer consistency
akshaymankar 2ec9413
WIP: Introduce backend-notification-pusher
akshaymankar fd31234
Make backend-notification-pusher compile
elland fa700ff
brig: Make rabbitmq optional
elland db4a64f
Include own domain in the notification pushed to rabbit
akshaymankar f62809c
Implement watching and pushing notifications
akshaymankar 67024da
services/run-services: Also run backend-notification-pushser
akshaymankar 72d456e
Ack messages
akshaymankar 07c5f00
Add todos
akshaymankar 6742dca
Delete brig integration test in favour of e2e test
akshaymankar 48d1327
Cleaning house after rebase.
elland 2cb103f
Add rabbitmq chart and use it in integration test setup
elland d75af25
Removed unused amqp-utils from dev setup
elland 23bf3a2
Add helm chart for backend-notification-pusher
elland 645afab
Rename {brig,galley,cargohold}.enableFederator -> {...}.enableFederation
elland 939b911
backend-notification-pusher: Fix GHC options
akshaymankar e8561aa
rabbitMq -> rabbitmq
akshaymankar 843f0a1
Fixed format
elland 05d719c
charts/brig: Add config for connecting to rabbiqmq
elland 1b0d8cb
Add rabbitmq creds to brig in integration helm vars
elland 7bf7eb0
Helm nonsense
akshaymankar 4233dac
Actually deploy rabbitmq in integration tests
akshaymankar a3db5d1
backend-notification-pusher -> background-worker
akshaymankar 73f1d92
nix: Generate image for background-worker
akshaymankar e0ef2c2
Smol refactor
akshaymankar 66a9a4a
Add TODO for investigation
akshaymankar 46fb908
Ensure image_version is set for background-worker
akshaymankar 5067583
whitespace
akshaymankar 236f56c
helm-integration: Add config for backgroun-worker
akshaymankar f1e2e3d
Refactor helmfile, produce less noisy release names
akshaymankar 1b26571
hack/helmfile.yaml: Separate environments and releases
akshaymankar b8a258b
integration: Set remoteDomains for background-worker
akshaymankar a8d3b08
integration-test.sh: Fixup for refactoring helmfile
akshaymankar a477359
background-worker: Fixup Main
akshaymankar 17a549b
charts/brig: Provide rabbitmq creds to integration tests
akshaymankar f31df64
YAML YAML YAML YAML
akshaymankar e209d64
background-worker: Remove extra-doc-files
akshaymankar 9c4cfba
Updated cabal file
elland 07c7aac
Renamed notification to backend notification
elland 2162429
Renamed imports
elland 6a9a574
Merge branch 'develop' into backend-notifications-begins
elland 390de5e
Merge branch 'develop' into backend-notifications-begins
elland 529e5b7
Tagged self in TODOs
elland 5302db9
Renamed vars for rabbitmq to avoid confusion
elland f33456a
Testing export rabbit credentials for integration
elland f6f43ab
Fix: make git-add-cassandra-schema-impl lists to many keyspaces
smatting e9a5812
Moved credentials from .envrc to run-services.
elland 8dafa9e
Removed code-side changes, leavel CI setup in place.
elland a4e3873
Clean nix files
elland a639476
Removed background-worker reference from nix.
elland 629c96b
Merge branch 'develop' into backend-notifications-begins
elland 62c0bca
Removed background-worder from wire requirements.
elland File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| ``` | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| apiVersion: v1 | ||
| description: Backend notification pusheer | ||
| name: backend-notification-pusher | ||
| version: 0.0.42 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| Note that backend-notification-pusher depends on some provisioned storage, namely: | ||
|
|
||
| - rabbitmq | ||
|
|
||
| These are dealt with independently from this chart. |
23 changes: 23 additions & 0 deletions
23
charts/backend-notification-pusher/templates/configmap.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| apiVersion: v1 | ||
| kind: ConfigMap | ||
| metadata: | ||
| name: "backend-notification-pusher" | ||
| labels: | ||
| app: backend-notification-pusher | ||
| chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} | ||
| release: {{ .Release.Name }} | ||
| heritage: {{ .Release.Service }} | ||
| data: | ||
| {{- with .Values.config }} | ||
| backend-notification-pusher.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
59
charts/backend-notification-pusher/templates/deployment.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: backend-notification-pusher | ||
| labels: | ||
| app: backend-notification-pusher | ||
| chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} | ||
| release: {{ .Release.Name }} | ||
| heritage: {{ .Release.Service }} | ||
| spec: | ||
| replicas: {{ .Values.replicaCount }} | ||
| # TODO: Review this | ||
| strategy: | ||
| type: RollingUpdate | ||
| rollingUpdate: | ||
| maxUnavailable: 0 | ||
| maxSurge: {{ .Values.replicaCount }} | ||
| selector: | ||
| matchLabels: | ||
| app: backend-notification-pusher | ||
| template: | ||
| metadata: | ||
| labels: | ||
| app: backend-notification-pusher | ||
| 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: "backend-notification-pusher-config" | ||
| configMap: | ||
| name: "backend-notification-pusher" | ||
| - name: "backend-notification-pusher-secrets" | ||
| secret: | ||
| secretName: "backend-notification-pusher" | ||
| containers: | ||
| - name: backend-notification-pusher | ||
| image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" | ||
| imagePullPolicy: {{ default "" .Values.imagePullPolicy | quote }} | ||
| volumeMounts: | ||
| - name: "backend-notification-pusher-config" | ||
| mountPath: "/etc/wire/backend-notification-pusher/conf" | ||
| env: | ||
| - name: RABBITMQ_USERNAME | ||
| valueFrom: | ||
| secretKeyRef: | ||
| name: backend-notification-pusher | ||
| key: rabbitmqUsername | ||
| - name: RABBITMQ_PASSWORD | ||
| valueFrom: | ||
| secretKeyRef: | ||
| name: backend-notification-pusher | ||
| key: rabbitmqPassword | ||
| resources: | ||
| {{ toYaml .Values.resources | indent 12 }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| apiVersion: v1 | ||
| kind: Secret | ||
| metadata: | ||
| name: backend-notification-pusher | ||
| labels: | ||
| app: backend-notification-pusher | ||
| 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
16
charts/backend-notification-pusher/templates/serviceaccount.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| replicaCount: 1 | ||
| image: | ||
| repository: quay.io/wire/backend-notification-pusher | ||
| tag: do-not-use | ||
| # FUTUREWORK: Review these values when we have some experience | ||
| resources: | ||
| requests: | ||
| memory: "200Mi" | ||
| cpu: "100m" | ||
| limits: | ||
| memory: "512Mi" | ||
| # TODO: Create issue for a metrics endpoint | ||
| # metrics: | ||
| # serviceMonitor: | ||
| # enabled: false | ||
| config: | ||
| # TODO: 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 | ||
| # 'backend-notification-pusher' exists or change the 'name' field to 'default' | ||
| create: true | ||
| name: backend-notification-pusher | ||
| annotations: {} | ||
| automountServiceAccountToken: true | ||
|
|
||
|
|
||
| secrets: {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we still rename this to
worker, or something similarly general? discussion hereThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps
background-workeris a better name?