Skip to content

Commit

Permalink
Address feedback & rename deployment_name
Browse files Browse the repository at this point in the history
  • Loading branch information
ShahabT committed Nov 18, 2024
1 parent 12ec5b2 commit bf6ec80
Show file tree
Hide file tree
Showing 9 changed files with 186 additions and 182 deletions.
113 changes: 59 additions & 54 deletions openapi/openapiv2.json

Large diffs are not rendered by default.

139 changes: 70 additions & 69 deletions openapi/openapiv3.yaml

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions temporal/api/common/v1/message.proto
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ message WorkerVersionStamp {
// marker for workflow reset points and the BuildIDs search attribute.
bool use_versioning = 3;

// Must be sent if user has set a deployment name (versioning-3).
string deployment_name = 4;
// Must be sent if user has set a deployment series name (versioning-3).
string deployment_series_name = 4;

// Later, may include bundle id that could be used for WASM and/or JS dynamically loadable bundles.
}
Expand All @@ -150,8 +150,8 @@ message WorkerVersionCapabilities {
// tasks.
bool use_versioning = 2;

// Must be sent if user has set a deployment name (versioning-3).
string deployment_name = 3;
// Must be sent if user has set a deployment series name (versioning-3).
string deployment_series_name = 4;

// Later, may include info like "I can process WASM and/or JS bundles"
}
Expand Down
24 changes: 12 additions & 12 deletions temporal/api/deployment/v1/message.proto
Original file line number Diff line number Diff line change
Expand Up @@ -35,35 +35,35 @@ 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.
// series name + build ID. Both values are required.
message Deployment {
string deployment_name = 1;
string series_name = 1;
string build_id = 2;
}

// Holds information about a worker deployment.
message DeploymentInfo {
Deployment deployment = 1;
enums.v1.DeploymentStatus status = 2;
temporal.api.enums.v1.DeploymentStatus status = 2;
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;
repeated TaskQueueInfo task_queues_info = 5;
// A user-defined set of key-values. Can be updated as part of write operations to the
// deployment, such as `SetCurrentDeployment`.
map<string, bytes> metadata = 4;
repeated TaskQueueInfo task_queue_infos = 5;

message TaskQueueInfo {
string task_queue_name = 1;
enums.v1.TaskQueueType task_queue_type = 2;
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 UpdateDeploymentMemo {
common.v1.Memo upsert_entries = 1;
message UpdateDeploymentMetadata {
map<string, bytes> upsert_entries = 1;
// List of keys to remove from the metadata.
repeated string remove_entries = 2;
}
10 changes: 5 additions & 5 deletions temporal/api/enums/v1/deployment.proto
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,19 @@ 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.
// Status of a deployment within its deployment series. Any given deployment series can at most have
// one `RAMPING` deployment, and one `CURRENT` deployment.
//
// (-- 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`. --)
// in the same series, 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.
// The deployment is the ramping deployment for the deployment series.
DEPLOYMENT_STATUS_RAMPING = 2;
// The deployment is the current deployment for the deployment name.
// The deployment is the current deployment for the deployment series.
DEPLOYMENT_STATUS_CURRENT = 3;
}

Expand Down
4 changes: 2 additions & 2 deletions temporal/api/history/v1/message.proto
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ message WorkflowTaskCompletedEventAttributes {
message CompletedDeploymentRedirectInfo {
// The target deployment of the redirect. Null means a previously versioned workflow just
// completed a redirect to unversioned workers.
deployment.v1.Deployment deployment = 1;
temporal.api.deployment.v1.Deployment deployment = 1;
// Versioning behavior sent by SDK for this workflow execution on the new deployment.
// Must be present if and only if `deployment` is set.
temporal.api.enums.v1.VersioningBehavior versioning_behavior = 2;
Expand All @@ -269,7 +269,7 @@ message CompletedDeploymentRedirectInfo {
message FailedDeploymentRedirectInfo {
// The target deployment of the failed redirect attempt. Null means a versioned workflow
// tried to redirect to unversioned workers.
deployment.v1.Deployment deployment = 1;
temporal.api.deployment.v1.Deployment deployment = 1;
}

message WorkflowTaskTimedOutEventAttributes {
Expand Down
29 changes: 13 additions & 16 deletions temporal/api/workflow/v1/message.proto
Original file line number Diff line number Diff line change
Expand Up @@ -113,24 +113,22 @@ message WorkflowExecutionInfo {
temporal.api.enums.v1.VersioningBehavior behavior = 1;
// The worker deployment to which this workflow is assigned currently.
// Must be present if and only if `behavior` is set.
deployment.v1.Deployment deployment = 2;
// Manual override for execution's versioning behavior. Takes precedence over `behavior`.
temporal.api.enums.v1.VersioningBehavior behavior_override = 3;
// Used to manually pin the execution to a deployment. Must be set if and only if
// `behavior_override` is PINNED. Takes precedence over `deployment`.
deployment.v1.Deployment deployment_override = 4;
temporal.api.deployment.v1.Deployment deployment = 2;
// Manual override for execution's versioning behavior. Takes precedence over `behavior`
// and `deployment`.
VersioningBehaviorOverride manual_override = 3;
// When present, indicates the workflow is being redirected to a different deployment.
// A redirect can only exist during the lifetime of a pending workflow task.
// If the pending workflow task completes (at the next WorkflowTaskCompleted event), the
// redirect is considered complete and the workflow's deployment is updated. If the pending
// workflow task fails or times out, then the redirect is canceled and workflow remains on
// the previous deployment.
RedirectInfo redirect_info = 5;
RedirectInfo redirect_info = 4;

message RedirectInfo {
// The target deployment of the redirect. Null means a so-far-versioned workflow is
// being redirected to unversioned workers.
deployment.v1.Deployment deployment = 1;
temporal.api.deployment.v1.Deployment deployment = 1;
// If present, it means the redirect is initiated by a (safe) manual versioning
// override. Such override is only applied to the workflow when and if the redirect
// successfully completes.
Expand Down Expand Up @@ -193,7 +191,7 @@ message PendingActivityInfo {

// The deployment this activity was dispatched to most recently. Present only if the activity
// was dispatched to a versioned worker.
deployment.v1.Deployment last_started_deployment = 19;
temporal.api.deployment.v1.Deployment last_started_deployment = 19;
}

message PendingChildExecutionInfo {
Expand Down Expand Up @@ -368,16 +366,15 @@ message WorkflowExecutionOptions {
VersioningBehaviorOverride versioning_behavior_override = 1;
}

// Used in both UpdateWorkflowExecutionOptions and StartWorkflowExecution to override
// the versioning behavior of a specific workflow execution. If set, takes precedence
// over the sdk-sent Versioning Behavior for the specific Workflow Execution it is set on.
// To remove the override, call UpdateWorkflowExecutionOptions with a null VersioningBehaviorOverride,
// and use the FieldMask to indicate that it should be mutated.
// Used to manually override the versioning behavior of a specific workflow execution. If set, takes
// precedence over the SDK-sent Versioning Behavior.
// To remove the override, call `UpdateWorkflowExecutionOptions` with a null
// `VersioningBehaviorOverride`, and use the `update_mask` to indicate that it should be mutated.
message VersioningBehaviorOverride {
// Required.
enums.v1.VersioningBehavior behavior = 1;
temporal.api.enums.v1.VersioningBehavior behavior = 1;

// Required if behavior is `PINNED`. Must be null if behavior is `AUTO_UPGRADE`.
// Identifies the worker deployment to pin the workflow to.
deployment.v1.Deployment deployment = 2;
temporal.api.deployment.v1.Deployment deployment = 2;
}
16 changes: 8 additions & 8 deletions temporal/api/workflowservice/v1/request_response.proto
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ message RespondWorkflowTaskCompletedRequest {
reserved 14;
reserved "capabilities";
// Must be set when versioning-3 is used (i.e. `worker_version_stamp.use_versioning` is `true`
// and `worker_version_stamp.deployment_name` is provided).
// and `worker_version_stamp.deployment_series_name` is provided).
temporal.api.enums.v1.VersioningBehavior versioning_behavior = 15;
}

Expand Down Expand Up @@ -1753,8 +1753,8 @@ message ListDeploymentsRequest {
int32 page_size = 1;
bytes next_page_token = 2;
string namespace = 3;
// Optional. Use to filter based on deployment name.
string deployment_name = 4;
// Optional. Use to filter based on exact series name match.
string series_name = 4;
}

message ListDeploymentsResponse {
Expand All @@ -1773,20 +1773,20 @@ message SetCurrentDeploymentRequest {
deployment.v1.Deployment deployment = 2;
// Optional. The identity of the client who initiated this request.
string identity = 3;
// Optional. Use to add or remove memo entries. Memo can contain user-defined keys and values
// that are exposed when describing deployments. It is a good place for such as operator name,
// Optional. Use to add or remove user-defined metadata entries. Metadata entries are exposed
// when describing a deployment. It is a good place for information such as operator name,
// links to internal deployment pipelines, etc.
deployment.v1.UpdateDeploymentMemo update_memo = 4;
deployment.v1.UpdateDeploymentMetadata update_metadata = 4;
}

message SetCurrentDeploymentResponse {
deployment.v1.DeploymentInfo current_deployment = 1;
}

// Returns the Current Deployment of a deployment name.
// Returns the Current Deployment of a deployment series.
message GetCurrentDeploymentRequest {
string namespace = 1;
string deployment_name = 2;
string series_name = 2;
}

message GetCurrentDeploymentResponse {
Expand Down
25 changes: 13 additions & 12 deletions temporal/api/workflowservice/v1/service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -775,14 +775,15 @@ service WorkflowService {
// Describes a worker deployment.
rpc DescribeDeployment (DescribeDeploymentRequest) returns (DescribeDeploymentResponse) {
option (google.api.http) = {
get: "/namespaces/{namespace}/deployments/{deployment.deployment_name}/{deployment.build_id}"
get: "/namespaces/{namespace}/deployments/{deployment.series_name}/{deployment.build_id}"
additional_bindings {
get: "/api/v1/namespaces/{namespace}/deployments/{deployment.deployment_name}/{deployment.build_id}"
get: "/api/v1/namespaces/{namespace}/deployments/{deployment.series_name}/{deployment.build_id}"
}
};
}

// Lists worker deployments in the namespace. Optionally can filter based on deployment name.
// Lists worker deployments in the namespace. Optionally can filter based on deployment series
// name.
rpc ListDeployments (ListDeploymentsRequest) returns (ListDeploymentsResponse) {
option (google.api.http) = {
get: "/namespaces/{namespace}/deployments"
Expand All @@ -797,31 +798,31 @@ service WorkflowService {
// `status` and existing workflows that depend on the given deployment for their execution.
rpc GetDeploymentReachability (GetDeploymentReachabilityRequest) returns (GetDeploymentReachabilityResponse) {
option (google.api.http) = {
get: "/namespaces/{namespace}/deployments/{deployment.deployment_name}/{deployment.build_id}/reachability"
get: "/namespaces/{namespace}/deployments/{deployment.series_name}/{deployment.build_id}/reachability"
additional_bindings {
get: "/api/v1/namespaces/{namespace}/deployments/{deployment.deployment_name}/{deployment.build_id}/reachability"
get: "/api/v1/namespaces/{namespace}/deployments/{deployment.series_name}/{deployment.build_id}/reachability"
}
};
}

// Returns the current deployment (and its info) for a given deployment name.
// Returns the current deployment (and its info) for a given deployment series.
rpc GetCurrentDeployment (GetCurrentDeploymentRequest) returns (GetCurrentDeploymentResponse) {
option (google.api.http) = {
get: "/namespaces/{namespace}/current-deployment/{deployment_name}"
get: "/namespaces/{namespace}/current-deployment/{series_name}"
additional_bindings {
get: "/api/v1/namespaces/{namespace}/current-deployment/{deployment_name}"
get: "/api/v1/namespaces/{namespace}/current-deployment/{series_name}"
}
};
}

// Sets a deployment as the current deployment for its deployment name. Can optionally set the
// memo of the deployment as well.
// Sets a deployment as the current deployment for its deployment series. Can optionally update
// the metadata of the deployment as well.
rpc SetCurrentDeployment (SetCurrentDeploymentRequest) returns (SetCurrentDeploymentResponse) {
option (google.api.http) = {
post: "/namespaces/{namespace}/current-deployment/{deployment.deployment_name}"
post: "/namespaces/{namespace}/current-deployment/{deployment.series_name}"
body: "*"
additional_bindings {
post: "/api/v1/namespaces/{namespace}/current-deployment/{deployment.deployment_name}"
post: "/api/v1/namespaces/{namespace}/current-deployment/{deployment.series_name}"
body: "*"
}
};
Expand Down

0 comments on commit bf6ec80

Please sign in to comment.