Skip to content

Commit

Permalink
Merge branch 'master' into status-message
Browse files Browse the repository at this point in the history
Signed-off-by: Cindy Zhang <cindyzyx9@gmail.com>
  • Loading branch information
zcin committed Apr 26, 2023
2 parents 7ed8d5a + bc1c378 commit ad02f88
Show file tree
Hide file tree
Showing 277 changed files with 4,640 additions and 3,400 deletions.
4 changes: 2 additions & 2 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -200,5 +200,5 @@ try-import %workspace%/.llvm-local.bazelrc
# It picks up the system headers when someone has protobuf installed via Homebrew.
# Work around for https://github.com/bazelbuild/bazel/issues/8053
build:macos --sandbox_block_path=/usr/local/
#This option controls whether javac checks for missing direct dependencies.
build --strict_java_deps=off
# This option controls whether javac checks for missing direct dependencies.
build --experimental_strict_java_deps=off
25 changes: 0 additions & 25 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -479,29 +479,6 @@ cc_library(
],
)

# This header is used to warp some internal code so we can reduce suspicious
# symbols export.
cc_library(
name = "exported_internal",
srcs = glob(
[
"src/ray/internal/internal.cc",
],
),
hdrs = glob(
[
"src/ray/internal/internal.h",
],
),
copts = COPTS,
strip_include_prefix = "src",
visibility = ["//visibility:public"],
deps = [
":core_worker_lib",
],
alwayslink = 1,
)

cc_binary(
name = "raylet",
srcs = ["src/ray/raylet/main.cc"],
Expand Down Expand Up @@ -2813,7 +2790,6 @@ pyx_library(
),
deps = [
"//:core_worker_lib",
"//:exported_internal",
"//:global_state_accessor_lib",
"//:ray_util",
"//:raylet_lib",
Expand Down Expand Up @@ -2848,7 +2824,6 @@ cc_binary(
visibility = ["//java:__subpackages__"],
deps = [
"//:core_worker_lib",
"//:exported_internal",
"//:global_state_accessor_lib",
"//:src/ray/ray_exported_symbols.lds",
"//:src/ray/ray_version_script.lds",
Expand Down
9 changes: 7 additions & 2 deletions ci/lint/check-bazel-team-owner.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,13 @@ def perform_check(raw_xml_string: str):
missing_owners = []
for rule in tree.findall("rule"):
test_name = rule.attrib["name"]
tags = [child.attrib["value"] for child in rule.find("list").getchildren()]
team_owner = [t for t in tags if t.startswith("team")]
tags = []
for lst in rule.findall("list"):
if lst.attrib["name"] != "tags":
continue
tags = [child.attrib["value"] for child in lst.getchildren()]
break
team_owner = [t for t in tags if t.startswith("team:")]
if len(team_owner) == 0:
missing_owners.append(test_name)
owners[test_name] = team_owner
Expand Down
13 changes: 8 additions & 5 deletions cpp/src/ray/runtime/task/native_task_submitter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,14 @@ ObjectID NativeTaskSubmitter::Submit(InvocationSpec &invocation,
options.name = call_options.name;
options.resources = call_options.resources;
options.serialized_runtime_env_info = call_options.serialized_runtime_env_info;
std::optional<std::vector<rpc::ObjectReference>> return_refs;
std::vector<rpc::ObjectReference> return_refs;
if (invocation.task_type == TaskType::ACTOR_TASK) {
return_refs = core_worker.SubmitActorTask(
invocation.actor_id, BuildRayFunction(invocation), invocation.args, options);
if (!return_refs.has_value()) {
auto status = core_worker.SubmitActorTask(invocation.actor_id,
BuildRayFunction(invocation),
invocation.args,
options,
return_refs);
if (!status.ok()) {
return ObjectID::Nil();
}
} else {
Expand All @@ -95,7 +98,7 @@ ObjectID NativeTaskSubmitter::Submit(InvocationSpec &invocation,
"");
}
std::vector<ObjectID> return_ids;
for (const auto &ref : return_refs.value()) {
for (const auto &ref : return_refs) {
return_ids.push_back(ObjectID::FromBinary(ref.object_id()));
}
return return_ids[0];
Expand Down
140 changes: 140 additions & 0 deletions dashboard/client/src/common/JobStatus.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
import { Box, createStyles, makeStyles } from "@material-ui/core";
import classNames from "classnames";
import React from "react";
import {
RiCheckboxCircleFill,
RiCloseCircleFill,
RiLoader4Line,
} from "react-icons/ri";
import { StatusChip } from "../components/StatusChip";
import { UnifiedJob } from "../type/job";
import { ClassNameProps } from "./props";

const useJobRunningIconStyles = makeStyles((theme) =>
createStyles({
icon: {
width: 20,
height: 20,
},
iconSmall: {
width: 16,
height: 16,
},
"@keyframes spinner": {
from: {
transform: "rotate(0deg)",
},
to: {
transform: "rotate(360deg)",
},
},
iconRunning: {
color: "#1E88E5",
animationName: "$spinner",
animationDuration: "1000ms",
animationIterationCount: "infinite",
animationTimingFunction: "linear",
},
}),
);

type JobRunningIconProps = { small?: boolean } & ClassNameProps;

export const JobRunningIcon = ({
className,
small = false,
}: JobRunningIconProps) => {
const classes = useJobRunningIconStyles();
return (
<RiLoader4Line
className={classNames(
classes.icon,
classes.iconRunning,
{
[classes.iconSmall]: small,
},
className,
)}
/>
);
};

const useJobStatusIconStyles = makeStyles((theme) =>
createStyles({
icon: {
width: 20,
height: 20,
},
iconSmall: {
width: 16,
height: 16,
},
colorSuccess: {
color: theme.palette.success.main,
},
colorError: {
color: theme.palette.error.main,
},
}),
);

type JobStatusIconProps = {
job: UnifiedJob;
small?: boolean;
} & ClassNameProps;

export const JobStatusIcon = ({
job,
small = false,
className,
}: JobStatusIconProps) => {
const classes = useJobStatusIconStyles();

switch (job.status) {
case "SUCCEEDED":
return (
<RiCheckboxCircleFill
className={classNames(
classes.icon,
classes.colorSuccess,
{
[classes.iconSmall]: small,
},
className,
)}
/>
);
case "FAILED":
case "STOPPED":
return (
<RiCloseCircleFill
className={classNames(
classes.icon,
classes.colorError,
{
[classes.iconSmall]: small,
},
className,
)}
/>
);
default:
return <JobRunningIcon className={className} small={small} />;
}
};

type JobStatusWithIconProps = {
job: UnifiedJob;
};

export const JobStatusWithIcon = ({ job }: JobStatusWithIconProps) => {
return (
<Box display="inline-flex" alignItems="center">
<StatusChip
type="job"
status={job.status}
icon={<JobStatusIcon job={job} />}
/>
</Box>
);
};
39 changes: 28 additions & 11 deletions dashboard/client/src/components/StatusChip.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Color } from "@material-ui/core";
import { Color, createStyles, makeStyles } from "@material-ui/core";
import {
blue,
blueGrey,
Expand All @@ -11,6 +11,7 @@ import {
yellow,
} from "@material-ui/core/colors";
import { CSSProperties } from "@material-ui/core/styles/withStyles";
import classNames from "classnames";
import React, { ReactNode } from "react";
import { ActorEnum } from "../type/actor";
import { PlacementGroupState } from "../type/placementGroup";
Expand Down Expand Up @@ -96,23 +97,35 @@ const typeMap = {
[key: string]: Color;
};

const useStyles = makeStyles((theme) =>
createStyles({
root: {
padding: "2px 8px",
border: "solid 1px",
borderRadius: 4,
fontSize: 12,
margin: 2,
display: "inline-flex",
alignItems: "center",
},
afterIcon: {
marginLeft: 4,
},
}),
);

export const StatusChip = ({
type,
status,
suffix,
icon,
}: {
type: string;
status: string | ActorEnum | ReactNode;
suffix?: string;
icon?: ReactNode;
}) => {
const style = {
padding: "2px 8px",
border: "solid 1px",
borderRadius: 4,
fontSize: 12,
margin: 2,
} as CSSProperties;

const classes = useStyles();
let color: Color | string = blueGrey;

if (typeMap[type]) {
Expand All @@ -127,15 +140,19 @@ export const StatusChip = ({

const colorValue = typeof color === "string" ? color : color[500];

const style: CSSProperties = {};
style.color = colorValue;
style.borderColor = colorValue;
if (color !== blueGrey) {
style.backgroundColor = `${colorValue}20`;
}

return (
<span style={style}>
{status}
<span className={classes.root} style={style}>
{icon}
<span className={classNames({ [classes.afterIcon]: icon !== undefined })}>
{status}
</span>
{suffix}
</span>
);
Expand Down
3 changes: 2 additions & 1 deletion dashboard/client/src/pages/job/JobDetailInfoPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import React from "react";
import { CodeDialogButtonWithPreview } from "../../common/CodeDialogButton";
import { DurationText } from "../../common/DurationText";
import { formatDateFromTimeMs } from "../../common/formatUtils";
import { JobStatusWithIcon } from "../../common/JobStatus";
import {
CpuProfilingLink,
CpuStackTraceLink,
Expand Down Expand Up @@ -95,7 +96,7 @@ export const JobMetadataSection = ({ job }: JobMetadataSectionProps) => {
},
{
label: "Status",
content: <StatusChip type="job" status={job.status} />,
content: <JobStatusWithIcon job={job} />,
},
{
label: "Job ID",
Expand Down
14 changes: 13 additions & 1 deletion dashboard/client/src/pages/job/JobProgressBar.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { makeStyles } from "@material-ui/core";
import { LinearProgress, makeStyles } from "@material-ui/core";
import React, { useEffect, useState } from "react";
import { UnifiedJob } from "../../type/job";
import {
Expand Down Expand Up @@ -41,12 +41,14 @@ export const JobProgressBar = ({

const {
progress,
isLoading: progressLoading,
driverExists,
totalTasks,
latestFetchTimestamp: progressTimestamp,
} = useJobProgress(jobId, advancedProgressBarExpanded);
const {
progressGroups,
isLoading: progressGroupsLoading,
total,
totalTasks: advancedTotalTasks,
latestFetchTimestamp: totalTimestamp,
Expand All @@ -58,10 +60,20 @@ export const JobProgressBar = ({
if (!driverExists) {
return <TaskProgressBar />;
}

if (
progressLoading &&
(progressGroupsLoading || !advancedProgressBarRendered)
) {
return <LinearProgress />;
}

const { status } = job;
// Use whichever data was received the most recently
// Note these values may disagree in some way. It might better to consistently use one endpoint.
const [totalProgress, finalTotalTasks] =
total === undefined ||
advancedTotalTasks === undefined ||
progressTimestamp > totalTimestamp
? [progress, totalTasks]
: [total, advancedTotalTasks];
Expand Down
4 changes: 2 additions & 2 deletions dashboard/client/src/pages/job/JobRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import React from "react";
import { Link } from "react-router-dom";
import { DurationText } from "../../common/DurationText";
import { formatDateFromTimeMs } from "../../common/formatUtils";
import { JobStatusWithIcon } from "../../common/JobStatus";
import {
CpuProfilingLink,
CpuStackTraceLink,
} from "../../common/ProfilingLink";
import { StatusChip } from "../../components/StatusChip";
import { UnifiedJob } from "../../type/job";
import { useJobProgress } from "./hook/useJobProgress";
import { JobLogsLink } from "./JobDetail";
Expand Down Expand Up @@ -74,7 +74,7 @@ export const JobRow = ({ job }: JobRowProps) => {
</Tooltip>
</TableCell>
<TableCell align="center">
<StatusChip type="job" status={job.status} />
<JobStatusWithIcon job={job} />
</TableCell>
<TableCell align="center">
{start_time && start_time > 0 ? (
Expand Down
Loading

0 comments on commit ad02f88

Please sign in to comment.