-
Notifications
You must be signed in to change notification settings - Fork 84
Add Deployment Pre-Release APIs #479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
aad202a
12ec5b2
bf6ec80
a432c29
d3bd873
6421777
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| // 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/deployment.proto"; | ||
| import "temporal/api/enums/v1/task_queue.proto"; | ||
| import "temporal/api/common/v1/message.proto"; | ||
|
|
||
| // Identifies a worker deployment. A worker deployment is identified by the combination of | ||
| // deployment name + build ID. Both values are required. | ||
| message Deployment { | ||
| string deployment_name = 1; | ||
| string build_id = 2; | ||
| } | ||
|
|
||
| // Holds information about a worker deployment. | ||
|
||
| message DeploymentInfo { | ||
| Deployment deployment = 1; | ||
| enums.v1.DeploymentStatus status = 2; | ||
ShahabT marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| google.protobuf.Timestamp status_change_time = 3; | ||
| // A user-defined set of fields. Can be updated via other write operations to the deployment, | ||
| // such as SetCurrentDeployment. | ||
| common.v1.Memo memo = 4; | ||
ShahabT marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| repeated TaskQueueInfo task_queues_info = 5; | ||
ShahabT marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| message TaskQueueInfo { | ||
| string task_queue_name = 1; | ||
| enums.v1.TaskQueueType task_queue_type = 2; | ||
| // When server saw the first poller for this task queue in this deployment. | ||
| google.protobuf.Timestamp first_poller_time = 3; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would add last_poller_time if technically possible. Can be updated lazily.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 That's possible and I agree we should have it. Will create a task for it (can't do right away because of more technical work).
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think it belongs here. As this time is per build id. Or this message should be renamed to the DeploymentTaskQueueInfo
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The message is already nested in
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Message names are top level. So someone looking at the name will not see where it is used.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @mfateev This message name is nested, not top level. Are suggesting we should not have nested message definitions and only top level? |
||
| } | ||
| } | ||
|
|
||
| // Used as part of Deployment write APIs to update metadata attached to a deployment. | ||
| message UpdateDeploymentMemo { | ||
| common.v1.Memo upsert_entries = 1; | ||
| repeated string remove_entries = 2; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| // 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"; | ||
|
|
||
| // Status of a deployment. Among all deployments with shared deployment name, at most one can have | ||
| // `RAMPING` status, and at most one can have `CURRENT` status. | ||
| // | ||
| // (-- api-linter: core::0216::synonyms=disabled | ||
| // aip.dev/not-precedent: This enum specifies the status of the deployment among all deployments | ||
| // of the same name, therefore `DeploymentStatus` is a better name that `DeploymentState`. --) | ||
| enum DeploymentStatus { | ||
| DEPLOYMENT_STATUS_UNSPECIFIED = 0; | ||
| // The deployment does not have a special status. | ||
| DEPLOYMENT_STATUS_NO_STATUS = 1; | ||
|
||
| // The deployment is the ramping deployment for the deployment name. | ||
| DEPLOYMENT_STATUS_RAMPING = 2; | ||
| // The deployment is the current deployment for the deployment name. | ||
| DEPLOYMENT_STATUS_CURRENT = 3; | ||
|
||
| } | ||
|
|
||
| // 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 open workflows that can only run on this deployment. The | ||
| // deployment cannot be decommissioned safely. | ||
| DEPLOYMENT_REACHABILITY_OPEN_WORKFLOWS = 1; | ||
| // The deployment is not reachable by open workflows but might be still needed by closed | ||
| // workflows who can only run Queries on this deployment. 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; | ||
| } | ||
ShahabT marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -39,12 +39,14 @@ import "temporal/api/enums/v1/failed_cause.proto"; | |||
| import "temporal/api/enums/v1/query.proto"; | ||||
| import "temporal/api/enums/v1/reset.proto"; | ||||
| import "temporal/api/enums/v1/task_queue.proto"; | ||||
| import "temporal/api/enums/v1/deployment.proto"; | ||||
| import "temporal/api/enums/v1/update.proto"; | ||||
| import "temporal/api/activity/v1/message.proto"; | ||||
| import "temporal/api/common/v1/message.proto"; | ||||
| import "temporal/api/history/v1/message.proto"; | ||||
| import "temporal/api/workflow/v1/message.proto"; | ||||
| import "temporal/api/command/v1/message.proto"; | ||||
| import "temporal/api/deployment/v1/message.proto"; | ||||
| import "temporal/api/failure/v1/message.proto"; | ||||
| import "temporal/api/filter/v1/message.proto"; | ||||
| import "temporal/api/protocol/v1/message.proto"; | ||||
|
|
@@ -1737,3 +1739,69 @@ message UpdateWorkflowExecutionOptionsResponse { | |||
| // Workflow Execution options after update. | ||||
| temporal.api.workflow.v1.WorkflowExecutionOptions workflow_execution_options = 1; | ||||
| } | ||||
|
|
||||
| message DescribeDeploymentRequest { | ||||
| string namespace = 1; | ||||
| deployment.v1.Deployment deployment = 2; | ||||
| } | ||||
|
|
||||
| message DescribeDeploymentResponse { | ||||
| deployment.v1.DeploymentInfo deployment_info = 1; | ||||
| } | ||||
|
|
||||
| message ListDeploymentsRequest { | ||||
ShahabT marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
| int32 page_size = 1; | ||||
| bytes next_page_token = 2; | ||||
| string namespace = 3; | ||||
| // Optional. Use to filter based on deployment name. | ||||
| string deployment_name = 4; | ||||
ShahabT marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||
| } | ||||
|
|
||||
| message ListDeploymentsResponse { | ||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we clarify the ordering of the results in a comment here?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is going to be roughly sorted based on deployment creation time, decending. Although if a deployment has a very high number of TQs (or very high number of events happening to it) it will CaN and the sort will be mixed up. In reality we are relying on Visibility sort which is based on WF start time. I prefer to keep this unspecified until we have a guaranteed order in the future. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Something's not right here. I don't see a use case for listing all the deployments, intermixed, regardless of deployment name. The two scenarios I can think of are users asking: If users do want them all in one endpoint, or if we want that for our UI, it would be a list of lists. But that seems puntable for the unblock , here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I also question the value of an undisclosed, flaky ordering. Users will naturally expect a time-reverse ordering regardless of what we say here.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe the shuffle is sufficiently unlikely and we can fix it after pre-release. It also won't be a total shuffle, one/few over active deployment will be at the top, the fact that they are over active might mean they are also new builds. |
||||
| bytes next_page_token = 1; | ||||
| repeated DeploymentInfo deployments = 2; | ||||
|
|
||||
| message DeploymentInfo { | ||||
| deployment.v1.Deployment deployment = 1; | ||||
| enums.v1.DeploymentStatus status = 2; | ||||
| google.protobuf.Timestamp status_change_time = 3; | ||||
| } | ||||
|
||||
| // ScheduleListInfo is an abbreviated set of values from Schedule and ScheduleInfo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed it to DeploymentListInfo similar to schedules.
cretz marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this API should exist as all changes to a deployment should happen through a rollout.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mfateev I've been meaning to mention to you--for pre-release, we're planning to ship this lower-level API. We're working on the design for the rollout API for public preview, at which time we will support ramp pre-deploy testing as part of a bigger rollout API. Then, we can deprecate this API.
The team is currently focused on execution, but expect to review the rollout API design in December.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I annotated this and other APIs as "Experimental" in service.proto so it's clear that they all can change or be removed in the next release.
As @drewhoskins-temporal said, this one in particular is merely a low-level placeholder until the rollout API arrives before public preview.
Uh oh!
There was an error while loading. Please reload this page.