mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 18:51:59 +00:00
123 lines
14 KiB
Plaintext
123 lines
14 KiB
Plaintext
# MSP Testbed infrastructure operations
|
|
|
|
<!--
|
|
Generated from: unknown revision of https://github.com/sourcegraph/managed-services
|
|
-->
|
|
|
|
This document describes operational guidance for MSP Testbed infrastructure.
|
|
This service is operated on the [Managed Services Platform (MSP)](https://handbook.sourcegraph.com/departments/engineering/teams/core-services/managed-services/platform/).
|
|
|
|
> [!IMPORTANT]
|
|
> If this is your first time here, you must follow the [sourcegraph/managed-services 'Tooling setup' guide](https://github.com/sourcegraph/managed-services/blob/main/README.md) as well to clone the service definitions repository and set up the prerequisite tooling.
|
|
|
|
If you need assistance with MSP infrastructure, reach out to the [Core Services](https://handbook.sourcegraph.com/departments/engineering/teams/core-services/) team in #discuss-core-services.
|
|
|
|
## Service overview
|
|
|
|
| PROPERTY | DETAILS |
|
|
|--------------|----------------------------------------------------------------------------------------------------------------------------------|
|
|
| Service ID | `msp-testbed` ([specification](https://github.com/sourcegraph/managed-services/blob/main/services/msp-testbed/service.yaml)) |
|
|
| Owners | |
|
|
| Service kind | Cloud Run service |
|
|
| Environments | [test](#test) |
|
|
| Docker image | `us.gcr.io/sourcegraph-dev/msp-example` |
|
|
| Source code | [`github.com/sourcegraph/sourcegraph` - `cmd/msp-example`](https://github.com/sourcegraph/sourcegraph/tree/HEAD/cmd/msp-example) |
|
|
|
|
## Rollouts
|
|
|
|
| PROPERTY | DETAILS |
|
|
|-------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
| Delivery pipeline | [`msp-testbed-us-central1-rollout`](https://console.cloud.google.com/deploy/delivery-pipelines/us-central1/msp-testbed-us-central1-rollout?project=msp-testbed-test-77589aae45d0) |
|
|
| Stages | [test](#test) |
|
|
|
|
Changes to MSP Testbed are continuously delivered to the first stage ([test](#test)) of the delivery pipeline.
|
|
|
|
## Environments
|
|
|
|
### test
|
|
|
|
| PROPERTY | DETAILS |
|
|
|---------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
| Project ID | [`msp-testbed-test-77589aae45d0`](https://console.cloud.google.com/run?project=msp-testbed-test-77589aae45d0) |
|
|
| Category | **test** |
|
|
| Deployment type | `rollout` |
|
|
| Resources | |
|
|
| Slack notifications | [#alerts-msp-testbed-test](https://sourcegraph.slack.com/archives/alerts-msp-testbed-test) |
|
|
| Alert policies | [GCP Monitoring alert policies list](https://console.cloud.google.com/monitoring/alerting/policies?project=msp-testbed-test-77589aae45d0), [Dashboard](https://console.cloud.google.com/monitoring/dashboards?pageState=%28%22dashboards%22%3A%28%22t%22%3A%22All%22%29%2C%22dashboardList%22%3A%28%22f%22%3A%22%255B%257B_22k_22_3A_22Type_22_2C_22t_22_3A10_2C_22v_22_3A_22_5C_22Custom_5C_22_22_2C_22s_22_3Atrue_2C_22i_22_3A_22category_22%257D%255D%22%29%29&project=msp-testbed-test-77589aae45d0) |
|
|
| Errors | [Sentry `msp-testbed-test`](https://sourcegraph.sentry.io/projects/msp-testbed-test/) |
|
|
|
|
MSP infrastructure access needs to be requested using Entitle for time-bound privileges. Test environments may have less stringent requirements.
|
|
|
|
| ACCESS | ENTITLE REQUEST TEMPLATE |
|
|
|--------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
| GCP project read access | [Read-only Entitle request for the 'Engineering Projects' folder](https://app.entitle.io/request?data=eyJkdXJhdGlvbiI6IjIxNjAwIiwianVzdGlmaWNhdGlvbiI6IkVOVEVSIEpVU1RJRklDQVRJT04gSEVSRSIsInJvbGVJZHMiOlt7ImlkIjoiZGY3NWJkNWMtYmUxOC00MjhmLWEzNjYtYzlhYTU1MGIwODIzIiwidGhyb3VnaCI6ImRmNzViZDVjLWJlMTgtNDI4Zi1hMzY2LWM5YWE1NTBiMDgyMyIsInR5cGUiOiJyb2xlIn1dfQ%3D%3D) |
|
|
| GCP project write access | [Write access Entitle request for the 'Engineering Projects' folder](https://app.entitle.io/request?data=eyJkdXJhdGlvbiI6IjIxNjAwIiwianVzdGlmaWNhdGlvbiI6IkVOVEVSIEpVU1RJRklDQVRJT04gSEVSRSIsInJvbGVJZHMiOlt7ImlkIjoiYzJkMTUwOGEtMGQ0ZS00MjA1LWFiZWUtOGY1ODg1ZGY3ZDE4IiwidGhyb3VnaCI6ImMyZDE1MDhhLTBkNGUtNDIwNS1hYmVlLThmNTg4NWRmN2QxOCIsInR5cGUiOiJyb2xlIn1dfQ%3D%3D) |
|
|
|
|
For Terraform Cloud access, see [test Terraform Cloud](#test-terraform-cloud).
|
|
|
|
#### test Cloud Run
|
|
|
|
The MSP Testbed test service implementation is deployed on [Google Cloud Run](https://cloud.google.com/run).
|
|
|
|
| PROPERTY | DETAILS |
|
|
|----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
| Console | [Cloud Run service](https://console.cloud.google.com/run?project=msp-testbed-test-77589aae45d0) |
|
|
| Service logs | [GCP logging](https://console.cloud.google.com/logs/query;query=resource.type%20%3D%20%22cloud_run_revision%22%20-logName%3D~%22logs%2Frun.googleapis.com%252Frequests%22;summaryFields=jsonPayload%252FInstrumentationScope,jsonPayload%252FBody,jsonPayload%252FAttributes%252Ferror:false:32:end?project=msp-testbed-test-77589aae45d0) |
|
|
| Service traces | [Cloud Trace](https://console.cloud.google.com/traces/list?project=msp-testbed-test-77589aae45d0) |
|
|
| Service errors | [Sentry `msp-testbed-test`](https://sourcegraph.sentry.io/projects/msp-testbed-test/) |
|
|
|
|
You can also use `sg msp` to quickly open a link to your service logs:
|
|
|
|
```bash
|
|
sg msp logs msp-testbed test
|
|
```
|
|
|
|
#### test Architecture Diagram
|
|
|
|

|
|
|
|
#### test Terraform Cloud
|
|
|
|
This service's configuration is defined in [`sourcegraph/managed-services/services/msp-testbed/service.yaml`](https://github.com/sourcegraph/managed-services/blob/main/services/msp-testbed/service.yaml), and `sg msp generate msp-testbed test` 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`](https://github.com/sourcegraph/managed-services) repository, or in #alerts-msp-tfc).
|
|
|
|
> [!NOTE]
|
|
> If you are looking for service logs, see the [test Cloud Run](#test-cloud-run) section instead. In general:
|
|
>
|
|
> - check service logs ([test Cloud Run](#test-cloud-run)) if your service has gone down or is misbehaving
|
|
> - check TFC workspaces for infrastructure provisioning or configuration issues
|
|
|
|
To access this environment's Terraform Cloud workspaces, you will need to [log in to Terraform Cloud](https://app.terraform.io/app/sourcegraph) and then [request Entitle access to membership in the "Managed Services Platform Operator" TFC team](https://app.entitle.io/request?data=eyJkdXJhdGlvbiI6IjM2MDAiLCJqdXN0aWZpY2F0aW9uIjoiSlVTVElGSUNBVElPTiBIRVJFIiwicm9sZUlkcyI6W3siaWQiOiJiMzg3MzJjYy04OTUyLTQ2Y2QtYmIxZS1lZjI2ODUwNzIyNmIiLCJ0aHJvdWdoIjoiYjM4NzMyY2MtODk1Mi00NmNkLWJiMWUtZWYyNjg1MDcyMjZiIiwidHlwZSI6InJvbGUifV19).
|
|
The "Managed Services Platform Operator" team has access to all MSP TFC workspaces.
|
|
|
|
> [!WARNING]
|
|
> You **must [log in to Terraform Cloud](https://app.terraform.io/app/sourcegraph) before making your Entitle request**.
|
|
> If you make your Entitle request, then log in, you will be removed from any team memberships granted through Entitle by Terraform Cloud's SSO implementation.
|
|
|
|
The Terraform Cloud workspaces for this service environment are [grouped under the `msp-msp-testbed-test` tag](https://app.terraform.io/app/sourcegraph/workspaces?tag=msp-msp-testbed-test), or you can use:
|
|
|
|
```bash
|
|
sg msp tfc view msp-testbed test
|
|
```
|
|
|
|
## Alert Policies
|
|
|
|
The following alert policies are defined for each of this service's environments.
|
|
|
|
#### High Container CPU Utilization
|
|
|
|
```md
|
|
High CPU Usage - it may be neccessary to reduce load or increase CPU allocation
|
|
```
|
|
|
|
Severity: WARNING
|
|
|
|
#### High Container Memory Utilization
|
|
|
|
```md
|
|
High Memory Usage - it may be neccessary to reduce load or increase memory allocation
|
|
```
|
|
|
|
Severity: WARNING
|