|
| 1 | +# Dashboard |
| 2 | + |
| 3 | +This folder contains the components necessary to build and deploy a dashboard to |
| 4 | +visualize gRPC OSS benchmarking results. |
| 5 | + |
| 6 | +gRPC OSS benchmarks save results to [BigQuery]. The dashboard consists of two |
| 7 | +components: |
| 8 | + |
| 9 | +1. A [Postgres replicator], to transfer the results to a Postgres database. |
| 10 | +1. A Grafana dashboard, to displays the results from the Postgres database. |
| 11 | + |
| 12 | +These components can be built and deployed manually using the |
| 13 | +[Makefile](Makefile) (see [manual build](#manual-build)). |
| 14 | + |
| 15 | +Notice that the dashboard build is independent from the top-level build. |
| 16 | + |
| 17 | +## Configuration |
| 18 | + |
| 19 | +The configuration of the Postgres replicator is defined in a YAML file. The |
| 20 | +default configuration is defined here, in template form: |
| 21 | + |
| 22 | +- [config/postgres_replicator/default/config.yaml][postgres replicator config] |
| 23 | + |
| 24 | +For more information, see [Postgres replicator]. |
| 25 | + |
| 26 | +The configuration of the Grafana dashboard is defined in a set of dashboards |
| 27 | +specified in JSON files. The default configuration is defined here: |
| 28 | + |
| 29 | +- [config/grafana/dashboards/default/][grafana dashboard config] |
| 30 | + |
| 31 | +The continuous integration dashboard linked from the [gRPC performance |
| 32 | +benchmarking] page uses the default configuration. The variables |
| 33 | +`REPLICATOR_CONFIG_TEMPLATE` and `DASHBOARDS_CONFIG_DIR` can be set to build |
| 34 | +dashboards with different configurations. |
| 35 | + |
| 36 | +[bigquery]: https://cloud.google.com/bigquery |
| 37 | +[grafana dashboard config]: config/grafana/dashboards/default/ |
| 38 | +[grpc performance benchmarking]: https://grpc.io/docs/guides/benchmarking/ |
| 39 | +[postgres replicator]: cmd/postgres_replicator/README.md |
| 40 | +[postgres replicator config]: config/postgres_replicator/default/config.yaml |
| 41 | + |
| 42 | +## Manual build |
| 43 | + |
| 44 | +Several environment variables must be set before building and deploying. The |
| 45 | +table below shows the names and values of the variables in our main dashboard: |
| 46 | + |
| 47 | +| Variable | Value | |
| 48 | +| --------------------------- | --------------------------------------------- | |
| 49 | +| `BQ_PROJECT_ID` | `grpc-testing` | |
| 50 | +| `CLOUD_SQL_INSTANCE` | `grpc-testing:us-central1:grafana-datasource` | |
| 51 | +| `GCP_DATA_TRANSFER_SERVICE` | `postgres-replicator` | |
| 52 | +| `GCP_GRAFANA_SERVICE` | `grafana` | |
| 53 | +| `GCP_PROJECT_ID` | `grpc-testing` | |
| 54 | +| `GRAFANA_ADMIN_PASS` | \*\*\* | |
| 55 | +| `PG_DATABASE` | `datasource` | |
| 56 | +| `PG_PASS` | \*\*\* | |
| 57 | +| `PG_USER` | `grafana-user` | |
| 58 | + |
| 59 | +Docker files that can be used to build and deploy the Postgres replicator and |
| 60 | +Grafana dashboard are then created with the following commands: |
| 61 | + |
| 62 | +```shell |
| 63 | +make configure-replicator |
| 64 | +make configure-dashboard |
| 65 | +``` |
| 66 | + |
| 67 | +## Cloud build |
| 68 | + |
| 69 | +The continuous integration dashboard is built and deployed with [Cloud Build], |
| 70 | +using the configuration specified in [cloudbuild.yaml](cloudbuild.yaml). |
| 71 | + |
| 72 | +The use of Cloud Build allows the dashboard to be redeployed automatically on |
| 73 | +configuration changes. In addition, it allows passwords such as `PG_PASS` and |
| 74 | +`GRAFANA_ADMIN_PASS` to be stored as secrets in the cloud project. |
| 75 | + |
| 76 | +[cloud build]: https://cloud.google.com/build |
0 commit comments