[gold] Update documentation for running local Gold instance
Bug: b/335227230
Change-Id: I28396adc7a3346d1924b03142a635915a46f7511
Reviewed-on: https://skia-review.googlesource.com/c/buildbot/+/846891
Reviewed-by: Kaylee Lubick <kjlubick@google.com>
Auto-Submit: Ming Kong <mingkong@google.com>
Commit-Queue: Ming Kong <mingkong@google.com>
diff --git a/golden/BUILD.bazel b/golden/BUILD.bazel
index cce8600..a2a0fe0 100644
--- a/golden/BUILD.bazel
+++ b/golden/BUILD.bazel
@@ -142,7 +142,7 @@
# Runs a local Gold instance that mirrors http://gold.skia.org. It might have write access to the
# production CockroachDB database, so please exercise caution.
#
-# Usage: bazel run //golden:skia_local -- path/to/client_secret.json
+# Usage: bazel run //golden:skia_local
gold_launcher(
name = "skia_local",
code_review_systems = [
@@ -209,7 +209,7 @@
# Runs a local Gold instance that mirrors http://skia-infra-gold.skia.org. It might have write
# access to the production CockroachDB database, so please exercise caution.
#
-# Usage: bazel run //golden:skia_infra_local -- path/to/client_secret.json
+# Usage: bazel run //golden:skia_infra_local
gold_launcher(
name = "skia_infra_local",
code_review_systems = [
@@ -239,7 +239,7 @@
# Runs a local Gold instance that mirrors http://chrome-gold.skia.org. It might have write access
# to the production CockroachDB database, so please exercise caution.
#
-# Usage: bazel run //golden:chrome_local -- path/to/client_secret.json
+# Usage: bazel run //golden:chrome_local
gold_launcher(
name = "chrome_local",
code_review_systems = [
@@ -310,7 +310,7 @@
# Runs a local Gold instance that mirrors http://chrome-public-gold.skia.org. It might have write
# access to the production CockroachDB database, so please exercise caution.
#
-# Usage: bazel run //golden:chrome_public_local -- path/to/client_secret.json
+# Usage: bazel run //golden:chrome_public_local
gold_launcher(
name = "chrome_public_local",
code_review_systems = [
@@ -442,7 +442,7 @@
# Runs a local Gold instance that mirrors http://flutter-gold.skia.org. It might have write access
# to the production CockroachDB database, so please exercise caution.
#
-# Usage: bazel run //golden:flutter_local -- path/to/client_secret.json
+# Usage: bazel run //golden:flutter_local
gold_launcher(
name = "flutter_local",
code_review_systems = [
@@ -473,7 +473,7 @@
# Runs a local Gold instance that mirrors http://flutter-engine-gold.skia.org. It might have write access
# to the production CockroachDB database, so please exercise caution.
#
-# Usage: bazel run //golden:flutter_engine_local -- path/to/client_secret.json
+# Usage: bazel run //golden:flutter_engine_local
gold_launcher(
name = "flutter_engine_local",
code_review_systems = [
diff --git a/golden/Makefile b/golden/Makefile
index 45945d3..8fb3f4d 100644
--- a/golden/Makefile
+++ b/golden/Makefile
@@ -43,3 +43,15 @@
.PHONY: mocks
mocks:
go generate ./...
+
+# Run auth proxy (port 8003) in front of the local gold instance (port 8000).
+.PHONY: run_auth_proxy_before_local_instance
+run_auth_proxy_before_local_instance:
+ $(BAZEL) run --config=mayberemote //kube/cmd/auth-proxy -- \
+ --prom-port=:20003 \
+ --role=editor=google.com \
+ --authtype=mocked \
+ --mock_user=$(USER)@google.com \
+ --port=:8003 \
+ --target_port=http://127.0.0.1:8000 \
+ --local
diff --git a/golden/README.md b/golden/README.md
index bb5d877..3362c0c 100644
--- a/golden/README.md
+++ b/golden/README.md
@@ -5,8 +5,10 @@
For an architectural overview, see:
<https://docs.google.com/document/d/1U7eBzYrZCPx24Lp9JH2scKj3G8Gr8GRtQJZRhdigyRQ/edit>
-To run Gold locally, see:
-<https://skia.googlesource.com/infra-internal/+show/c6fad0bec78c6768ce7e4187606325216dd438ed/scripts/start-gold-chrome-gpu.sh>
+To run Gold locally, run a local target defined in BUILD.bazel.
+E.g. `bazel run //golden:skia_infra_local`. Then run `make run_auth_proxy_before_local_instance`.
+You can then access the local Gold instance through http://localhost:8003 with the current
+user authenticated.
## Backend Storage
diff --git a/golden/gold_launcher.bzl b/golden/gold_launcher.bzl
index 5cf1f28..c4ddddf 100644
--- a/golden/gold_launcher.bzl
+++ b/golden/gold_launcher.bzl
@@ -5,10 +5,6 @@
# Curly braces are escaped ("{" becomes "{{", "}" becomes "}}") because we will format this
# template with https://bazel.build/rules/lib/string#format.
_RUNNER_SCRIPT = """
-if [[ -z "$$1" ]]; then
- echo "Usage: bazel run {bazel_target_name} -- /path/to/client_secret.json"
- exit 1
-fi
# Compute the path to the directory with web assets by extracting the parent directory of an
# arbitrary page. This works because all web assets are generated on the same directory (with the