From ff706660d2ca5b08205584e4cc59ac9349f1a90c Mon Sep 17 00:00:00 2001 From: ijrsvt Date: Wed, 29 Jan 2020 14:32:19 -0800 Subject: [PATCH] Kill Actor UI addition (#6955) --- python/ray/dashboard/client/src/api.ts | 11 +++++++++++ .../src/pages/dashboard/logical-view/Actor.tsx | 17 ++++++++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/python/ray/dashboard/client/src/api.ts b/python/ray/dashboard/client/src/api.ts index 05fa47b18..8c7d63e57 100644 --- a/python/ray/dashboard/client/src/api.ts +++ b/python/ray/dashboard/client/src/api.ts @@ -178,3 +178,14 @@ export const getProfilingResultURL = (profilingId: string) => `${base}/speedscope/index.html#profileURL=${encodeURIComponent( `${base}/api/get_profiling_info?profiling_id=${profilingId}` )}`; + +export const launchKillActor = ( + actorId: string, + actorIpAddress: string, + actorPort: number +) => + get("/api/kill_actor", { + actor_id: actorId, + ip_address: actorIpAddress, + port: actorPort + }); diff --git a/python/ray/dashboard/client/src/pages/dashboard/logical-view/Actor.tsx b/python/ray/dashboard/client/src/pages/dashboard/logical-view/Actor.tsx index 71637ffcf..6af5cefc8 100644 --- a/python/ray/dashboard/client/src/pages/dashboard/logical-view/Actor.tsx +++ b/python/ray/dashboard/client/src/pages/dashboard/logical-view/Actor.tsx @@ -8,7 +8,8 @@ import { CheckProfilingStatusResponse, getProfilingResultURL, launchProfiling, - RayletInfoResponse + RayletInfoResponse, + launchKillActor } from "../../../api"; import Actors from "./Actors"; import Collapse from "@material-ui/core/Collapse"; @@ -110,6 +111,13 @@ class Actor extends React.Component, State> { } }; + killActor = () => { + const actor = this.props.actor; + if (actor.state === 0) { + launchKillActor(actor.actorId, actor.ipAddress, actor.port); + } + }; + render() { const { classes, actor } = this.props; const { expanded, profiling } = this.state; @@ -242,6 +250,13 @@ class Actor extends React.Component, State> { ))} ){" "} + {actor.state === 0 ? ( + + Kill Actor + + ) : ( + "" + )} {Object.entries(profiling).map( ([profilingId, { startTime, latestResponse }]) => latestResponse !== null && (