Skip to content

Commit 07020dc

Browse files
authored
Add region_id to ComputeConfigScalingGroup (#875)
<!-- Describe what has changed in this PR --> **What changed?** Adds an optional `region_id` field to `ComputeConfigScalingGroup`. When set, the scaling group is used only while the namespace is active in that region. When empty, the scaling group is used as the default, so existing configurations behave exactly as before. <!-- Tell your future self why have you made these changes --> **Why?** This is to let users configure region specific compute on a Worker Deployment Version. The Worker Controller Instance can then invoke the compute that is set for the namespace's active region, so serverless workers follow the namespace through a failover. <!-- Are there any breaking changes on binary or code level? --> **Breaking changes** none <!-- If this breaks the Server, please provide the Server PR to merge right after this PR was merged. --> **Server PR** none
1 parent 5200b88 commit 07020dc

3 files changed

Lines changed: 32 additions & 3 deletions

File tree

‎openapi/openapiv2.json‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15134,6 +15134,13 @@
1513415134
},
1513515135
"description": "Optional. The set of task queue types this scaling group serves.\nIf not provided, this scaling group serves all not otherwise defined\ntask types."
1513615136
},
15137+
"regionIds": {
15138+
"type": "array",
15139+
"items": {
15140+
"type": "string"
15141+
},
15142+
"description": "Optional. If set, this scaling group is used only while the namespace is\nactive in one of these regions."
15143+
},
1513715144
"provider": {
1513815145
"$ref": "#/definitions/v1ComputeProvider",
1513915146
"description": "Stores instructions for a worker control plane controller how to respond\nto worker lifeycle events."
@@ -15155,6 +15162,12 @@
1515515162
},
1515615163
"providerType": {
1515715164
"type": "string"
15165+
},
15166+
"regionIds": {
15167+
"type": "array",
15168+
"items": {
15169+
"type": "string"
15170+
}
1515815171
}
1515915172
}
1516015173
},
@@ -15166,7 +15179,7 @@
1516615179
},
1516715180
"updateMask": {
1516815181
"type": "string",
15169-
"title": "Controls which fields from `scaling_group` will be applied. Semantics:\n- Mask is ignored for new scaling groups (only applicable when scaling group already exists).\n- Empty mask for an existing scaling group is no-op: no change.\n- Non-empty mask for an existing scaling group will update/unset only to the fields\n mentioned in the mask.\n- Accepted paths: \"task_queue_types\", \"provider\", \"provider.type\", \"provider.details\",\n \"provider.nexus_endpoint\", \"scaler\", \"scaler.type\", \"scaler.details\""
15182+
"title": "Controls which fields from `scaling_group` will be applied. Semantics:\n- Mask is ignored for new scaling groups (only applicable when scaling group already exists).\n- Empty mask for an existing scaling group is no-op: no change.\n- Non-empty mask for an existing scaling group will update/unset only to the fields\n mentioned in the mask.\n- Accepted paths: \"task_queue_types\", \"region_ids\", \"provider\", \"provider.type\", \"provider.details\",\n \"provider.nexus_endpoint\", \"scaler\", \"scaler.type\", \"scaler.details\""
1517015183
}
1517115184
}
1517215185
},

‎openapi/openapiv3.yaml‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11249,6 +11249,13 @@ components:
1124911249
Optional. The set of task queue types this scaling group serves.
1125011250
If not provided, this scaling group serves all not otherwise defined
1125111251
task types.
11252+
regionIds:
11253+
type: array
11254+
items:
11255+
type: string
11256+
description: |-
11257+
Optional. If set, this scaling group is used only while the namespace is
11258+
active in one of these regions.
1125211259
provider:
1125311260
allOf:
1125411261
- $ref: '#/components/schemas/ComputeProvider'
@@ -11276,6 +11283,10 @@ components:
1127611283
format: enum
1127711284
providerType:
1127811285
type: string
11286+
regionIds:
11287+
type: array
11288+
items:
11289+
type: string
1127911290
ComputeConfigScalingGroupUpdate:
1128011291
type: object
1128111292
properties:
@@ -11289,7 +11300,7 @@ components:
1128911300
- Empty mask for an existing scaling group is no-op: no change.
1129011301
- Non-empty mask for an existing scaling group will update/unset only to the fields
1129111302
mentioned in the mask.
11292-
- Accepted paths: "task_queue_types", "provider", "provider.type", "provider.details",
11303+
- Accepted paths: "task_queue_types", "region_ids", "provider", "provider.type", "provider.details",
1129311304
"provider.nexus_endpoint", "scaler", "scaler.type", "scaler.details"
1129411305
format: field-mask
1129511306
ComputeConfigSummary:

‎temporal/api/compute/v1/config.proto‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ message ComputeConfigScalingGroup {
2020
// task types.
2121
repeated temporal.api.enums.v1.TaskQueueType task_queue_types = 1;
2222

23+
// Optional. If set, this scaling group is used only while the namespace is
24+
// active in one of these regions.
25+
repeated string region_ids = 2;
26+
2327
// Stores instructions for a worker control plane controller how to respond
2428
// to worker lifeycle events.
2529
temporal.api.compute.v1.ComputeProvider provider = 3;
@@ -52,7 +56,7 @@ message ComputeConfigScalingGroupUpdate {
5256
// - Empty mask for an existing scaling group is no-op: no change.
5357
// - Non-empty mask for an existing scaling group will update/unset only to the fields
5458
// mentioned in the mask.
55-
// - Accepted paths: "task_queue_types", "provider", "provider.type", "provider.details",
59+
// - Accepted paths: "task_queue_types", "region_ids", "provider", "provider.type", "provider.details",
5660
// "provider.nexus_endpoint", "scaler", "scaler.type", "scaler.details"
5761
google.protobuf.FieldMask update_mask = 2;
5862
}
@@ -65,4 +69,5 @@ message ComputeConfigSummary {
6569
message ComputeConfigScalingGroupSummary {
6670
repeated temporal.api.enums.v1.TaskQueueType task_queue_types = 1;
6771
string provider_type = 2;
72+
repeated string region_ids = 3;
6873
}

0 commit comments

Comments
 (0)