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

[serve] Add telemetry for lightweight config updates #34039

Merged
merged 3 commits into from
Apr 4, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
address comments - rename tagkeys
Signed-off-by: Cindy Zhang <[email protected]>
  • Loading branch information
zcin committed Apr 4, 2023
commit 83ba54deb268f516e11f29e39dc77990c3889d12
12 changes: 9 additions & 3 deletions python/ray/serve/_private/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,9 +511,15 @@ def dict_keys_snake_to_camel_case(snake_dict: dict) -> dict:
"SERVE_GRPC_INGRESS_USED": TagKey.SERVE_GRPC_INGRESS_USED,
"SERVE_REST_API_VERSION": TagKey.SERVE_REST_API_VERSION,
"SERVE_NUM_APPS": TagKey.SERVE_NUM_APPS,
"SERVE_NUM_REPLICAS_UPDATED": TagKey.SERVE_NUM_REPLICAS_UPDATED,
"SERVE_USER_CONFIG_UPDATED": TagKey.SERVE_USER_CONFIG_UPDATED,
"SERVE_AUTOSCALING_CONFIG_UPDATED": TagKey.SERVE_AUTOSCALING_CONFIG_UPDATED,
"SERVE_NUM_REPLICAS_LIGHTWEIGHT_UPDATED": (
TagKey.SERVE_NUM_REPLICAS_LIGHTWEIGHT_UPDATED
),
"SERVE_USER_CONFIG_LIGHTWEIGHT_UPDATED": (
TagKey.SERVE_USER_CONFIG_LIGHTWEIGHT_UPDATED
),
"SERVE_AUTOSCALING_CONFIG_LIGHTWEIGHT_UPDATED": (
TagKey.SERVE_AUTOSCALING_CONFIG_LIGHTWEIGHT_UPDATED
),
}


Expand Down
6 changes: 3 additions & 3 deletions python/ray/serve/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -868,9 +868,9 @@ def _generate_deployment_config_versions(
}

lightweight_update_options = {
"num_replicas": TagKey.SERVE_NUM_REPLICAS_UPDATED,
"user_config": TagKey.SERVE_USER_CONFIG_UPDATED,
"autoscaling_config": TagKey.SERVE_AUTOSCALING_CONFIG_UPDATED,
"num_replicas": TagKey.SERVE_NUM_REPLICAS_LIGHTWEIGHT_UPDATED,
"user_config": TagKey.SERVE_USER_CONFIG_LIGHTWEIGHT_UPDATED,
"autoscaling_config": TagKey.SERVE_AUTOSCALING_CONFIG_LIGHTWEIGHT_UPDATED,
}

def exclude_lightweight_update_options(dict):
Expand Down
10 changes: 5 additions & 5 deletions python/ray/serve/tests/test_telemetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,9 +409,9 @@ def test_lightweight_config_options(manage_ray, lightweight_option, value):
"""

lightweight_tagkeys = [
"serve_num_replicas_updated",
"serve_user_config_updated",
"serve_autoscaling_config_updated",
"serve_num_replicas_lightweight_updated",
"serve_user_config_lightweight_updated",
"serve_autoscaling_config_lightweight_updated",
]

subprocess.check_output(["ray", "start", "--head"])
Expand Down Expand Up @@ -474,7 +474,7 @@ def test_lightweight_config_options(manage_ray, lightweight_option, value):
# Check again
wait_for_condition(
lambda: ray.get(storage.get_report.remote())["extra_usage_tags"][
f"serve_{lightweight_option}_updated"
f"serve_{lightweight_option}_lightweight_updated"
]
== "True",
timeout=5,
Expand All @@ -483,7 +483,7 @@ def test_lightweight_config_options(manage_ray, lightweight_option, value):
assert int(report["extra_usage_tags"]["serve_num_apps"]) == 2
assert report["extra_usage_tags"]["serve_api_version"] == "v2"
for tagkey in lightweight_tagkeys:
if not tagkey == f"serve_{lightweight_option}_updated":
if not tagkey == f"serve_{lightweight_option}_lightweight_updated":
assert tagkey not in report["extra_usage_tags"]


Expand Down
6 changes: 3 additions & 3 deletions src/ray/protobuf/usage.proto
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ enum TagKey {
// The number of serve apps running in the cluster as a string.
SERVE_NUM_APPS = 14;
// Whether num_replicas changed as a lightweight config update
SERVE_NUM_REPLICAS_UPDATED = 15;
SERVE_NUM_REPLICAS_LIGHTWEIGHT_UPDATED = 15;
// Whether user_config changed as a lightweight config update
SERVE_USER_CONFIG_UPDATED = 16;
SERVE_USER_CONFIG_LIGHTWEIGHT_UPDATED = 16;
// Whether autoscaling_config changed as a lightweight config update
SERVE_AUTOSCALING_CONFIG_UPDATED = 17;
SERVE_AUTOSCALING_CONFIG_LIGHTWEIGHT_UPDATED = 17;

// Ray Core State API
// NOTE(rickyxx): Currently only setting "1" for tracking existence of
Expand Down