tree: 6cd11acc4c3745d0357aa3657295b714d987f7f8 [path history] [tgz]
  1. cmd/
  2. internal/
  3. protos/
  4. OWNERS
  5. README.md
go/src/infra/cros/botsregulator/README.md

BotsRegulator

BotsRegulator(BR) is a Cloud Run service with two cron jobs flow. BR does not accept incoming requests except from these cron jobs.

Context

go/botsregulator
go/cloudbots-gce
go/cloudbots

regulate-bots cron

BR periodically look for UFS DUTs with a specific hive value and send this set of DUTs to a Bots Provider API (e.g. GCE Provider).

migrate-bots cron

Used for CloudBots migration.
BR migrates/rolls back DUTs based on a migration file stored in luci-config (services/bots-regulator-dev/migration.cfg). Migrating a DUT means updating the DUT's hive to cloudbots.

cleanup-bots

Used for CloudBots migration.
Updating the list of excluded DUTs in migration.cfg does not retroactively rollback DUTs.
It only prevents new DUTs to be migrated. cleanup-bots acts as a cleanup flow and rollbacks to Drone all the excluded DUTs currently on CloudBots.

flags

To pass a service account use -service-account-json flag.

Local testing

To read a local config file: cfgmodule.NewModule(&cfgmodule.ModuleOptions{LocalDir: "<path-to-file>"}).
To read the dev config file pass this flag: -cloud-project bots-regulator-dev.

Dev

gcp project: bots-regulator-dev

Production

gcp project: bots-regulator-prod

Deployment

Deployment process can be found at data/cloud-run/projects/bots-regulator.