core/internal/cluster: add new single-node cluster code
This adds a cluster library, that consists of:
- a Node object that can be loaded from and saved into etcd,
representing a node of the cluster that can have different 'role
tags' assigned to it
- a cluster Manager, that is responsible for bringing up the local node
into a cluster (by creaating a new cluster, enrolling into or joining a
cluster)
This also gets wired into core/cmd/init, and as such completes a chunk
of The Refactor. This code should pass tests.
Test Plan: this should work! should be covered by existing e2e tests.
X-Origin-Diff: phab/D590
GitOrigin-RevId: e88022164e4353249b29fc16849a02805f15dd49
diff --git a/core/cmd/launch-multi2/BUILD.bazel b/core/cmd/launch-multi2/BUILD.bazel
index 87f4c88..867838a 100644
--- a/core/cmd/launch-multi2/BUILD.bazel
+++ b/core/cmd/launch-multi2/BUILD.bazel
@@ -8,7 +8,6 @@
deps = [
"//core/internal/common:go_default_library",
"//core/internal/launch:go_default_library",
- "//core/proto/api:go_default_library",
"@com_github_grpc_ecosystem_go_grpc_middleware//retry:go_default_library",
"@org_golang_google_grpc//:go_default_library",
],
diff --git a/core/cmd/launch-multi2/main.go b/core/cmd/launch-multi2/main.go
index f8c9035..2a38cef 100644
--- a/core/cmd/launch-multi2/main.go
+++ b/core/cmd/launch-multi2/main.go
@@ -29,7 +29,6 @@
"git.monogon.dev/source/nexantic.git/core/internal/common"
"git.monogon.dev/source/nexantic.git/core/internal/launch"
- apb "git.monogon.dev/source/nexantic.git/core/proto/api"
)
func main() {
@@ -73,16 +72,9 @@
panic(err)
}
defer conn.Close()
- cmc := api.NewClusterManagementClient(conn)
- res, err := cmc.NewEnrolmentConfig(context.Background(), &api.NewEnrolmentConfigRequest{
- Name: "test",
- }, grpcretry.WithMax(10))
- if err != nil {
- log.Fatalf("Failed to get enrolment config: %v", err)
- }
- if err := launch.Launch(ctx, launch.Options{ConnectToSocket: vm1, EnrolmentConfig: res.EnrolmentConfig, SerialPort: os.Stdout}); err != nil {
- log.Fatalf("Failed to launch vm1: %v", err)
- }
+ // TODO(D591): this gets implemented there.
+ _ = vm1
+ panic("unimplemented")
}()
if err := launch.RunMicroVM(ctx, &launch.MicroVMOptions{
SerialPort: os.Stdout,