Skip to content

Commit 99450e5

Browse files
seanbollinclaude
andcommitted
Update Cloud Run worker-ID import to worker_id sub-package
The plugin moved from temporalio.contrib.gcp.cloud_run into the temporalio.contrib.gcp.cloud_run.worker_id sub-package (to avoid a collision with the OTel Cloud Run plugin). Update the sample's import, docstring, README doc link, and pyproject comment to the new path: from temporalio.contrib.gcp.cloud_run.worker_id import WorkerIDPlugin The public name WorkerIDPlugin is unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 20e4585 commit 99450e5

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

gcp_cloud_run_worker_id/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This sample runs a long-lived Temporal Worker in a [Google Cloud Run worker
44
pool](https://cloud.google.com/run/docs/worker-pools) and uses the
5-
[`temporalio.contrib.gcp.cloud_run`](https://python.temporal.io/temporalio.contrib.gcp.cloud_run.html)
5+
[`temporalio.contrib.gcp.cloud_run.worker_id`](https://python.temporal.io/temporalio.contrib.gcp.cloud_run.worker_id.html)
66
`WorkerIDPlugin` to derive the worker's identity and its Worker Deployment
77
version from Cloud Run instance metadata.
88

gcp_cloud_run_worker_id/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ dev = [
1818
package = false
1919

2020
# TEMPORARY: the Google Cloud Run plugin
21-
# (temporalio.contrib.gcp.cloud_run.WorkerIDPlugin) is not
21+
# (temporalio.contrib.gcp.cloud_run.worker_id.WorkerIDPlugin) is not
2222
# released yet, so this pins `temporalio` to the local SDK checkout on the
2323
# `cloud-run-worker-id` branch so the sample can be run and type-checked
2424
# locally. Remove this [tool.uv.sources] override and rely on the released

gcp_cloud_run_worker_id/worker.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Run a long-lived Temporal worker on a Google Cloud Run worker pool.
22
3-
The worker registers ``temporalio.contrib.gcp.cloud_run.WorkerIDPlugin`` on the
3+
The worker registers ``temporalio.contrib.gcp.cloud_run.worker_id.WorkerIDPlugin`` on the
44
client. The plugin reads Cloud Run instance metadata and automatically sets the
55
client identity and a PINNED Worker Deployment version, then propagates to the
66
worker. The worker runs until Cloud Run sends SIGTERM (for example, on
@@ -15,7 +15,7 @@
1515
from activities import compose_greeting
1616
from settings import load_settings
1717
from temporalio.client import Client
18-
from temporalio.contrib.gcp.cloud_run import WorkerIDPlugin
18+
from temporalio.contrib.gcp.cloud_run.worker_id import WorkerIDPlugin
1919
from temporalio.worker import Worker
2020
from workflows import GreetingWorkflow
2121

0 commit comments

Comments
 (0)