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

[State Observability] Warn if callsite is disabled when ray list objects + raise exception on missing output #26880

Merged
merged 4 commits into from
Jul 25, 2022
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
36 changes: 32 additions & 4 deletions dashboard/state_aggregator.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,9 @@ async def list_actors(self, *, option: ListApiOptions) -> ListApiResponse:

result = []
for message in reply.actor_table_data:
data = self._message_to_dict(message=message, fields_to_decode=["actor_id"])
data = self._message_to_dict(
message=message, fields_to_decode=["actor_id", "owner_id"]
)
result.append(data)

result = self._filter(result, option.filters, ActorState, option.detail)
Expand Down Expand Up @@ -443,6 +445,7 @@ async def list_objects(self, *, option: ListApiOptions) -> ListApiResponse:

result = []
memory_table = memory_utils.construct_memory_table(worker_stats)
callsite_enabled = True
rkooo567 marked this conversation as resolved.
Show resolved Hide resolved
for entry in memory_table.table:
data = entry.as_dict()
# `construct_memory_table` returns object_ref field which is indeed
Expand All @@ -452,8 +455,23 @@ async def list_objects(self, *, option: ListApiOptions) -> ListApiResponse:
del data["object_ref"]
data["ip"] = data["node_ip_address"]
del data["node_ip_address"]

# If there's any "disabled" callsite, we consider the callsite collection
# is disabled.
if data["call_site"] == "disabled":
callsite_enabled = False
result.append(data)

# Add callsite warnings if it is not configured.
callsite_warning = []
if not callsite_enabled:
callsite_warning.append(
"Callsite is not being recorded. "
"To record callsite information for each ObjectRef created, set "
"env variable RAY_record_ref_creation_sites=1 during `ray start` "
"and and `ray.init`."
rkooo567 marked this conversation as resolved.
Show resolved Hide resolved
)

result = self._filter(result, option.filters, ObjectState, option.detail)
# Sort to make the output deterministic.
result.sort(key=lambda entry: entry["object_id"])
Expand All @@ -462,6 +480,7 @@ async def list_objects(self, *, option: ListApiOptions) -> ListApiResponse:
result=result,
partial_failure_warning=partial_failure_warning,
total=total_objects,
warnings=callsite_warning,
)

async def list_runtime_envs(self, *, option: ListApiOptions) -> ListApiResponse:
Expand Down Expand Up @@ -551,7 +570,10 @@ async def summarize_tasks(self, option: SummaryApiOptions) -> SummaryApiResponse
}
)
return SummaryApiResponse(
result=summary, partial_failure_warning=result.partial_failure_warning
total=result.total,
result=summary,
partial_failure_warning=result.partial_failure_warning,
warnings=result.warnings,
)

async def summarize_actors(self, option: SummaryApiOptions) -> SummaryApiResponse:
Expand All @@ -565,7 +587,10 @@ async def summarize_actors(self, option: SummaryApiOptions) -> SummaryApiRespons
}
)
return SummaryApiResponse(
result=summary, partial_failure_warning=result.partial_failure_warning
total=result.total,
result=summary,
partial_failure_warning=result.partial_failure_warning,
warnings=result.warnings,
)

async def summarize_objects(self, option: SummaryApiOptions) -> SummaryApiResponse:
Expand All @@ -579,7 +604,10 @@ async def summarize_objects(self, option: SummaryApiOptions) -> SummaryApiRespon
}
)
return SummaryApiResponse(
result=summary, partial_failure_warning=result.partial_failure_warning
total=result.total,
result=summary,
partial_failure_warning=result.partial_failure_warning,
warnings=result.warnings,
)

def _message_to_dict(
Expand Down
Loading