Skip to content

Commit 06629f5

Browse files
committed
Address PR feedback
1 parent bffb53b commit 06629f5

File tree

8 files changed

+982
-136
lines changed

8 files changed

+982
-136
lines changed

openapi/openapiv2.json

Lines changed: 460 additions & 24 deletions
Large diffs are not rendered by default.

openapi/openapiv3.yaml

Lines changed: 412 additions & 39 deletions
Large diffs are not rendered by default.

temporal/api/compute/v1/config.proto

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,33 @@ import "temporal/api/compute/v1/provider.proto";
1313
import "temporal/api/compute/v1/scaler.proto";
1414
import "temporal/api/enums/v1/task_queue.proto";
1515

16+
message ComputeConfigScalingGroup {
17+
// Optional. The set of task queue types this scaling group serves.
18+
// If not provided, this scaling group serves all not otherwise defined
19+
// task types.
20+
repeated temporal.api.enums.v1.TaskQueueType task_queue_types = 1;
21+
22+
// Stores instructions for a worker control plane controller how to respond
23+
// to worker lifeycle events.
24+
temporal.api.compute.v1.ComputeProvider provider = 3;
25+
26+
// Informs a worker lifecycle controller *when* and *how often* to perform
27+
// certain worker lifecycle actions like starting a serverless worker.
28+
temporal.api.compute.v1.ComputeScaler scaler = 4;
29+
}
30+
1631
// ComputeConfig stores configuration that helps a worker control plane
1732
// controller understand *when* and *how* to respond to worker lifecycle
1833
// events.
1934
message ComputeConfig {
20-
message ComputeConfigEntry {
21-
// The set of task queue types this compute config serves.
22-
repeated temporal.api.enums.v1.TaskQueueType task_queue_types = 1;
23-
24-
// Stores instructions for a worker control plane controller how to respond
25-
// to worker lifeycle events.
26-
temporal.api.compute.v1.ComputeProvider provider = 2;
27-
28-
// Informs a worker lifecycle controller *when* and *how often* to perform
29-
// certain worker lifecycle actions like starting a serverless worker.
30-
temporal.api.compute.v1.ComputeScaler scaler = 3;
31-
}
32-
33-
// Each entry describes a compute config for a specific subset of the deployment's scope.
34-
// Entries might be seperated by different task queue types.
35-
repeated ComputeConfigEntry entries = 1;
35+
36+
// Each scaling group describes a compute config for a specific subset of the worker
37+
// deployment version: covering a specific set of task types and/or regions.
38+
// Having different configurations for different task types, allows independent
39+
// tuning of activity and workflow task processing (for example).
40+
//
41+
// The key of the map is the ID of the scaling group used to reference it in subsequent
42+
// update calls.
43+
map<string, ComputeConfigScalingGroup> scaling_groups = 1;
3644
}
3745

temporal/api/compute/v1/provider.proto

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,14 @@ message ComputeProvider {
2121
// can be used by implementations to understand how to interpret the
2222
// contents of the provider_details field.
2323
string type = 1;
24+
2425
// Contains provider-specific instructions and configuration.
25-
oneof detail {
26-
// will be an unencrypted, JSON-encoded object of provider-specific
27-
// information
28-
// (-- api-linter: core::0146::any=disabled
29-
// aip.dev/not-precedent: This needs to be extensible to
30-
// externally-written compute providers --)
31-
string detail_json = 2;
32-
// will be an encrypted, encoded bytestring containing
33-
// provider-specific information. The implementation must understand
34-
// how to decrypt the payload.
35-
temporal.api.common.v1.Payload detail_payload = 3;
36-
}
26+
// For server-implemented providers, use the SDK's default content
27+
// converter to ensure the server can understand it.
28+
// For remote-implemented providers, you might use your own content
29+
// converters according to what the remote endpoints understand.
30+
temporal.api.common.v1.Payload details = 2;
31+
3732
// Optional. If the compute provider is a Nexus service, this should point
3833
// there.
3934
string nexus_endpoint = 10;

temporal/api/compute/v1/scaler.proto

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,15 @@ import "temporal/api/common/v1/message.proto";
1414
// ComputeScaler instructs the Temporal Service when to scale up or down the number of
1515
// Workers that comprise a WorkerDeployment.
1616
message ComputeScaler {
17-
// type of the compute scaler. this string is implementation-specific and
17+
// Type of the compute scaler. this string is implementation-specific and
1818
// can be used by implementations to understand how to interpret the
1919
// contents of the scaler_details field.
2020
string type = 1;
2121

2222
// Contains scaler-specific instructions and configuration.
23-
oneof detail {
24-
// will be an unencrypted, JSON-encoded object of scaler-specific
25-
// information
26-
// (-- api-linter: core::0146::any=disabled
27-
// aip.dev/not-precedent: This needs to be extensible to
28-
// externally-written compute scalers --)
29-
string detail_json = 2;
30-
31-
// will be an encrypted, encoded bytestring containing
32-
// scaler-specific information. The implementation must understand
33-
// how to decrypt the payload.
34-
temporal.api.common.v1.Payload detail_payload = 3;
35-
}
23+
// For server-implemented scalers, use the SDK's default content
24+
// converter to ensure the server can understand it.
25+
// For remote-implemented scalers, you might use your own content
26+
// converters according to what the remote endpoints understand.
27+
temporal.api.common.v1.Payload details = 2;
3628
}

temporal/api/deployment/v1/message.proto

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,10 +216,6 @@ message WorkerDeploymentInfo {
216216
// relevant task queues and their partitions.
217217
temporal.api.enums.v1.RoutingConfigUpdateState routing_config_update_state = 7;
218218

219-
// Contains information used by worker control plane controllers to handle
220-
// scale events.
221-
temporal.api.compute.v1.ComputeConfig compute_config = 20;
222-
223219
message WorkerDeploymentVersionSummary {
224220
// Deprecated. Use `deployment_version`.
225221
string version = 1 [deprecated = true];

temporal/api/workflowservice/v1/request_response.proto

Lines changed: 56 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1268,10 +1268,10 @@ message GetSystemInfoResponse {
12681268
// This flag is dependent both on server version and for Nexus to be enabled via server configuration.
12691269
bool nexus = 11;
12701270

1271-
// True if the server supports serverless deployments.
1272-
// This flag is dependent both on server version and for serverless deployments
1271+
// True if the server supports server-scaled deployments.
1272+
// This flag is dependent both on server version and for server-scaled deployments
12731273
// to be enabled via server configuration.
1274-
bool serverless_deployments = 12;
1274+
bool server_scaled_deployments = 12;
12751275

12761276
}
12771277
}
@@ -2353,10 +2353,6 @@ message CreateWorkerDeploymentRequest {
23532353
// this name already exists, an error will be returned.
23542354
string deployment_name = 2;
23552355

2356-
// Optional. Contains the new worker compute configuration for the Worker
2357-
// Deployment. Used for worker scale management.
2358-
temporal.api.compute.v1.ComputeConfig compute_config = 3;
2359-
23602356
// Optional. The identity of the client who initiated this request.
23612357
string identity = 4;
23622358
// A unique identifier for this create request for idempotence. Typically UUIDv4.
@@ -2402,20 +2398,16 @@ message CreateWorkerDeploymentVersionRequest {
24022398
// Required.
24032399
temporal.api.deployment.v1.WorkerDeploymentVersion deployment_version = 2;
24042400

2405-
// All the Task Queues that will be polled from this Deployment version.
2406-
repeated VersionTaskQueueInfo task_queue_infos = 6;
2407-
message VersionTaskQueueInfo {
2408-
string name = 1;
2409-
temporal.api.enums.v1.TaskQueueType type = 2;
2410-
}
2411-
24122401
// Optional. Contains the new worker compute configuration for the Worker
24132402
// Deployment. Used for worker scale management.
2414-
temporal.api.compute.v1.ComputeConfig compute_config = 3;
2403+
temporal.api.compute.v1.ComputeConfig compute_config = 4;
24152404

24162405
// Optional. The identity of the client who initiated this request.
2417-
string identity = 4;
2406+
string identity = 3;
2407+
24182408
// A unique identifier for this create request for idempotence. Typically UUIDv4.
2409+
// If a second request with the same ID is recieved, it is considered a successful no-op.
2410+
// Retrying with a different request ID for the same deployment name + build ID is an error.
24192411
string request_id = 5;
24202412
}
24212413

@@ -2460,22 +2452,63 @@ message DeleteWorkerDeploymentRequest {
24602452
message DeleteWorkerDeploymentResponse {
24612453
}
24622454

2463-
// Used to update the compute provider of a Worker Deployment Version.
2464-
message UpdateWorkerDeploymentVersionComputeProviderRequest {
2455+
// Used to update the compute config of a Worker Deployment Version.
2456+
message UpdateWorkerDeploymentVersionComputeConfigRequest {
24652457
string namespace = 1;
24662458

24672459
// Required.
24682460
temporal.api.deployment.v1.WorkerDeploymentVersion deployment_version = 2;
24692461

2470-
// Optional. Contains the new worker compute configuration for the Worker
2471-
// Deployment. Used for worker scale management.
2472-
temporal.api.compute.v1.ComputeConfig compute_config = 3;
2462+
message ScalingGroupUpdate {
2463+
temporal.api.compute.v1.ComputeConfigScalingGroup scaling_group = 1;
2464+
2465+
// Controls which fields from `scaling_group` will be applied
2466+
google.protobuf.FieldMask update_mask = 2;
2467+
}
2468+
2469+
// Optional. Contains the compute config scaling groups to add or updated for the Worker
2470+
// Deployment.
2471+
map<string, ScalingGroupUpdate> compute_config_scaling_groups = 6;
2472+
2473+
// Optional. Contains the compute config scaling groups to remove from the Worker Deployment.
2474+
repeated string remove_compute_config_scaling_groups = 7;
24732475

24742476
// Optional. The identity of the client who initiated this request.
2475-
string identity = 4;
2477+
string identity = 3;
2478+
2479+
// A unique identifier for this create request for idempotence. Typically UUIDv4.
2480+
// If a second request with the same ID is recieved, it is considered a successful no-op.
2481+
// Retrying with a different request ID for the same deployment name + build ID is an error.
2482+
string request_id = 4;
2483+
2484+
// Optional. This value is returned so that it can be optionally passed to APIs
2485+
// that write to the Worker Deployment state to ensure that the state
2486+
// did not change between this API call and a future write.
2487+
bytes conflict_token = 5;
2488+
}
2489+
2490+
message UpdateWorkerDeploymentVersionComputeConfigResponse {
2491+
// This value is returned so that it can be optionally passed to APIs that
2492+
// write to the WorkerDeployment state to ensure that the state did not
2493+
// change between this API call and a future write.
2494+
bytes conflict_token = 1;
2495+
}
2496+
2497+
// Used to validate the compute config without attaching it to a Worker Deployment Version.
2498+
message ValidateWorkerDeploymentVersionComputeConfigRequest {
2499+
string namespace = 1;
2500+
2501+
// Required.
2502+
temporal.api.deployment.v1.WorkerDeploymentVersion deployment_version = 2;
2503+
2504+
// Required. Contains the new worker compute configuration for the Worker Deployment.
2505+
temporal.api.compute.v1.ComputeConfig compute_config = 4;
2506+
2507+
// Optional. The identity of the client who initiated this request.
2508+
string identity = 3;
24762509
}
24772510

2478-
message UpdateWorkerDEploymentVersionComputeProviderResponse {
2511+
message ValidateWorkerDeploymentVersionComputeConfigResponse {
24792512
}
24802513

24812514
// Used to update the user-defined metadata of a Worker Deployment Version.

temporal/api/workflowservice/v1/service.proto

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1146,14 +1146,27 @@ service WorkflowService {
11461146
};
11471147
}
11481148

1149-
// Updates the compute provider attached to a Worker Deployment Version.
1149+
// Updates the compute config attached to a Worker Deployment Version.
11501150
// Experimental. This API might significantly change or be removed in a future release.
1151-
rpc UpdateWorkerDeploymentVersionComputeProvider (UpdateWorkerDeploymentVersionComputeProviderRequest) returns (UpdateWorkerDEploymentVersionComputeProviderResponse) {
1151+
rpc UpdateWorkerDeploymentVersionComputeConfig (UpdateWorkerDeploymentVersionComputeConfigRequest) returns (UpdateWorkerDeploymentVersionComputeConfigResponse) {
11521152
option (google.api.http) = {
1153-
post: "/namespaces/{namespace}/worker-deployment-versions/{deployment_version.deployment_name}/{deployment_version.build_id}/update-compute"
1153+
post: "/namespaces/{namespace}/worker-deployment-versions/{deployment_version.deployment_name}/{deployment_version.build_id}/update-compute-config"
11541154
body: "*"
11551155
additional_bindings {
1156-
post: "/api/v1/namespaces/{namespace}/worker-deployment-versions/{deployment_version.deployment_name}/{deployment_version.build_id}/update-compute"
1156+
post: "/api/v1/namespaces/{namespace}/worker-deployment-versions/{deployment_version.deployment_name}/{deployment_version.build_id}/update-compute-config"
1157+
body: "*"
1158+
}
1159+
};
1160+
}
1161+
1162+
// Validates the compute config without attaching it to a Worker Deployment Version.
1163+
// Experimental. This API might significantly change or be removed in a future release.
1164+
rpc ValidateWorkerDeploymentVersionComputeConfig (ValidateWorkerDeploymentVersionComputeConfigRequest) returns (ValidateWorkerDeploymentVersionComputeConfigResponse) {
1165+
option (google.api.http) = {
1166+
post: "/namespaces/{namespace}/worker-deployment-versions/{deployment_version.deployment_name}/{deployment_version.build_id}/validate-compute-config"
1167+
body: "*"
1168+
additional_bindings {
1169+
post: "/api/v1/namespaces/{namespace}/worker-deployment-versions/{deployment_version.deployment_name}/{deployment_version.build_id}/validate-compute-config"
11571170
body: "*"
11581171
}
11591172
};

0 commit comments

Comments
 (0)