Add GCP min/max scaling options for worker deployment version - #1135
Add GCP min/max scaling options for worker deployment version#1135zainawaisn wants to merge 5 commits into
Conversation
|
|
|
Are more coming? or did we agree on just these? Previous discussion was https://temporaltechnologies.slack.com/archives/C05L7RUSK6E/p1784055551940739 I updated https://temporalio.atlassian.net/browse/COM-222 with that data once I found it. |
|
scratch that, |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d2fe58cf3d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if err != nil { | ||
| return err | ||
| } | ||
| scalerDetails, err := gcpCloudRunScalerDetails(providerType, c.gcpScalerFlags()) |
There was a problem hiding this comment.
Reject scaler flags alongside --remove
When update-version-compute-config is invoked with --remove plus any of the four new scaler flags, execution takes the remove branch, whose conflict check only covers the pre-existing provider flags, so this validation is never reached and the supplied scaler values are silently ignored while the config is removed. Include c.gcpScalerFlags().anySet() in the --remove conflict check so contradictory input is rejected consistently.
Useful? React with 👍 / 👎.
| --gcp-cloud-run-utilization-target must all be set together. Defaults | ||
| to 0 when unset. Only valid with --gcp-cloud-run-worker-pool. |
There was a problem hiding this comment.
Correct update help for omitted scaler flags
For update-version-compute-config, this claims an omitted flag defaults to the documented WCI value, but the implementation deliberately excludes scaler.details from the update mask when the scaler flags are omitted, preserving any existing custom bounds and utilization instead. A user updating the Cloud Run provider without these flags can therefore retain materially different scaling settings than the help promises; describe them as unchanged on update and reserve the stated defaults for creation or configurations without existing details.
Useful? React with 👍 / 👎.
chaptersix
left a comment
There was a problem hiding this comment.
🤖 Two brief follow-ups.
| // Only touch scaler.details when the user supplied instance bounds; | ||
| // otherwise leave any existing scaler config untouched rather than | ||
| // clearing it. | ||
| if scalerDetails != nil { |
There was a problem hiding this comment.
🤖 Switching GCP → AWS changes the scaler type but leaves the GCP scaler details in place, which WCI rejects under no-sync. Please clear or replace scaler.details when the scaler type changes.
| if err != nil { | ||
| return err | ||
| } | ||
| scalerDetails, err := gcpCloudRunScalerDetails(providerType, c.gcpScalerFlags()) |
There was a problem hiding this comment.
🤖 Should scaler-only updates work? Supplying all four scaler flags without repeating the provider fields returns missing configuration for compute provider, even though scaler.details can be updated independently. If full provider config is required, please document that.
…ute-config/clear scalar settings in no-sync algorithm
Related issues
What changed?
Adds four new (optional) flags
gcp-cloud-run-min-instances,gcp-cloud-run-max-instances,gcp-cloud-run-initial-instances, andgcp-cloud-run-utilization-targettocreate-versionandupdate-version-compute-config.Changes
commands.yaml / commands.gen.go: four new flags
(--gcp-cloud-run-min-instances, --gcp-cloud-run-max-instances,
--gcp-cloud-run-initial-instances, --gcp-cloud-run-utilization-target) on
create-version and update-version-compute-config, plus help text and usage
examples.
commands.worker.deployment.go: a new gcpCloudRunScalerDetails helper turns
the flags into the scaling settings sent to the server, and rejects bad input
early. All four settings are GCP-only and form a single all-or-none group —
setting any one requires all four — with min <= initial <= max and
utilization-target a fraction in (0, 1]. Both commands use it, and
describe-version now shows the settings back in its JSON and summary output.
tests: unit tests cover the helper's accept/reject cases and the
describe-version display; command-level error cases were added to
TestCreateWorkerDeploymentVersion_Errors. The end-to-end GCP test stays
skipped (needs real GCP resources).
Checklist
Stability
-o json/-o jsonl) are treated as breaking changesDesign
temporal <noun> <verb>structure (e.g.temporal workflow start)--search-attribute, bad:--index-field)(Experimental)incommands.yamlHelp text (see style guide at the top of
commands.yaml)--namespace, not-n), one flag per lineYourXxxform (YourWorkflowId,YourNamespace)Behavior
Tests
SharedServerSuite)func TestXxx) where applicableManual tests
Creation:
Update existing:
Error checks: