Clone this repo:

Branches

  1. cd43cac README: Update where to access db secrets by Cindy Lin · 3 days ago main
  2. ad72b60 cloudsql: Add script for creating `binhosts` table by Cindy Lin · 5 days ago
  3. e8dfd30 cloudsql: Add script for creating `build_target_profiles` table by Cindy Lin · 5 days ago
  4. befab75 cloudsql: Add script for creating `snapshots` table by Cindy Lin · 5 days ago
  5. e3766d1 README: Update to include deployment and connection steps by Cindy Lin · 6 days ago

The CrOS Build Prebuilts Cloud Repo

This repo houses all the GCP code for the chromeos-prebuilts project.

Cloud SQL

We have two Cloud SQL instances:

  1. prebuilts - the production instance
  2. prebuilts-staging - the staging instance

Databases

Each instance currently contains a lookup_service database for the project.

Deployments

To manually deploy changes:

  1. Upload the .sql file to Cloud Storage in the cloudsql-manual-deployments bucket.
  2. In the Cloud SQL instance overview page, select IMPORT.
  3. Select the .sql file uploaded to Cloud Storage above and select lookup_service as the database destination.
  4. Select Import and wait a few minutes for the import to complete.

Connections

The following steps can be used to connect to the database and verify deployments and/or query data:

  1. SSH to the VM instance created for the project.
  2. Open (2) SSH connections to the cloudsql-connection instance.
  3. In the (1) SSH-in-browser window, run ./cloud_sql_proxy -instances=chromeos-prebuilts:us-central1:prebuilts-staging=tcp:5432.
  4. In the (2) SSH-in-browser window, run psql "host=127.0.0.1 port=5432 sslmode=disable dbname=lookup_service user=postgres".
  5. The postgres user password can be found here.