Skip to content

Latest commit

 

History

History
59 lines (39 loc) · 2.37 KB

operations.md

File metadata and controls

59 lines (39 loc) · 2.37 KB

Operations

Deploying and maintaining a hosted instance. Configuration keys are in CONTRIBUTING.md.

Deployment

  • Add the WebApi outbound IP addresses to the MongoDB Atlas network access list.
  • Create a web app in the Firebase project and set its ids in the BlazorApp Firebase:WebAppConfiguration:* settings.
  • Add the WebApi and BlazorApp domains to Firebase > Authentication > Settings > Authorized domains.
  • Create a GitHub OAuth application for the Firebase GitHub provider.

Several replicas are supported (see Architecture).

Telemetry

Both applications export traces, metrics and logs over OTLP once OTEL_EXPORTER_OTLP_ENDPOINT is set, and export nothing otherwise. The other standard variables configure the rest: OTEL_SERVICE_NAME, OTEL_RESOURCE_ATTRIBUTES, OTEL_EXPORTER_OTLP_PROTOCOL. Traces cover the incoming requests, the provider calls and every MongoDB command, the driver emitting its spans from the MongoDB.Driver source. The /healthz probes are left out of the traces, since the probes of every replica would outnumber the real requests.

Database indexes

scripts/mongodb-create-index.js is idempotent, and is re-run after every change to it and after every migration script:

mongosh "mongodb+srv://<user>:<password>@<cluster>.<project>.mongodb.net/<database>" scripts/mongodb-create-index.js

Migration scripts

scripts/migrate-*.js and the other one-off data scripts are idempotent and run the same way, each followed by the index script. Why a shape change needs one is in Data model.

Database backups

Create a backup:

docker run --rm -it --workdir=/data --volume "$(pwd)":/data mongo:9.0 mongodump --uri "mongodb+srv://<user>:<password>@<cluster>.<project>.mongodb.net/<database>"

Or directly with mongodump:

mongodump --uri="mongodb+srv://<user>:<password>@<cluster>.<project>.mongodb.net/<database>" --out="./mongodb-backup"

Restore a backup:

docker run --rm -it --workdir=/data --volume "$(pwd)":/data mongo:9.0 mongorestore --uri "mongodb+srv://<user>:<password>@<cluster>.<project>.mongodb.net"

Container image review

docker run --rm -it --entrypoint /bin/bash <repository>/<image>:<tag>