Revert "[Dashboard] Fix missing actor pid (#13229)"

This reverts commit 4853aa96cb.
This commit is contained in:
Amog Kamsetty
2021-01-13 18:03:15 -08:00
committed by GitHub
parent 602c103eae
commit 12e1175dd1
5 changed files with 34 additions and 13 deletions
+12 -5
View File
@@ -12,6 +12,7 @@ from ray.core.generated import gcs_service_pb2
from ray.core.generated import gcs_service_pb2_grpc
from ray.new_dashboard.datacenter import (
DataSource,
DataOrganizer,
GlobalSignals,
)
@@ -52,7 +53,7 @@ class JobHead(dashboard_utils.DashboardHeadModule):
if view is None:
job_detail = {
"jobInfo": DataSource.jobs.get(job_id, {}),
"jobActors": DataSource.job_actors.get(job_id, {}),
"jobActors": await DataOrganizer.get_job_actors(job_id),
"jobWorkers": DataSource.job_workers.get(job_id, []),
}
await GlobalSignals.job_info_fetched.send(job_detail)
@@ -103,10 +104,16 @@ class JobHead(dashboard_utils.DashboardHeadModule):
pubsub_message = ray.gcs_utils.PubSubMessage.FromString(data)
message = ray.gcs_utils.JobTableData.FromString(
pubsub_message.data)
job_table_data = job_table_data_to_dict(message)
job_id = job_table_data["jobId"]
# Update jobs.
DataSource.jobs[job_id] = job_table_data
job_id = ray._raylet.JobID(message.job_id)
if job_id.is_submitted_from_dashboard():
job_table_data = job_table_data_to_dict(message)
job_id = job_table_data["jobId"]
# Update jobs.
DataSource.jobs[job_id] = job_table_data
else:
logger.info(
"Ignore job %s which is not submitted from dashboard.",
job_id.hex())
except Exception:
logger.exception("Error receiving job info.")
+4 -4
View File
@@ -42,7 +42,7 @@ def test_get_job_info(disable_aiohttp_cache, ray_start_with_dashboard):
result = resp.json()
assert result["result"] is True, resp.text
job_summary = result["data"]["summary"]
assert len(job_summary) == 1, resp.text
assert len(job_summary) == 1
one_job = job_summary[0]
assert "jobId" in one_job
job_id = one_job["jobId"]
@@ -67,7 +67,7 @@ def test_get_job_info(disable_aiohttp_cache, ray_start_with_dashboard):
assert len(one_job_summary_keys - job_detail["jobInfo"].keys()) == 0
assert "jobActors" in job_detail
job_actors = job_detail["jobActors"]
assert len(job_actors) == 1, resp.text
assert len(job_actors) == 1
one_job_actor = job_actors[actor_id]
assert "taskSpec" in one_job_actor
assert type(one_job_actor["taskSpec"]) is dict
@@ -82,7 +82,7 @@ def test_get_job_info(disable_aiohttp_cache, ray_start_with_dashboard):
assert k in one_job_actor
assert "jobWorkers" in job_detail
job_workers = job_detail["jobWorkers"]
assert len(job_workers) == 1, resp.text
assert len(job_workers) == 1
one_job_worker = job_workers[0]
check_worker_keys = [
"cmdline", "pid", "cpuTimes", "memoryInfo", "cpuPercent",
@@ -91,7 +91,7 @@ def test_get_job_info(disable_aiohttp_cache, ray_start_with_dashboard):
for k in check_worker_keys:
assert k in one_job_worker
timeout_seconds = 10
timeout_seconds = 5
start_time = time.time()
last_ex = None
while True:
@@ -121,7 +121,7 @@ def test_actors(disable_aiohttp_cache, ray_start_with_dashboard):
assert "name" in one_entry
assert "numRestarts" in one_entry
assert "pid" in one_entry
all_pids = {entry["pid"] for entry in actors.values()}
all_pids = [entry["pid"] for entry in actors.values()]
assert 0 in all_pids # The infeasible actor
assert len(all_pids) > 1
break