-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Versioning 3 Pre-Release APIs (#496)
<!-- Describe what has changed in this PR --> **What changed?** Includes: - Added `versioning_info` to `WorkflowExecutionInfo`, containing `VersioningBehavior`, current `Deployment`, `VersioningOverride`, and ongoing `DeploymentTransition` for an execution. - Added Deployment APIs, for managing worker deployments: - `DescribeDeployment` - `ListDeployments` - `GetCurrentDeployment` - `SetCurrentDeployment` (tentative) - `GetDeploymentReachability` - Added `UpdateWorkflowExecutionOptions` API (and its batch mode) so users can set versioning override for executions. - Updated data-path APIs so SDK can send `Deployment` and `VersioningBehavior` info in task completion responses and in polls. - Deprecated some fields and massages belonging to Versioning 1-2 pre-release. <!-- Tell your future self why have you made these changes --> **Why?** Versioning 3 brings improved experience compared to last iterations of this project. It adds two new concepts: VersioningBehavior and Deployment. More info can be found in the proto documentation. <!-- Are there any breaking changes on binary or code level? --> **Breaking changes** None. Versioning 1-2 pre-release APIs are still supported, until further notice. <!-- If this breaks the Server, please provide the Server PR to merge right after this PR was merged. --> **Server PR** temporalio/temporal#6890 --------- Co-authored-by: Carly de Frondeville <[email protected]>
- Loading branch information
Showing
12 changed files
with
2,423 additions
and
89 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
// The MIT License | ||
// | ||
// Copyright (c) 2020 Temporal Technologies Inc. All rights reserved. | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in | ||
// all copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
// THE SOFTWARE. | ||
|
||
syntax = "proto3"; | ||
|
||
package temporal.api.deployment.v1; | ||
|
||
option go_package = "go.temporal.io/api/deployment/v1;deployment"; | ||
option java_package = "io.temporal.api.deployment.v1"; | ||
option java_multiple_files = true; | ||
option java_outer_classname = "MessageProto"; | ||
option ruby_package = "Temporalio::Api::Deployment::V1"; | ||
option csharp_namespace = "Temporalio.Api.Deployment.V1"; | ||
|
||
import "google/protobuf/timestamp.proto"; | ||
|
||
import "temporal/api/enums/v1/task_queue.proto"; | ||
import "temporal/api/common/v1/message.proto"; | ||
|
||
// `Deployment` identifies a deployment of Temporal workers. The combination of deployment series | ||
// name + build ID serves as the identifier. User can use `WorkerDeploymentOptions` in their worker | ||
// programs to specify these values. | ||
message Deployment { | ||
// Different versions of the same worker service/application are related together by having a | ||
// shared series name. | ||
// Out of all deployments of a series, one can be designated as the current deployment, which | ||
// receives new workflow executions and new tasks of workflows with | ||
// `VERSIONING_BEHAVIOR_AUTO_UPGRADE` versioning behavior. | ||
string series_name = 1; | ||
// Build ID changes with each version of the worker when the worker program code and/or config | ||
// changes. | ||
string build_id = 2; | ||
} | ||
|
||
// `DeploymentInfo` holds information about a deployment. Deployment information is tracked | ||
// automatically by server as soon as the first poll from that deployment reaches the server. There | ||
// can be multiple task queue workers in a single deployment which are listed in this message. | ||
message DeploymentInfo { | ||
Deployment deployment = 1; | ||
google.protobuf.Timestamp create_time = 2; | ||
repeated TaskQueueInfo task_queue_infos = 3; | ||
// A user-defined set of key-values. Can be updated as part of write operations to the | ||
// deployment, such as `SetCurrentDeployment`. | ||
map<string, temporal.api.common.v1.Payload> metadata = 4; | ||
// If this deployment is the current deployment of its deployment series. | ||
bool is_current = 5; | ||
|
||
message TaskQueueInfo { | ||
string name = 1; | ||
temporal.api.enums.v1.TaskQueueType type = 2; | ||
// When server saw the first poller for this task queue in this deployment. | ||
google.protobuf.Timestamp first_poller_time = 3; | ||
} | ||
} | ||
|
||
// Used as part of Deployment write APIs to update metadata attached to a deployment. | ||
message UpdateDeploymentMetadata { | ||
map<string, temporal.api.common.v1.Payload> upsert_entries = 1; | ||
// List of keys to remove from the metadata. | ||
repeated string remove_entries = 2; | ||
} | ||
|
||
// DeploymentListInfo is an abbreviated set of fields from DeploymentInfo that's returned in | ||
// ListDeployments. | ||
message DeploymentListInfo { | ||
deployment.v1.Deployment deployment = 1; | ||
google.protobuf.Timestamp create_time = 2; | ||
// If this deployment is the current deployment of its deployment series. | ||
bool is_current = 3; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// The MIT License | ||
// | ||
// Copyright (c) 2020 Temporal Technologies Inc. All rights reserved. | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in | ||
// all copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
// THE SOFTWARE. | ||
|
||
syntax = "proto3"; | ||
|
||
package temporal.api.enums.v1; | ||
|
||
option go_package = "go.temporal.io/api/enums/v1;enums"; | ||
option java_package = "io.temporal.api.enums.v1"; | ||
option java_multiple_files = true; | ||
option java_outer_classname = "DeploymentProto"; | ||
option ruby_package = "Temporalio::Api::Enums::V1"; | ||
option csharp_namespace = "Temporalio.Api.Enums.V1"; | ||
|
||
// Specify the reachability level for a deployment so users can decide if it is time to | ||
// decommission the deployment. | ||
enum DeploymentReachability { | ||
// Reachability level is not specified. | ||
DEPLOYMENT_REACHABILITY_UNSPECIFIED = 0; | ||
// The deployment is reachable by new and/or open workflows. The deployment cannot be | ||
// decommissioned safely. | ||
DEPLOYMENT_REACHABILITY_REACHABLE = 1; | ||
// The deployment is not reachable by new or open workflows, but might be still needed by | ||
// Queries sent to closed workflows. The deployment can be decommissioned safely if user does | ||
// not query closed workflows. | ||
DEPLOYMENT_REACHABILITY_CLOSED_WORKFLOWS_ONLY = 2; | ||
// The deployment is not reachable by any workflow because all the workflows who needed this | ||
// deployment went out of retention period. The deployment can be decommissioned safely. | ||
DEPLOYMENT_REACHABILITY_UNREACHABLE = 3; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.