Sourcegraph Accounts infrastructure operations

This document describes operational guidance for Sourcegraph Accounts infrastructure. This service is operated on the Managed Services Platform (MSP).

If you need assistance with MSP infrastructure, reach out to the Core Services team in #discuss-core-services.

Service overview

PROPERTYDETAILS
Service IDsams
Ownerscore-services
Service kindCloud Run service
Environmentsdev
Docker imageus-central1-docker.pkg.dev/sourcegraph-dev/sams/accounts-server
Source codegithub.com/sourcegraph/accounts.sourcegraph.com - cmd/accounts-server

Environments

dev

PROPERTYDETAILS
Project IDsams-dev-bfec
Categorytest
Resourcesdev Redis, dev PostgreSQL instance, dev BigQuery dataset
AlertsGCP monitoring
Sentrysams-dev
Domainaccounts.sgdev.org
Cloudflare WAF

MSP infrastructure access needs to be requested using Entitle for time-bound privileges. Test environments may have less stringent requirements.

ACCESSENTITLE REQUEST TEMPLATE
GCP project read accessEntitle request for the ‘Engineering Projects’ folder
GCP project write accessEntitle request for the ‘Engineering Projects’ folder

For Terraform Cloud access, see dev Terraform Cloud.

dev Cloud Run

The Sourcegraph Accounts dev service implementation is deployed on Google Cloud Run.

PROPERTYDETAILS
ConsoleCloud Run service
Service logsGCP logging

You can also use sg msp to quickly open a link to your service logs:

sg msp logs sams dev

dev Redis

PROPERTYDETAILS
ConsoleMemorystore Redis instances

dev PostgreSQL instance

PROPERTYDETAILS
ConsoleCloud SQL instances
Databasesaccounts, cody_management

To connect to the PostgreSQL instance in this environment, use sg msp in the sourcegraph/managed-services repository:

# For read-only access
sg msp pg connect sams dev

# For write access - use with caution!
sg msp pg connect -write-access sams dev

dev BigQuery dataset

PROPERTYDETAILS
Dataset Projectsams-dev-bfec
Dataset IDsams
Tablesuser_emails, events

dev Terraform Cloud

This service’s configuration is defined in sourcegraph/managed-services/services/sams/service.yaml, and sg msp generate sams dev generates the required infrastructure configuration for this environment in Terraform. Terraform Cloud (TFC) workspaces specific to each service then provisions the required infrastructure from this configuration. You may want to check your service environment’s TFC workspaces if a Terraform apply fails (reported via GitHub commit status checks in the sourcegraph/managed-services repository, or in #alerts-msp-tfc).

To access this environment’s Terraform Cloud workspaces, you will need to log in to Terraform Cloud and then request Entitle access to membership in the “Managed Services Platform Operator” TFC team. The “Managed Services Platform Operator” team has access to all MSP TFC workspaces.

The Terraform Cloud workspaces for this service environment are grouped under the msp-sams-dev tag, or you can use:

sg msp tfc view sams dev