botsregulator/

directory
v0.0.0-...-9febfc8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 22, 2025 License: BSD-3-Clause

README

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.

Directories

Path Synopsis
cmd
botsregulator
Package main is the entrypoint to BotsRegulator.
Package main is the entrypoint to BotsRegulator.
internal
clients
Package clients defines the PRPC clients.
Package clients defines the PRPC clients.
cron
Package cron defines the service's cron job.
Package cron defines the service's cron job.
migrator
Package migrator defines the CloudBots migration main flow.
Package migrator defines the CloudBots migration main flow.
provider
Package provider provides a generic template for new Bots Provider Interfaces.
Package provider provides a generic template for new Bots Provider Interfaces.
regulator
Package regulator defines the service main flow.
Package regulator defines the service main flow.
Package protos holds the app protos.
Package protos holds the app protos.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL