-
Notifications
You must be signed in to change notification settings - Fork 332
Save MLS migration statistics in S3 bucket #3579
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 all commits
Commits
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| New cron job to save data usable to watch the progress of the Proteus to MLS migration in S3 bucket. | ||
|
|
||
| **IMPORTANT:** This cron job is _not_ meant for general use! It can leak data about one team to other teams. |
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,21 @@ | ||
| # Patterns to ignore when building packages. | ||
| # This supports shell glob matching, relative path matching, and | ||
| # negation (prefixed with !). Only one pattern per line. | ||
| .DS_Store | ||
| # Common VCS dirs | ||
| .git/ | ||
| .gitignore | ||
| .bzr/ | ||
| .bzrignore | ||
| .hg/ | ||
| .hgignore | ||
| .svn/ | ||
| # Common backup files | ||
| *.swp | ||
| *.bak | ||
| *.tmp | ||
| *~ | ||
| # Various IDEs | ||
| .project | ||
| .idea/ | ||
| *.tmproj |
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: mlsstats - Push Proteus to MLS statistics to S3 | ||
| name: mlsstats | ||
| version: 0.0.1 |
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,7 @@ | ||
| # mlsstats | ||
|
|
||
| The kubernetes cronjob resource will spawn a new `mlsstats-XXXXXX` pod every day. Logs for the pod can be gathered with `kubectl log`. | ||
|
|
||
| ## Important note | ||
|
|
||
| This cron job is _not_ meant for general use! It can leak data about one team to other teams. |
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,13 @@ | ||
| {{/* Allow KubeVersion to be overridden. */}} | ||
| {{- define "kubeVersion" -}} | ||
| {{- default .Capabilities.KubeVersion.Version .Values.kubeVersionOverride -}} | ||
| {{- end -}} | ||
|
|
||
| {{/* Get Batch API Version */}} | ||
| {{- define "batch.apiVersion" -}} | ||
| {{- if and (.Capabilities.APIVersions.Has "batch/v1") (semverCompare ">= 1.21-0" (include "kubeVersion" .)) -}} | ||
| {{- print "batch/v1" -}} | ||
| {{- else -}} | ||
| {{- print "batch/v1beta1" -}} | ||
| {{- end -}} | ||
| {{- 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,60 @@ | ||
| apiVersion: {{ include "batch.apiVersion" . }} | ||
| kind: CronJob | ||
| metadata: | ||
| name: {{ .Release.Name }} | ||
| labels: | ||
| app: mlsstats | ||
| chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} | ||
| release: {{ .Release.Name }} | ||
| heritage: {{ .Release.Service }} | ||
| spec: | ||
| concurrencyPolicy: Forbid | ||
| schedule: {{ .Values.schedule | quote }} | ||
| jobTemplate: | ||
| metadata: | ||
| labels: | ||
| app: mlsstats | ||
| release: {{ .Release.Name }} | ||
| annotations: | ||
| # An annotation of the configmap checksum ensures changes to the configmap cause a redeployment upon `helm upgrade` | ||
| checksum/secret: {{ include (print .Template.BasePath "/secret.yaml") . | sha256sum }} | ||
| spec: | ||
| backoffLimit: 0 | ||
| template: | ||
| spec: | ||
| restartPolicy: Never | ||
| containers: | ||
| - name: mlsstats | ||
| image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" | ||
| imagePullPolicy: {{ default "" .Values.imagePullPolicy | quote }} | ||
| args: [ "mlsstats" | ||
| , "--brig-cassandra-host", {{ .Values.config.cassandra.brig.host | quote }} | ||
| , "--brig-cassandra-port", {{ .Values.config.cassandra.brig.port | quote }} | ||
| , "--brig-cassandra-keyspace", {{ .Values.config.cassandra.brig.keyspace | quote }} | ||
| , "--galley-cassandra-host", {{ .Values.config.cassandra.galley.host | quote }} | ||
| , "--galley-cassandra-port", {{ .Values.config.cassandra.galley.port | quote }} | ||
| , "--galley-cassandra-keyspace", {{ .Values.config.cassandra.galley.keyspace | quote }} | ||
| , "--cassandra-pagesize", {{ .Values.config.cassandra.pagesize | quote }} | ||
| , "--s3-endpoint", {{ .Values.config.s3.endpoint | quote -}} | ||
| , "--s3-region", {{ .Values.config.s3.region | quote -}} | ||
| , "--s3-addressing-style", {{ .Values.config.s3.addressingStyle | quote }} | ||
| , "--s3-bucket-name", {{ .Values.config.s3.bucket.name | quote }} | ||
| , "--s3-bucket-dir", {{ .Values.config.s3.bucket.directory | quote }} | ||
| ] | ||
| resources: | ||
| env: | ||
| {{- if hasKey .Values.secrets "awsKeyId" }} | ||
| - name: AWS_ACCESS_KEY_ID | ||
| valueFrom: | ||
| secretKeyRef: | ||
| name: mlsstats | ||
| key: awsKeyId | ||
| - name: AWS_SECRET_ACCESS_KEY | ||
| valueFrom: | ||
| secretKeyRef: | ||
| name: mlsstats | ||
| key: awsSecretKey | ||
| {{- end }} | ||
| - name: AWS_REGION | ||
| value: "{{ .Values.config.s3.region }}" | ||
| {{ toYaml .Values.resources | indent 16 }} | ||
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,20 @@ | ||
| apiVersion: v1 | ||
| kind: Secret | ||
| metadata: | ||
| name: {{ .Release.Name }} | ||
| labels: | ||
| app: mlsstats | ||
| chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" | ||
| 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 }} | ||
| {{- if .awsKeyId }} | ||
| awsKeyId: {{ .awsKeyId | b64enc | quote }} | ||
| awsSecretKey: {{ .awsSecretKey | b64enc | quote }} | ||
| {{- end }} | ||
| {{- 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,30 @@ | ||
| image: | ||
| repository: quay.io/wire/mlsstats | ||
| tag: 0.1 | ||
| resources: | ||
| requests: | ||
| memory: "256Mi" | ||
| cpu: "100m" | ||
| limits: | ||
| memory: "256Mi" | ||
| cpu: "100m" | ||
| schedule: "23 3 * * *" | ||
| config: | ||
| cassandra: | ||
| brig: | ||
| host: cassandra | ||
| port: 9042 | ||
| keyspace: brig | ||
| galley: | ||
| host: cassandra | ||
| port: 9042 | ||
| keyspace: galley | ||
| pagesize: 1024 | ||
| s3: | ||
| endpoint: https://s3.eu-west-1.amazonaws.com/ | ||
| region: eu-west-1 | ||
| addressingStyle: auto | ||
| bucket: | ||
| name: mlsstats | ||
| directory: "/" | ||
| 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../../.ormolu |
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.
Uh oh!
There was an error while loading. Please reload this page.