Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: [google-cloud-run]support manual instance count in Cloud Run for manual scaling feature #13286

Merged
merged 3 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "0.10.12" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "0.10.12" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,9 @@ class ServiceScaling(proto.Message):
r"""Scaling settings applied at the service level rather than
at the revision level.


.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields

Attributes:
min_instance_count (int):
Optional. total min instances for the
Expand All @@ -287,6 +290,14 @@ class ServiceScaling(proto.Message):
on the percent of traffic they are receiving.
scaling_mode (google.cloud.run_v2.types.ServiceScaling.ScalingMode):
Optional. The scaling mode for the service.
manual_instance_count (int):
Optional. total instance count for the
service in manual scaling mode. This number of
instances is divided among all revisions with
specified traffic based on the percent of
traffic they are receiving.

This field is a member of `oneof`_ ``_manual_instance_count``.
"""

class ScalingMode(proto.Enum):
Expand Down Expand Up @@ -316,6 +327,11 @@ class ScalingMode(proto.Enum):
number=3,
enum=ScalingMode,
)
manual_instance_count: int = proto.Field(
proto.INT32,
number=6,
optional=True,
)


class NodeSelector(proto.Message):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-cloud-run",
"version": "0.10.12"
"version": "0.1.0"
},
"snippets": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5865,7 +5865,11 @@ def test_create_service_rest_call_success(request_type):
"tag": "tag_value",
}
],
"scaling": {"min_instance_count": 1920, "scaling_mode": 1},
"scaling": {
"min_instance_count": 1920,
"scaling_mode": 1,
"manual_instance_count": 2234,
},
"invoker_iam_disabled": True,
"default_uri_disabled": True,
"urls": ["urls_value1", "urls_value2"],
Expand Down Expand Up @@ -6486,7 +6490,11 @@ def test_update_service_rest_call_success(request_type):
"tag": "tag_value",
}
],
"scaling": {"min_instance_count": 1920, "scaling_mode": 1},
"scaling": {
"min_instance_count": 1920,
"scaling_mode": 1,
"manual_instance_count": 2234,
},
"invoker_iam_disabled": True,
"default_uri_disabled": True,
"urls": ["urls_value1", "urls_value2"],
Expand Down
Loading