Skip to content

Commit f1364d2

Browse files
authored
Merge branch 'main' into refactor-e2e-relay-only-MPP-4466
2 parents f28f408 + 7691602 commit f1364d2

22 files changed

+8669
-13692
lines changed

.lintstagedrc.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@ module.exports = {
22
"frontend/**/*.{scss,css}": "stylelint --fix",
33
"frontend/**/*.{ts,tsx,js,jsx,scss,css}": "prettier --write",
44
"e2e-tests/**/*.ts": "prettier --write",
5-
"frontend/**/*.{ts,tsx,js,jsx}": (filenames) =>
6-
`next lint frontend --fix --file ${filenames
7-
.map((file) => file.split(process.cwd())[1])
8-
.join(" --file ")}`,
5+
"frontend/{src,pages}/**/*.{ts,tsx,js,jsx}": "eslint --fix --config frontend/.eslintrc.js",
96
"*.md": "prettier --write",
107
"*.py": ["black", "mypy", "ruff check --fix"],
118
}

docs/django-migrations-standards.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,10 @@ The Django migration command `./manage.py makemigrations` utilizes [AddField ope
2121
- When writing a new entry to the updated table with a new column, version X doesn't know about new columns and will omit them from INSERT statements.
2222
> [!NOTE]
2323
> These columns need a database default or allow `NULL`
24-
25-
4. Canary pod with Version X+1 starts. It is running the same time as all the Version X pods.
26-
5. Kubernetes rollout of Version X+1 starts:
24+
4. Kubernetes rollout of Version X+1 starts:
2725
- New pod with Version X+1 starts.
2826
- When the Version X+1 pod is running, the Version X pod is shut down. This continues until no pods run Version X.
29-
6. Version X+1 code is happily running in several pods.
27+
5. Version X+1 code is happily running in several pods.
3028
> [!WARNING]
3129
> Misaligned code and database happens in Step 3 when Version X adds a new entry to the table without proper default set. In Step 6, the Version X+1 retrieves the entry. The fetched entry added by Version X does not meet the field validation in Version X+1 causing validation error.
3230
@@ -46,11 +44,10 @@ Like adding a new field in an existing model, when deleting an existing model or
4644
- Meanwhile the column remains in the database.
4745
> [!NOTE]
4846
> When writing to an existing table, version X should not refer to deleted columns.
49-
4. Canary pod with Version X+1 starts. It is running the same time as all the Version X pods.
50-
5. Kubernetes rollout of Version X+1 starts:
47+
4. Kubernetes rollout of Version X+1 starts:
5148
- New pod with Version X+1 starts.
5249
- When the Version X+1 pod is running, the Version X pod is shut down. This continues until no pods run Version X.
53-
6. Version X+1 code is happily running in several pods.
50+
5. Version X+1 code is happily running in several pods.
5451
> [!WARNING]
5552
> Error happens when Version X or Version X+1 code refers to the deleted column.
5653

docs/img/structurizr-1-RelayProductionDeployment.svg

Lines changed: 1 addition & 1 deletion
Loading

docs/img/structurizr-1-RelayStageDeployment.svg

Lines changed: 1 addition & 1 deletion
Loading

docs/release_process.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
## Environments
44

5-
- [Production][prod] - Run by SRE team in GCP
6-
- [Stage][stage] - Run by SRE team in GCP
5+
- [Production][prod] - Run by ENGR team in GCP
6+
- [Stage][stage] - Run by ENGR in GCP
77
- [Dev][dev] - Run by ENGR team in MozCloud
88
- Locals: Run by ENGRs on their own devices. (See [README][readme] and other [`docs/`][docs].)
99

@@ -180,12 +180,13 @@ On Tuesday, after the Release Readiness review with QA:
180180

181181
1. Use the [release workflow][release-workflow] to select the tag and deploy
182182
to the [Prod][prod] environment by selecting `prod`.
183-
2. When you see `Application relay... is now running new version of deployments manifests.` in `#fx-private-relay-eng` on Slack, do some checks on prod:
183+
2. Once the GitHub action finishes- go to ArgoCD an click "Sync" in the production application.
184+
3. When you see `Application relay... is now running new version of deployments manifests.` in `#fx-private-relay-eng` on Slack, do some checks on prod:
184185
- Spot-check the site for basic functionality
185186
- Check [sentry prod project](https://mozilla.sentry.io/releases/?environment=prod) for a spike in any new issues
186187
- Check [grafana dashboard](https://yardstick.mozilla.org/) for any unexpected spike in ops
187188
- (optional) [Run the relay-only e2e test suite](https://github.com/mozilla/fx-private-relay/actions/workflows/playwright.yml) on prod
188-
3. Update the GitHub release:
189+
4. Update the GitHub release:
189190
- Update the summary:
190191

191192
```text

docs/system_diagrams.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,8 @@ GCP environment) and AWS.
160160

161161
## Stage Deployment Diagram
162162

163-
The stage deployment is hosted in GCP and AWS. Deployments are done by Jenkins
164-
when a new tagged Docker image is published.
163+
The stage deployment is hosted in GCP and AWS. Deployments are done by ArgoCD
164+
when a new tagged Docker image is published to Google Artifact Registry.
165165

166166
The Stage Deployment lacks some of the full Relay System features:
167167

@@ -171,7 +171,6 @@ The Stage Deployment lacks some of the full Relay System features:
171171
The Stage Deployment has some additional features:
172172

173173
- There is a read-only replica of the database
174-
- There is a canary app deployment. This single pod is updated first, so that any errors
175174
will halt the full deployment.
176175
- The Metrics Aggregator (statsd-telegraf) queries the database periodically
177176
- The stackdriver-telegraf service queries the GCP Cloud Metrics periodically
@@ -183,8 +182,9 @@ Key:
183182

184183
## Production Deployment Diagram
185184

186-
The production deployment is hosted in GCP and AWS. Deployments are done by Jenkins
187-
when an SRE continues a stage deploy.
185+
The production deployment is hosted in GCP and AWS. Deployments are done by ArgoCD
186+
when a engineer clicks "Sync" after pushing up a production image tag to Google Artifact
187+
Registry.
188188

189189
The Production Deployment has some additional features:
190190

docs/workspace.dsl

Lines changed: 28 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,12 @@ workspace "${SERVICE_NAME}" "Mozilla's service providing email and phone masks."
368368
stage_web = containerInstance web
369369
stage_add_on = containerInstance add_on
370370
}
371+
deploymentNode "Fastly" {
372+
stage_fastly = infrastructureNode "fastly" {
373+
description "Tracks IP reputation, blocks IPs"
374+
tags "Deployment Service"
375+
}
376+
}
371377
deploymentNode "Amazon Web Services" {
372378
deploymentNode "us-east-1 region" {
373379
deploymentNode "Amazon SQS" {
@@ -404,17 +410,6 @@ workspace "${SERVICE_NAME}" "Mozilla's service providing email and phone masks."
404410
}
405411
stage_app_web = containerInstance web_app
406412
}
407-
deploymentNode "app-canary" {
408-
technology "Kubernetes Deployment"
409-
instances 1
410-
stage_app_canary_nginx = infrastructureNode "nginx" {
411-
tags "Deployment Service"
412-
description "Reverse proxy"
413-
}
414-
stage_app_canary_web = containerInstance web_app {
415-
description "Canary App for deployment testing"
416-
}
417-
}
418413
deploymentNode "cleanup" {
419414
technology "Kubernetes Cron Job"
420415
stage_task_cleanup = containerInstance task_cleanup
@@ -444,14 +439,6 @@ workspace "${SERVICE_NAME}" "Mozilla's service providing email and phone masks."
444439
technology "Kubernetes Cron Job"
445440
stage_task_welcome = containerInstance task_welcome
446441
}
447-
deploymentNode "iprepd-nginx" {
448-
technology "Kubernetes Deployment"
449-
instances 3
450-
stage_iprepd_nginx = infrastructureNode "iprepd-nginx" {
451-
description "Tracks IP reputation, blocks IPs"
452-
tags "Deployment Service"
453-
}
454-
}
455442
deploymentNode "statsd-telegraf" {
456443
technology "Kubernetes Deployment"
457444
instances 1
@@ -480,7 +467,7 @@ workspace "${SERVICE_NAME}" "Mozilla's service providing email and phone masks."
480467
}
481468
deploymentNode "Cloud Load Balancing" {
482469
stage_lb = infrastructureNode "Load Balancer" {
483-
description "Zone for fxprivaterelay.nonprod.cloudops.mozgcp.net"
470+
description "Zone for stage.relay.nonprod.webservices.mozgcp.net"
484471
tags "Managed Service"
485472
}
486473
}
@@ -508,16 +495,14 @@ workspace "${SERVICE_NAME}" "Mozilla's service providing email and phone masks."
508495
deploymentNode twilio.com {
509496
stage_phone = containerInstance phone_service
510497
}
511-
stage_iprepd_nginx -> stage_app_nginx "Requests" "HTTP"
512-
stage_iprepd_nginx -> stage_app_canary_nginx "Requests" "HTTP"
498+
stage_fastly -> stage_lb "Requests" "HTTP"
499+
stage_lb -> stage_app_nginx "Requests" "HTTP"
513500
stage_app_nginx -> stage_app_web "Requests" "HTTP 1.0"
514-
stage_app_canary_nginx -> stage_app_canary_web "Requests" "HTTP"
515501
stage_logs -> stage_bq "Forwards Logs"
516-
stage_lb -> stage_iprepd_nginx "Requests" "HTTP"
517-
stage_web -> stage_lb "Uses API, requests static assets"
518-
stage_add_on -> stage_lb "Uses API, sends UI events"
519-
stage_phone -> stage_lb "Informs of incoming SMS and calls"
520-
stage_email_topic -> stage_lb "Sends emails, complaints, bounces" "SQS" "Optional Relationship"
502+
stage_web -> stage_fastly "Uses API, requests static assets"
503+
stage_add_on -> stage_fastly "Uses API, sends UI events"
504+
stage_phone -> stage_fastly "Informs of incoming SMS and calls"
505+
stage_email_topic -> stage_fastly "Sends emails, complaints, bounces" "SQS" "Optional Relationship"
521506
stage_cloudwatch -> stage_metrics "Polls metrics"
522507
}
523508
prod_deploy = deploymentEnvironment "relay.firefox.com" {
@@ -552,6 +537,12 @@ workspace "${SERVICE_NAME}" "Mozilla's service providing email and phone masks."
552537
tags "Managed Service"
553538
}
554539
}
540+
deploymentNode "Fastly" {
541+
prod_fastly = infrastructureNode "fastly" {
542+
description "Tracks IP reputation, blocks IPs"
543+
tags "Deployment Service"
544+
}
545+
}
555546
deploymentNode "Google Cloud Platform" {
556547
deploymentNode "Kubernetes Engine" {
557548
deploymentNode "app" {
@@ -563,17 +554,6 @@ workspace "${SERVICE_NAME}" "Mozilla's service providing email and phone masks."
563554
}
564555
prod_app_web = containerInstance web_app
565556
}
566-
deploymentNode "app-canary" {
567-
technology "Kubernetes Deployment"
568-
instances 1
569-
prod_app_canary_nginx = infrastructureNode "nginx" {
570-
tags "Deployment Service"
571-
description "Reverse proxy"
572-
}
573-
prod_app_canary_web = containerInstance web_app {
574-
description "Canary App for deployment testing"
575-
}
576-
}
577557
deploymentNode "cleanup" {
578558
technology "Kubernetes Cron Job"
579559
prod_task_cleanup = containerInstance task_cleanup
@@ -603,14 +583,6 @@ workspace "${SERVICE_NAME}" "Mozilla's service providing email and phone masks."
603583
technology "Kubernetes Cron Job"
604584
prod_task_welcome = containerInstance task_welcome
605585
}
606-
deploymentNode "iprepd-nginx" {
607-
technology "Kubernetes Deployment"
608-
instances 3
609-
prod_iprepd_nginx = infrastructureNode "iprepd-nginx" {
610-
description "Tracks IP reputation, blocks IPs"
611-
tags "Deployment Service"
612-
}
613-
}
614586
deploymentNode "statsd-telegraf" {
615587
technology "Kubernetes Deployment"
616588
instances 1
@@ -638,7 +610,7 @@ workspace "${SERVICE_NAME}" "Mozilla's service providing email and phone masks."
638610
}
639611
deploymentNode "Cloud Load Balancing" {
640612
prod_lb = infrastructureNode "Load Balancer" {
641-
description "Zone for prod.fxprivaterelay.prod.cloudops.mozgcp.net"
613+
description "Zone for prod.relay.prod.webservices.mozgcp.net"
642614
tags "Managed Service"
643615
}
644616
}
@@ -666,19 +638,17 @@ workspace "${SERVICE_NAME}" "Mozilla's service providing email and phone masks."
666638
deploymentNode twilio.com {
667639
prod_phone = containerInstance phone_service
668640
}
669-
prod_iprepd_nginx -> prod_app_nginx "Requests" "HTTP"
670-
prod_iprepd_nginx -> prod_app_canary_nginx "Requests" "HTTP"
641+
prod_fastly -> prod_lb "Requests" "HTTP"
642+
prod_lb -> prod_app_nginx "Requests" "HTTP"
671643
prod_app_nginx -> prod_app_web "Requests" "HTTP 1.0"
672-
prod_app_canary_nginx -> prod_app_canary_web "Requests" "HTTP"
673644
prod_logs -> prod_bq "Forwards Logs"
674-
prod_lb -> prod_iprepd_nginx "Requests" "HTTP"
675-
prod_web -> prod_lb "Uses API, requests static assets"
676-
prod_add_on -> prod_lb "Uses API, sends UI events"
677-
prod_firefox -> prod_lb "Uses API"
678-
prod_other_client -> prod_lb "Uses API"
645+
prod_web -> prod_fastly "Uses API, requests static assets"
646+
prod_add_on -> prod_fastly "Uses API, sends UI events"
647+
prod_firefox -> prod_fastly "Uses API"
648+
prod_other_client -> prod_fastly "Uses API"
679649
prod_cloudwatch -> prod_metrics "Pulls metrics"
680-
prod_phone -> prod_lb "Informs of incoming SMS and calls"
681-
prod_email_topic -> prod_lb "Sends emails, complaints, bounces" "SQS" "Optional Relationship"
650+
prod_phone -> prod_fastly "Informs of incoming SMS and calls"
651+
prod_email_topic -> prod_fastly "Sends emails, complaints, bounces" "SQS" "Optional Relationship"
682652
}
683653
}
684654

0 commit comments

Comments
 (0)