From bd3a655c497a700d8a254e8c370ad51093db01d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juho=20M=C3=A4kinen?= Date: Mon, 16 Dec 2024 15:50:20 +1100 Subject: [PATCH] chore: remove provisioner tester (#3774) --- cmd/devel-provisioner/README.md | 3 - cmd/devel-provisioner/main.go | 99 --------------------------------- 2 files changed, 102 deletions(-) delete mode 100644 cmd/devel-provisioner/README.md delete mode 100644 cmd/devel-provisioner/main.go diff --git a/cmd/devel-provisioner/README.md b/cmd/devel-provisioner/README.md deleted file mode 100644 index f07992fdef..0000000000 --- a/cmd/devel-provisioner/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# FTL infrastructure provisioners - -This is still experimental code under heavy development, and should not be used yet! Assume all APIs here will change very frequently \ No newline at end of file diff --git a/cmd/devel-provisioner/main.go b/cmd/devel-provisioner/main.go deleted file mode 100644 index 5e6a3166a9..0000000000 --- a/cmd/devel-provisioner/main.go +++ /dev/null @@ -1,99 +0,0 @@ -package main - -// import ( -// "context" -// "encoding/json" -// "os" -// "time" - -// "connectrpc.com/connect" -// "github.com/alecthomas/kong" -// "github.com/jpillora/backoff" - -// provisioner "github.com/block/ftl/backend/protos/xyz/block/ftl/provisioner/v1beta1" -// provisionerconnect "github.com/block/ftl/backend/protos/xyz/block/ftl/provisioner/v1beta1/provisionerpbconnect" -// "github.com/block/ftl/common/plugin" -// "github.com/block/ftl/internal/log" -// ) - -// var cli struct { -// log.Config `prefix:"log-"` -// } - -// // For locally testing the provisioners. -// // You should add the provisioner being tested to your PATH before running this -func main() { - // kong.Parse(&cli) - // ctx := log.ContextWithLogger(context.Background(), log.Configure(os.Stderr, cli.Config)) - - // client, ctx, err := plugin.Spawn( - // ctx, - // log.Debug, - // "ftl-provisioner-cloudformation", - // ".", - // "ftl-provisioner-cloudformation", - // provisionerconnect.NewProvisionerPluginServiceClient, - // plugin.WithEnvars("FTL_PROVISIONER_CF_DB_SUBNET_GROUP=aurora-postgres-subnet-group"), - // plugin.WithEnvars("FTL_PROVISIONER_CF_DB_SECURITY_GROUP=sg-08e06d6f8327024de"), - // ) - // if err != nil { - // panic(err) - // } - - // desired := []*provisioner.Resource{{ - // ResourceId: "foobardb", - // Resource: &provisioner.Resource_Postgres{ - // Postgres: &provisioner.PostgresResource{}, - // }, - // }} - - // req := &provisioner.LegacyProvisionRequest{ - // FtlClusterId: "ftl-test-1", - // Module: "test-module", - // ExistingResources: []*provisioner.Resource{}, - // DesiredResources: inContext(desired), - // } - - // println("### EXECUTION ###") - // resp, err := client.Client.LegacyProvision(ctx, connect.NewRequest(req)) - // if err != nil { - // panic(err) - // } - - // retry := backoff.Backoff{ - // Min: 100 * time.Millisecond, - // Max: 5 * time.Second, - // Factor: 2, - // } - // for { - // println("polling: " + resp.Msg.ProvisioningToken) - // status, err := client.Client.LegacyStatus(ctx, connect.NewRequest(&provisioner.LegacyStatusRequest{ - // ProvisioningToken: resp.Msg.ProvisioningToken, - // DesiredResources: desired, - // })) - // if err != nil { - // panic(err) - // } - // if success, ok := status.Msg.Status.(*provisioner.LegacyStatusResponse_Success); ok { - // println("finished!") - // for _, r := range success.Success.UpdatedResources { - // jsn, err := json.MarshalIndent(r, "", " ") - // if err != nil { - // panic(err) - // } - // println(string(jsn)) - // } - // break - // } - // time.Sleep(retry.Duration()) - // } - // println("done") -} - -// func inContext(resources []*provisioner.Resource) []*provisioner.ResourceContext { -// var result []*provisioner.ResourceContext -// for _, r := range resources { -// result = append(result, &provisioner.ResourceContext{Resource: r}) -// } -// return result -// }