| 490 | } |
| 491 | |
| 492 | func (s cloud) runAdmin(ctx context.Context, verbose bool, preset string) (err error) { |
| 493 | logInfo.Printf("Starting admin\n") |
| 494 | defer logInfo.Printf("Stopped admin\n") |
| 495 | |
| 496 | cmd := newCmd(ctx, "go", "run", "cli/main.go", "admin", "start") |
| 497 | cmd.Env = os.Environ() |
| 498 | if preset == "minimal" { |
| 499 | cmd.Env = append( |
| 500 | cmd.Env, |
| 501 | // This differs from the usual dev provisioner set in not having a Clickhouse provisioner. |
| 502 | `RILL_ADMIN_PROVISIONER_SET_JSON={"static":{"type":"static","spec":{"runtimes":[{"host":"http://localhost:8081","slots":50,"data_dir":"dev-cloud-state","audience_url":"http://localhost:8081"}]}}}`, |
| 503 | // Disable traces |
| 504 | "RILL_ADMIN_TRACES_EXPORTER="+string(observability.NoopExporter), |
| 505 | // Change metrics to Prometheus, which unlike Otel doesn't require an external collector. |
| 506 | "RILL_ADMIN_METRICS_EXPORTER="+string(observability.PrometheusExporter), |
| 507 | ) |
| 508 | } |
| 509 | if verbose { |
| 510 | cmd.Env = append(cmd.Env, "RILL_ADMIN_LOG_LEVEL=debug") |
| 511 | } |
| 512 | cmd.Stdout = os.Stdout |
| 513 | cmd.Stderr = os.Stdout |
| 514 | return cmd.Run() |
| 515 | } |
| 516 | |
| 517 | func (s cloud) awaitAdmin(ctx context.Context) error { |
| 518 | pingURL := lookupDotenv("RILL_ADMIN_EXTERNAL_URL") |