Skip to content

Merge serverless into master#752

Merged
ShahabT merged 20 commits intomasterfrom
serverless
Apr 3, 2026
Merged

Merge serverless into master#752
ShahabT merged 20 commits intomasterfrom
serverless

Conversation

@ShahabT
Copy link
Copy Markdown
Contributor

@ShahabT ShahabT commented Apr 1, 2026

This PR merges the serverless branch into master.

Server PR to be sent shortly.

jaypipes and others added 16 commits March 18, 2026 08:50
feature: introduce compute config

Introduces a new `compute.v1` package of proto messages that house the
various instructions and information needed by worker control plane
controllers

`temporal.api.compute.v1.ComputeConfig` has three fields, `task_queues`,
`provider` and `scaler` that store the configuration information for the
server-owned worker setup and how the worker control plane should treat
worker lifecycle events (such as when no pollers exist for a task queue
that has received a task).

The `temporal.api.compute.v1.ComputeConfig.task_queues` field is a list
of task queue name and task type tuples. When Temporal Server receives a
task with any of these name+type combinations and finds no active
pollers, it will trigger a launch of a server-owned Worker using the
configuration information in the `provider` field.

The `temporal.api.compute.v1.ComputeConfig.provider` field is of type
`temporal.api.compute.v1.ComputeProvider`. This message is a simple
wrapper around a blob of bytes that contains configuration settings for
a worker control plane controller.

The configuration settings for the worker control plane controller are
specific to different compute providers. The first compute provider we
are modeling is AWS Lambda, and the `ProviderDetailAWSLambda` message
houses the ARN of the AWS Lambda Function to be invoked and an optional
ARN of the IAM Role that should be assumed by a worker control plane
controller when invoking the function.

The `temporal.api.compute.v1.ComputeConfig.scaler` field is  of type
`temporal.api.compute.v1.ComputeScaler`. This message contains
instructions for when the worker lifecycle controller should scale up or
down the number of workers in a WorkerDeployment or
WorkerDeploymentVersion.

Adds a new field `compute_config` to `WorkerDeploymentInfo` and
`WorkerDeploymentVersionInfo` that contains a
`temporal.api.compute.v1.ComputeConfig` message.

Both WorkerDeployment and WorkerDeploymentVersion have this field
in order to handle versioned workers properly. For example, if the user
wants to use PINNED temporal versioning, they will be creating a
WorkerDeploymentVersion that is specific to, say, a qualified Lambda
Function ARN. Therefore we need to place compute provider configuration
on a WorkerDeploymentVersion in addition to WorkerDeployment.

Adds three new gRPC API methods to WorkflowService:

* `CreateWorkerDeployment` creates a new WorkerDeployment containing the
  supplied compute configuration.
* `UpdateWorkerDeploymentComputeConfig` updates an existing
  WorkerDeployment's compute configuration.
* `UpdateWorkerDeploymentComputeConfig` updates an existing
  WorkerDeploymentVersion's compute configuration.

Signed-off-by: Jay Pipes <jay.pipes@temporal.io>

Signed-off-by: Jay Pipes <jay.pipes@temporal.io>
* origin/master:
  Add Principal to the base HistoryEvent (#733)
…nfig and enable per-task-type compute providers (#731)

**What changed?**
* Enables validating, creating and updating compute providers at the
worker deployment version level, as that is where it at the most basic
belongs
* Making the scaler config more flexible to allow for pluggable scalers
* Allowing for different compute providers depending on task types and
regions
@ShahabT ShahabT requested review from a team April 1, 2026 23:13

gh workflow run update-proto.yml -R https://github.com/temporalio/api-go \
-r master \
-r "${BRANCH}" \
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This causes the api-go's update-proto.yml be loaded from the branch on which we trigger the update, not from master all the time.

Makefile Outdated

PROTO_ROOT := .
PROTO_FILES = $(shell find temporal -name "*.proto")
PROTO_FILES = $(shell find temporal -name "*.proto" -not -name "*.swp")
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jaypipes what this change do? should we merge it to master?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ShahabT heh, this was for those of us who use Vi(m)... when Vim has a file open, it creates a .swp file, and the make generate Make target was picking up those temporary files.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I highly recommend using set dir^=~/.local/tmp// in vimrc to keep swap files outside of source dirs. We shouldn't have to clutter our code to exclude editor temp files for all different editors.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I highly recommend using set dir^=~/.local/tmp// in vimrc to keep swap files outside of source dirs. We shouldn't have to clutter our code to exclude editor temp files for all different editors.

ack. even though there's already VSCode and Emacs stuff in .gitignore.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ShahabT heh, this was for those of us who use Vi(m)... when Vim has a file open, it creates a .swp file, and the make generate Make target was picking up those temporary files.

as mentioned to @ShahabT earlier today in slack, feel free to remove this change.

@semgrep-managed-scans
Copy link
Copy Markdown

Semgrep found 1 missing-explicit-permissions finding:

  • .github/workflows/trigger-api-go-update.yml

No explicit GITHUB_TOKEN permissions found at the workflow or job level. Add a permissions: block at the workflow root (applies to all jobs) or per job with least privilege (e.g., contents: read and only specific writes like pull-requests: write if needed).

@ShahabT ShahabT enabled auto-merge (squash) April 3, 2026 00:05
string name = 1;
}

// Uniquely identifies a combination of task queue name and type.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this reverted?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we didn't endup using it.

Copy link
Copy Markdown
Member

@Sushisource Sushisource left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing blocking but some comment fixes that should definitely be applied &/or added

// converter to ensure the server can understand it.
// For remote-implemented scalers, you might use your own content
// converters according to what the remote endpoints understand.
temporal.api.common.v1.Payload details = 2;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO It would make sense for this field to be a oneof with our built-in providers as well-defined messages.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me but this is how we built it for now. I guess we could make it a oneof after private-preview if we want. cc @02strich @jaypipes

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Sushisource that's what my original proposal had but I was asked to make it a Payload.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ref: 2319887

Comment on lines +1271 to +1274
// True if the server supports server-scaled deployments.
// This flag is dependent both on server version and for server-scaled deployments
// to be enabled via server configuration.
bool server_scaled_deployments = 12;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Who's this meant to be read by? If it's useful for SDK, this should go in namespace capabilities since that's what we call on startup. At least for what I've done so far, I don't need this, so maybe that's fine, but the principle applies to clients generally.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is added for UI.

map<string, temporal.api.compute.v1.ComputeConfigScalingGroupUpdate> compute_config_scaling_groups = 6;

// Optional. Contains the compute config scaling groups to remove from the Worker Deployment.
repeated string remove_compute_config_scaling_groups = 7;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What're the semantics if the same string is used in both add and remove?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@02strich to clarify the behavior. (I guess delete will take effect)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes delete wins

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Plz add to docstrings

@ShahabT ShahabT merged commit 52ec420 into master Apr 3, 2026
3 checks passed
@ShahabT ShahabT deleted the serverless branch April 3, 2026 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants