cloud/bmaas/bmdb: init

This adds the initial Bare Metal Database structure. This change focuses
on a session/work mechanism which is the foundation on which we will
build worker components. It allows lease-like mechanics on machines,
letting us not have to use 'standard' work queues in the BMaaS project.

Change-Id: I42c3f4384c64fd90dbeab8ff9652a6f611be81d4
Reviewed-on: https://review.monogon.dev/c/monogon/+/953
Tested-by: Jenkins CI
Reviewed-by: Lorenz Brun <lorenz@monogon.tech>
diff --git a/cloud/bmaas/bmdb/BUILD.bazel b/cloud/bmaas/bmdb/BUILD.bazel
new file mode 100644
index 0000000..957a884
--- /dev/null
+++ b/cloud/bmaas/bmdb/BUILD.bazel
@@ -0,0 +1,32 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "bmdb",
+    srcs = [
+        "bmdb.go",
+        "sessions.go",
+    ],
+    importpath = "source.monogon.dev/cloud/bmaas/bmdb",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//cloud/bmaas/bmdb/model",
+        "//cloud/lib/component",
+        "@com_github_cockroachdb_cockroach_go_v2//crdb",
+        "@com_github_google_uuid//:uuid",
+        "@com_github_lib_pq//:pq",
+        "@io_k8s_klog_v2//:klog",
+    ],
+)
+
+go_test(
+    name = "bmdb_test",
+    srcs = ["sessions_test.go"],
+    data = [
+        "@cockroach",
+    ],
+    embed = [":bmdb"],
+    deps = [
+        "//cloud/bmaas/bmdb/model",
+        "//cloud/lib/component",
+    ],
+)