cloud/bmaas: implement webug
Webug (pronounced: /wɛbʌɡ/, not /wiːbʌɡ/) is a web debug interface for
BMDB, inspired by the great web debug interfaces of old.
It uses the new BMDB reflection API to access most
machine/tag/work/backoff information, plus sqlc queries to access
session information.
Change-Id: If0e65b6fc33ad92baef9c6d98333f90a02efa1b3
Reviewed-on: https://review.monogon.dev/c/monogon/+/1132
Reviewed-by: Lorenz Brun <lorenz@monogon.tech>
Tested-by: Jenkins CI
diff --git a/cloud/bmaas/bmdb/webug/BUILD.bazel b/cloud/bmaas/bmdb/webug/BUILD.bazel
new file mode 100644
index 0000000..172fd99
--- /dev/null
+++ b/cloud/bmaas/bmdb/webug/BUILD.bazel
@@ -0,0 +1,28 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+ name = "webug",
+ srcs = [
+ "functions.go",
+ "views.go",
+ "webug.go",
+ ],
+ embedsrcs = [
+ "templates/base.html",
+ "templates/fragment_tag.html",
+ "templates/fragment_tag_default.html",
+ "templates/fragment_tag_provided.html",
+ "templates/machines.html",
+ "templates/machine.html",
+ ],
+ importpath = "source.monogon.dev/cloud/bmaas/bmdb/webug",
+ visibility = ["//visibility:public"],
+ deps = [
+ "//cloud/bmaas/bmdb",
+ "//cloud/bmaas/bmdb/model",
+ "//cloud/bmaas/bmdb/reflection",
+ "@com_github_cenkalti_backoff_v4//:backoff",
+ "@com_github_google_uuid//:uuid",
+ "@io_k8s_klog_v2//:klog",
+ ],
+)