Skip to content

Commit

Permalink
update (#4)
Browse files Browse the repository at this point in the history
<!-- Thank you for your contribution! Please review
https://github.com/ray-project/ray/blob/master/CONTRIBUTING.rst before
opening a pull request. -->

<!-- Please add a reviewer to the assignee section when you create a PR.
If you don't have the access to it, we will shortly find a reviewer and
assign them to your PR. -->

## Why are these changes needed?

<!-- Please give a short summary of the change and the problem this
solves. -->

## Related issue number

<!-- For example: "Closes ray-project#1234" -->

## Checks

- [ ] I've signed off every commit(by using the -s flag, i.e., `git
commit -s`) in this PR.
- [ ] I've run `scripts/format.sh` to lint the changes in this PR.
- [ ] I've included any doc changes needed for
https://docs.ray.io/en/master/.
- [ ] I've made sure the tests are passing. Note that there might be a
few flaky tests, see the recent failures at https://flakey-tests.ray.io/
- Testing Strategy
   - [ ] Unit tests
   - [ ] Release tests
   - [ ] This PR is not tested :(
  • Loading branch information
jcoffi authored Jan 25, 2023
2 parents ad36238 + fe65c3e commit b24933d
Show file tree
Hide file tree
Showing 210 changed files with 4,930 additions and 1,991 deletions.
1 change: 1 addition & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2735,6 +2735,7 @@ pyx_library(
"//:global_state_accessor_lib",
"//:ray_util",
"//:raylet_lib",
"//:redis_client",
"//:src/ray/ray_exported_symbols.lds",
"//:src/ray/ray_version_script.lds",
"//:stats_lib",
Expand Down
3 changes: 2 additions & 1 deletion ci/env/install-core-prerelease-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
set -e

# install all unbounded dependencies in setup.py for ray core
for dependency in attrs jsonschema aiosignal frozenlist requests grpcio protobuf
# TOOD(scv119) reenable grpcio once https://github.com/grpc/grpc/issues/31885 is fixed.
for dependency in attrs jsonschema aiosignal frozenlist requests protobuf
do
python -m pip install -U --pre --upgrade-strategy=eager $dependency
done
1 change: 1 addition & 0 deletions ci/pipeline/determine_tests_to_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ def get_commit_range():
RAY_CI_SERVE_AFFECTED = 1
RAY_CI_LINUX_WHEELS_AFFECTED = 1
RAY_CI_MACOS_WHEELS_AFFECTED = 1
RAY_CI_JAVA_AFFECTED = 1
elif changed_file.startswith("python/ray/dashboard"):
RAY_CI_DASHBOARD_AFFECTED = 1
# https://github.com/ray-project/ray/pull/15981
Expand Down
11 changes: 10 additions & 1 deletion dashboard/client/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import Events from "./pages/event/Events";
import Loading from "./pages/exception/Loading";
import JobList, { NewIAJobsPage } from "./pages/job";
import { JobDetailChartsPage } from "./pages/job/JobDetail";
import { JobDetailActorsPage } from "./pages/job/JobDetailActorPage";
import { JobDetailInfoPage } from "./pages/job/JobDetailInfoPage";
import { JobDetailLayout } from "./pages/job/JobDetailLayout";
import { DEFAULT_VALUE, MainNavContext } from "./pages/layout/mainNavContext";
Expand Down Expand Up @@ -205,11 +206,19 @@ const App = () => {
<Route
element={
<SideTabPage tabId="charts">
<JobDetailChartsPage />
<JobDetailChartsPage newIA />
</SideTabPage>
}
path=""
/>
<Route
element={
<SideTabPage tabId="actors">
<JobDetailActorsPage />
</SideTabPage>
}
path="actors"
/>
</Route>
</Route>
<Route element={<NewIALogsPage />} path="logs">
Expand Down
48 changes: 38 additions & 10 deletions dashboard/client/src/common/CollapsibleSection.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { createStyles, makeStyles, Typography } from "@material-ui/core";
import React, { PropsWithChildren, useState } from "react";
import { RiArrowDownSLine, RiArrowUpSLine } from "react-icons/ri";
import classNames from "classnames";
import React, { PropsWithChildren, useEffect, useState } from "react";
import { RiArrowDownSLine, RiArrowRightSLine } from "react-icons/ri";
import { ClassNameProps } from "./props";

const useStyles = makeStyles((theme) =>
createStyles({
Expand All @@ -10,32 +12,50 @@ const useStyles = makeStyles((theme) =>
flexWrap: "nowrap",
alignItems: "center",
fontWeight: 500,
cursor: "pointer",
},
icon: {
marginRight: theme.spacing(1),
width: 24,
height: 24,
},
body: {
marginTop: theme.spacing(3),
marginTop: theme.spacing(1),
},
bodyHidden: {
display: "none",
},
}),
);

type CollapsibleSectionProps = PropsWithChildren<{
title: string;
startExpanded?: boolean;
className?: string;
}>;
type CollapsibleSectionProps = PropsWithChildren<
{
title: string;
startExpanded?: boolean;
/**
* An optimization to not avoid re-rendering the contents of the collapsible section.
* When enabled, we will keep the content around when collapsing but hide it via css.
*/
keepRendered?: boolean;
} & ClassNameProps
>;

export const CollapsibleSection = ({
title,
startExpanded = false,
className,
children,
keepRendered,
}: CollapsibleSectionProps) => {
const classes = useStyles();
const [expanded, setExpanded] = useState(startExpanded);
const [rendered, setRendered] = useState(expanded);

useEffect(() => {
if (expanded) {
setRendered(true);
}
}, [expanded]);

const handleExpandClick = () => {
setExpanded(!expanded);
Expand All @@ -51,11 +71,19 @@ export const CollapsibleSection = ({
{expanded ? (
<RiArrowDownSLine className={classes.icon} />
) : (
<RiArrowUpSLine className={classes.icon} />
<RiArrowRightSLine className={classes.icon} />
)}
{title}
</Typography>
{expanded && <div className={classes.body}>{children}</div>}
{(expanded || (keepRendered && rendered)) && (
<div
className={classNames(classes.body, {
[classes.bodyHidden]: !expanded,
})}
>
{children}
</div>
)}
</div>
);
};
31 changes: 25 additions & 6 deletions dashboard/client/src/components/TaskTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ import {
import Autocomplete from "@material-ui/lab/Autocomplete";
import Pagination from "@material-ui/lab/Pagination";
import React, { useState } from "react";
import { DurationText } from "../common/DurationText";
import rowStyles from "../common/RowStyles";
import { Task } from "../type/task";
import { useFilter } from "../util/hook";
import StateCounter from "./StatesCounter";
import { StatusChip } from "./StatusChip";

const TaskTable = ({
Expand All @@ -36,7 +38,8 @@ const TaskTable = ({
{ label: "ID" },
{ label: "Name" },
{ label: "Job Id" },
{ label: "Scheduling State" },
{ label: "State" },
{ label: "Duration" },
{ label: "Function or Class Name" },
{ label: "Node Id" },
{ label: "Actor_id" },
Expand All @@ -59,12 +62,12 @@ const TaskTable = ({
/>
<Autocomplete
style={{ margin: 8, width: 120 }}
options={Array.from(new Set(tasks.map((e) => e.scheduling_state)))}
options={Array.from(new Set(tasks.map((e) => e.state)))}
onInputChange={(_: any, value: string) => {
changeFilter("scheduling_state", value.trim());
changeFilter("state", value.trim());
}}
renderInput={(params: TextFieldProps) => (
<TextField {...params} label="Scheduling State" />
<TextField {...params} label="State" />
)}
/>
<Autocomplete
Expand Down Expand Up @@ -121,6 +124,9 @@ const TaskTable = ({
count={Math.ceil(taskList.length / pageSize)}
/>
</div>
<div>
<StateCounter type="task" list={taskList} />
</div>
</div>
<Table>
<TableHead>
Expand All @@ -140,12 +146,15 @@ const TaskTable = ({
task_id,
name,
job_id,
scheduling_state,
state,
func_or_class_name,
node_id,
actor_id,
type,
required_resources,
events,
start_time_ms,
end_time_ms,
}) => (
<TableRow>
<TableCell align="center">
Expand All @@ -161,7 +170,17 @@ const TaskTable = ({
<TableCell align="center">{name ? name : "-"}</TableCell>
<TableCell align="center">{job_id}</TableCell>
<TableCell align="center">
<StatusChip type="actor" status={scheduling_state} />
<StatusChip type="actor" status={state} />
</TableCell>
<TableCell align="center">
{start_time_ms && start_time_ms > 0 ? (
<DurationText
startTime={start_time_ms}
endTime={end_time_ms}
/>
) : (
"-"
)}
</TableCell>
<TableCell align="center">{func_or_class_name}</TableCell>
<TableCell align="center">{node_id ? node_id : "-"}</TableCell>
Expand Down
8 changes: 7 additions & 1 deletion dashboard/client/src/pages/job/JobDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@ const useStyle = makeStyles((theme) => ({
},
}));

export const JobDetailChartsPage = () => {
type JobDetailChartsPageProps = {
newIA?: boolean;
};

export const JobDetailChartsPage = ({
newIA = false,
}: JobDetailChartsPageProps) => {
const classes = useStyle();
const { job, msg, params } = useJobDetail();
const jobId = params.id;
Expand Down
37 changes: 37 additions & 0 deletions dashboard/client/src/pages/job/JobDetailActorPage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { makeStyles } from "@material-ui/core";
import React from "react";

import TitleCard from "../../components/TitleCard";
import ActorList from "../actor/ActorList";
import { MainNavPageInfo } from "../layout/mainNavContext";
import { useJobDetail } from "./hook/useJobDetail";

const useStyle = makeStyles((theme) => ({
root: {
padding: theme.spacing(2),
},
}));

export const JobDetailActorsPage = () => {
const classes = useStyle();
const { job, params } = useJobDetail();

const pageInfo = job
? {
title: "Actors",
id: "actors",
path: job.job_id ? `/new/jobs/${job.job_id}/actors` : undefined,
}
: {
title: "Actors",
id: "actors",
path: undefined,
};

return (
<div className={classes.root}>
<MainNavPageInfo pageInfo={pageInfo} />
<TitleCard title="Actors">{<ActorList jobId={params.id} />}</TitleCard>
</div>
);
};
12 changes: 11 additions & 1 deletion dashboard/client/src/pages/job/JobDetailLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import React from "react";
import { RiInformationLine, RiLineChartLine } from "react-icons/ri";
import {
RiGradienterLine,
RiInformationLine,
RiLineChartLine,
} from "react-icons/ri";
import { MainNavPageInfo } from "../layout/mainNavContext";
import { SideTabLayout, SideTabRouteLink } from "../layout/SideTabLayout";
import { useJobDetail } from "./hook/useJobDetail";
Expand Down Expand Up @@ -29,6 +33,12 @@ export const JobDetailLayout = () => {
title="Charts"
Icon={RiLineChartLine}
/>
<SideTabRouteLink
to="actors"
tabId="actors"
title="Actors"
Icon={RiGradienterLine}
/>
</SideTabLayout>
);
};
19 changes: 13 additions & 6 deletions dashboard/client/src/pages/layout/MainNavLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,14 @@ const useMainNavBarStyles = makeStyles((theme) =>
boxShadow: "0px 1px 0px #D2DCE6",
},
logo: {
width: 60,
display: "flex",
justifyContent: "center",
marginLeft: theme.spacing(2),
marginRight: theme.spacing(3),
},
navItem: {
marginRight: theme.spacing(2),
fontSize: "1em",
marginRight: theme.spacing(6),
fontSize: "1rem",
fontWeight: 500,
color: "black",
textDecoration: "none",
Expand Down Expand Up @@ -211,15 +212,21 @@ const MainNavBreadcrumbs = () => {
);
if (index === 0) {
return (
<Typography key={id} className={classes.breadcrumbItem}>
<Typography
key={id}
className={classes.breadcrumbItem}
variant="body2"
>
{linkOrText}
</Typography>
);
} else {
return (
<React.Fragment key={id}>
<Typography className={classes.breadcrumbItem}>{"/"}</Typography>
<Typography className={classes.breadcrumbItem}>
<Typography className={classes.breadcrumbItem} variant="body2">
{"/"}
</Typography>
<Typography className={classes.breadcrumbItem} variant="body2">
{linkOrText}
</Typography>
</React.Fragment>
Expand Down
2 changes: 1 addition & 1 deletion dashboard/client/src/pages/log/Logs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ const Logs = (props: LogsProps) => {
setEnd,
} = useLogs(props);
const { newIA } = props;
let href = newIA ? "#/new/log/" : "#/log/";
let href = newIA ? "#/new/logs/" : "#/log/";

if (origin) {
if (path) {
Expand Down
Loading

0 comments on commit b24933d

Please sign in to comment.