Exemple #1
0
    async def get_actor_creation_tasks(cls):
        infeasible_tasks = sum(
            (list(node_stats.get("infeasibleTasks", []))
             for node_stats in DataSource.node_stats.values()), [])
        new_infeasible_tasks = []
        for task in infeasible_tasks:
            task = dict(task)
            task["actorClass"] = actor_classname_from_task_spec(task)
            task["state"] = "INFEASIBLE"
            new_infeasible_tasks.append(task)

        resource_pending_tasks = sum(
            (list(data.get("readyTasks", []))
             for data in DataSource.node_stats.values()), [])
        new_resource_pending_tasks = []
        for task in resource_pending_tasks:
            task = dict(task)
            task["actorClass"] = actor_classname_from_task_spec(task)
            task["state"] = "PENDING_RESOURCES"
            new_resource_pending_tasks.append(task)

        results = {
            task["actorCreationTaskSpec"]["actorId"]: task
            for task in new_resource_pending_tasks + new_infeasible_tasks
        }
        return results
Exemple #2
0
def actor_table_data_to_dict(message):
    orig_message = dashboard_utils.message_to_dict(
        message,
        {
            "actorId",
            "parentId",
            "jobId",
            "workerId",
            "rayletId",
            "actorCreationDummyObjectId",
            "callerId",
            "taskId",
            "parentTaskId",
            "sourceActorId",
            "placementGroupId",
        },
        including_default_value_fields=True,
    )
    # The complete schema for actor table is here:
    #     src/ray/protobuf/gcs.proto
    # It is super big and for dashboard, we don't need that much information.
    # Only preserve the necessary ones here for memory usage.
    fields = {
        "actorId",
        "jobId",
        "pid",
        "address",
        "state",
        "name",
        "numRestarts",
        "taskSpec",
        "timestamp",
        "numExecutedTasks",
    }
    light_message = {k: v for (k, v) in orig_message.items() if k in fields}
    if "taskSpec" in light_message:
        actor_class = actor_classname_from_task_spec(light_message["taskSpec"])
        light_message["actorClass"] = actor_class
        if "functionDescriptor" in light_message["taskSpec"]:
            light_message["taskSpec"] = {
                "functionDescriptor":
                light_message["taskSpec"]["functionDescriptor"]
            }
        else:
            light_message.pop("taskSpec")
    return light_message
Exemple #3
0
 def _process_actor_table_data(data):
     actor_class = actor_classname_from_task_spec(
         data.get("taskSpec", {}))
     data["actorClass"] = actor_class