dashboard/modules/log/log_head.py
def _list_logs_single_node(log_files: List[str], filters: List[str]):
        """
        Returns a JSON file mapping a category of log component to a list of filenames,
        on the given node.
        """
        filters = [] if filters == [""] else filters

        def contains_all_filters(log_file_name):
            return all(f in log_file_name for f in filters)

        filtered = list(filter(contains_all_filters, log_files))
        logs = {}
        logs["worker_errors"] = list(
            filter(lambda s: "worker" in s and s.endswith(".err"), filtered)
        )
        logs["worker_outs"] = list(
            filter(lambda s: "worker" in s and s.endswith(".out"), filtered)
        )
        for lang in ray_constants.LANGUAGE_WORKER_TYPES:
            logs[f"{lang}_core_worker_logs"] = list(
                filter(
                    lambda s: f"{lang}-core-worker" in s and s.endswith(".log"),
                    filtered,
                )
            )
            logs[f"{lang}_driver_logs"] = list(
                filter(
                    lambda s: f"{lang}-core-driver" in s and s.endswith(".log"),
                    filtered,
                )
            )
        logs["dashboard"] = list(filter(lambda s: "dashboard" in s, filtered))
        logs["raylet"] = list(filter(lambda s: "raylet" in s, filtered))
        logs["gcs_server"] = list(filter(lambda s: "gcs" in s, filtered))
        logs["ray_client"] = list(filter(lambda s: "ray_client" in s, filtered))
        logs["autoscaler"] = list(
            filter(lambda s: "monitor" in s and "log_monitor" not in s, filtered)
        )
        logs["runtime_env"] = list(filter(lambda s: "runtime_env" in s, filtered))
        logs["folders"] = list(filter(lambda s: "." not in s, filtered))
        logs["misc"] = list(
            filter(lambda s: all([s not in logs[k] for k in logs]), filtered)
        )
        return logs

        Returns a JSON file mapping a category of log component to a list of filenames,
        on the given node.
        
Returns a JSON file mapping a category of log component to a list of filenames,
on the given node.
Returns a JSON file mapping a category of log component to a list of filenames on the given node .
def _list_logs_single_node(log_files: List[str], filters: List[str]):
        filters = [] if filters == [""] else filters
        def contains_all_filters(log_file_name):
            return all(f in log_file_name for f in filters)
        filtered = list(filter(contains_all_filters, log_files))
        logs = {}
        logs["worker_errors"] = list(
            filter(lambda s: "worker" in s and s.endswith(".err"), filtered)
        )
        logs["worker_outs"] = list(
            filter(lambda s: "worker" in s and s.endswith(".out"), filtered)
        )
        for lang in ray_constants.LANGUAGE_WORKER_TYPES:
            logs[f"{lang}_core_worker_logs"] = list(
                filter(
                    lambda s: f"{lang}-core-worker" in s and s.endswith(".log"),
                    filtered,
                )
            )
            logs[f"{lang}_driver_logs"] = list(
                filter(
                    lambda s: f"{lang}-core-driver" in s and s.endswith(".log"),
                    filtered,
                )
            )
        logs["dashboard"] = list(filter(lambda s: "dashboard" in s, filtered))
        logs["raylet"] = list(filter(lambda s: "raylet" in s, filtered))
        logs["gcs_server"] = list(filter(lambda s: "gcs" in s, filtered))
        logs["ray_client"] = list(filter(lambda s: "ray_client" in s, filtered))
        logs["autoscaler"] = list(
            filter(lambda s: "monitor" in s and "log_monitor" not in s, filtered)
        )
        logs["runtime_env"] = list(filter(lambda s: "runtime_env" in s, filtered))
        logs["folders"] = list(filter(lambda s: "." not in s, filtered))
        logs["misc"] = list(
            filter(lambda s: all([s not in logs[k] for k in logs]), filtered)
        )
        return logs
def _list_logs_single_node ( log_files : List [ str ] , filters : List [ str ] ) : filters = [ ] if filters == [ "" ] else filters def contains_all_filters ( log_file_name ) : return all ( f in log_file_name for f in filters ) filtered = list ( filter ( contains_all_filters , log_files ) ) logs = { } logs [ "worker_errors" ] = list ( filter ( lambda s : "worker" in s and s . endswith ( ".err" ) , filtered ) ) logs [ "worker_outs" ] = list ( filter ( lambda s : "worker" in s and s . endswith ( ".out" ) , filtered ) ) for lang in ray_constants . LANGUAGE_WORKER_TYPES : logs [ f"{lang}_core_worker_logs" ] = list ( filter ( lambda s : f"{lang}-core-worker" in s and s . endswith ( ".log" ) , filtered , ) ) logs [ f"{lang}_driver_logs" ] = list ( filter ( lambda s : f"{lang}-core-driver" in s and s . endswith ( ".log" ) , filtered , ) ) logs [ "dashboard" ] = list ( filter ( lambda s : "dashboard" in s , filtered ) ) logs [ "raylet" ] = list ( filter ( lambda s : "raylet" in s , filtered ) ) logs [ "gcs_server" ] = list ( filter ( lambda s : "gcs" in s , filtered ) ) logs [ "ray_client" ] = list ( filter ( lambda s : "ray_client" in s , filtered ) ) logs [ "autoscaler" ] = list ( filter ( lambda s : "monitor" in s and "log_monitor" not in s , filtered ) ) logs [ "runtime_env" ] = list ( filter ( lambda s : "runtime_env" in s , filtered ) ) logs [ "folders" ] = list ( filter ( lambda s : "." not in s , filtered ) ) logs [ "misc" ] = list ( filter ( lambda s : all ( [ s not in logs [ k ] for k in logs ] ) , filtered ) ) return logs
Returns a JSON file mapping a category of log component to a list of filenames,
on the given node.
Returns a JSON file mapping a category of log component to a list of filenames on the given node .
"""
        Returns a JSON file mapping a category of log component to a list of filenames,
        on the given node.
        """
log_files
List[str]
filters
List[str]