Skip to content

Commit

Permalink
feat: explicit provisioner outputs (#2725)
Browse files Browse the repository at this point in the history
Removes the confusing generic string output property thing, and
explicitly states returned properties in the resources themselves.
Also, passes underlying platform parameters as config values to the
provisioning plugin for now. If we ever look at provisioning FTL
clusters themselves, we can rethink how to pass these properties to the
plugin.

This gives DB properties in a format like this:
```
{
  "resource_id": "foobardb",
  "Resource": {
    "Postgres": {
      "out_read_endpoint": "ftltest1-testmodule-foobardbcluster-4joq2vpkgsaz.cluster-ro-cr24kso0s7in.us-west-2.rds.amazonaws.com",
      "out_write_endpoint": "ftltest1-testmodule-foobardbcluster-4joq2vpkgsaz.cluster-cr24kso0s7in.us-west-2.rds.amazonaws.com"
    }
  }
}
```

After this, I am happy with the plugin API for now, and will start
looking at `ftl-provisioner` next.
  • Loading branch information
jvmakine authored Sep 19, 2024
1 parent bb94848 commit 69af112
Show file tree
Hide file tree
Showing 9 changed files with 554 additions and 597 deletions.
421 changes: 262 additions & 159 deletions backend/protos/xyz/block/ftl/v1beta1/provisioner/plugin.pb.go

Large diffs are not rendered by default.

19 changes: 17 additions & 2 deletions backend/protos/xyz/block/ftl/v1beta1/provisioner/plugin.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ import "xyz/block/ftl/v1beta1/provisioner/resource.proto";
option go_package = "github.com/TBD54566975/ftl/backend/protos/xyz/block/ftl/v1beta1/provisioner;provisioner";
option java_multiple_files = true;

// ResourceContext is the context used to create a new resource
// This includes the direct dependencies of the new resource, that can impact
// the resource creation.
message ResourceContext {
Resource resource = 1;
repeated Resource dependencies = 2;
}

message ProvisionRequest {
string ftl_cluster_id = 1;
string module = 2;
Expand All @@ -17,7 +25,7 @@ message ProvisionRequest {

// The resource FTL would like to exist after this provisioning run.
// This includes all new, existing, and changes resources in this change.
repeated Resource desired_resources = 4;
repeated ResourceContext desired_resources = 4;
}

message ProvisionResponse {
Expand All @@ -33,6 +41,11 @@ message ProvisionResponse {

message StatusRequest {
string provisioning_token = 1;

// The set of desired_resources used to initiate this provisioning request
// We need this as input here, so we can populate any resource fields in them
// when the provisioning finishes
repeated Resource desired_resources = 2;
}

message StatusResponse {
Expand All @@ -43,7 +56,9 @@ message StatusResponse {
}

message ProvisioningSuccess {
repeated ResourceProperty properties = 3;
// Some fields in the resources might have been populated
// during the provisioning. The new state is returned here
repeated Resource updated_resources = 1;
}

oneof status {
Expand Down
Loading

0 comments on commit 69af112

Please sign in to comment.