1- # Temporal Cloud Run worker-identity sample
1+ # Temporal Cloud Run Id sample
22
3- A continuously polling Temporal Java worker for a Google Cloud Run ** worker pool** that registers
4- ` CloudRunIdPlugin ` from ` io.temporal:temporal-gcp-cloud-run-id ` on the client, so the worker identity
5- is derived from Cloud Run instance metadata as ` {instanceId}@{revision} ` . The plugin sets identity
6- only. A small greeting workflow and activity run until Cloud Run stops the instance.
3+ A Temporal Java Worker for a Google Cloud Run ** worker pool** that registers
4+ ` CloudRunIdPlugin ` from ` io.temporal:temporal-gcp-cloud-run-id ` on the client, so the Temporal
5+ client identity is set from Cloud Run instance metadata as ` {instanceId}@{revision} ` . The plugin
6+ sets identity only. A small greeting workflow and activity run until Cloud Run stops the instance.
77
88> Google Cloud Run support is experimental and may change without notice.
99
@@ -23,38 +23,38 @@ created from the client inherit it. `GoogleCloudRunMetadata.fetch().identity()`
2323value, which the worker logs at startup.
2424
2525The worker reads ` TEMPORAL_ADDRESS ` (default ` 127.0.0.1:7233 ` ), ` TEMPORAL_NAMESPACE ` (default
26- ` default ` ), and ` TEMPORAL_TASK_QUEUE ` (default ` cloud-run-worker- id ` ). A plaintext connection is used;
26+ ` default ` ), and ` TEMPORAL_TASK_QUEUE ` (default ` cloud-run-id ` ). A plaintext connection is used;
2727configure TLS or an API key in ` CloudRunWorker.java ` for a secured Service such as Temporal Cloud.
2828
2929## Build and test
3030
3131``` bash
32- ./gradlew :gcp:cloud-run:workerid :test
33- ./gradlew -PtemporalSdkPath=/path/to/sdk-java :gcp:cloud-run:workerid :installDist
32+ ./gradlew :gcp:cloud-run:id :test
33+ ./gradlew -PtemporalSdkPath=/path/to/sdk-java :gcp:cloud-run:id :installDist
3434```
3535
3636## Deploy
3737
38- Worker pools keep CPU allocated for continuous polling . Until ` temporal-gcp-cloud-run-id ` is released
39- a remote ` --source ` build cannot resolve it, so build the image locally against your SDK checkout and
38+ Worker pools keep CPU allocated between requests . Until ` temporal-gcp-cloud-run-id ` is released a
39+ remote ` --source ` build cannot resolve it, so build the image locally against your SDK checkout and
4040deploy it by tag:
4141
4242``` bash
4343export REGION=us-central1
44- gcloud run worker-pools deploy cloud-run-worker- id \
45- --image " $REGION -docker.pkg.dev/$PROJECT_ID /<repo>/cloud-run-worker- id:latest" \
44+ gcloud run worker-pools deploy cloud-run-id \
45+ --image " $REGION -docker.pkg.dev/$PROJECT_ID /<repo>/cloud-run-id:latest" \
4646 --region " $REGION " \
47- --set-env-vars " TEMPORAL_ADDRESS=<addr>,TEMPORAL_NAMESPACE=<ns>,TEMPORAL_TASK_QUEUE=cloud-run-worker- id"
47+ --set-env-vars " TEMPORAL_ADDRESS=<addr>,TEMPORAL_NAMESPACE=<ns>,TEMPORAL_TASK_QUEUE=cloud-run-id"
4848```
4949
5050Each revision starts a fresh instance whose worker reports a distinct identity.
5151
5252## Start a workflow
5353
5454``` bash
55- temporal workflow start --type GreetingWorkflow --task-queue cloud-run-worker- id \
55+ temporal workflow start --type GreetingWorkflow --task-queue cloud-run-id \
5656 --workflow-id cloud-run-greeting --input ' "Cloud Run"'
5757```
5858
5959The identity appears on the task-queue pollers (` temporal task-queue describe ` ) and recorded events.
60- Delete the pool with ` gcloud run worker-pools delete cloud-run-worker- id --region "$REGION" ` .
60+ Delete the pool with ` gcloud run worker-pools delete cloud-run-id --region "$REGION" ` .
0 commit comments