Skip to content

Commit 2cf4f70

Browse files
committed
fix: some cleanups to the dashboard layout
- moves gpu utilization to the top level - adjust default window size to 1400x1050
1 parent a049404 commit 2cf4f70

File tree

9 files changed

+109
-49
lines changed

9 files changed

+109
-49
lines changed

bin/codeflare

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ export NODE_NO_WARNINGS=1
77
# export KUI_POPUP_WINDOW_RESIZE=true
88

99
# use a fixed popup window sizing of our choosing
10-
export WINDOW_WIDTH=1024
11-
export WIDTH_HEIGHT=768
10+
# export WINDOW_WIDTH=1024
11+
# export WIDTH_HEIGHT=768
1212

1313
# This tells the core Kui plugin resolver that we are using webpack to
1414
# build our headless bundles, not the old headless hacks
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
=== "Pip Dependencies"
2+
3+
```json
4+
---
5+
language: yaml
6+
include: .runtimeEnv.pip
7+
---
8+
--8<-- "$LOGDIR/job.json"
9+
```
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
=== "Environment"
2+
3+
```json
4+
---
5+
language: yaml
6+
include: .runtimeEnv.env_vars
7+
---
8+
--8<-- "$LOGDIR/job.json"
9+
```

plugins/plugin-client-default/notebooks/dashboard-summary.md

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,3 @@
1010
---
1111
--8<-- "$LOGDIR/job.json"
1212
```
13-
14-
=== "Environment"
15-
16-
```json
17-
---
18-
language: yaml
19-
include: .runtimeEnv.env_vars
20-
---
21-
--8<-- "$LOGDIR/job.json"
22-
```
23-
24-
=== "Pip Dependencies"
25-
26-
```json
27-
---
28-
language: yaml
29-
include: .runtimeEnv.pip
30-
---
31-
--8<-- "$LOGDIR/job.json"
32-
```

plugins/plugin-client-default/notebooks/dashboard.md

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
---
22
layout:
33
1:
4-
position: default
4+
position: left
55
maximized: true
66
2:
77
position: default
88
maximized: true
9+
3:
10+
position: default
11+
maximized: true
912
inverseColors: true
1013
---
1114

1215
--8<-- "./dashboard-summary.md"
13-
--8<-- "./dashboard-choices.md"
1416
--8<-- "./dashboard-source.md"
17+
--8<-- "./dashboard-envvars.md"
18+
--8<-- "./dashboard-dependencies.md"
1519

1620
---
1721

@@ -21,16 +25,6 @@ layout:
2125
--8<-- "$LOGDIR/logs/job.txt"
2226
```
2327

24-
=== "GPU Utilization"
25-
26-
```shell
27-
---
28-
execute: now
29-
outputOnly: true
30-
---
31-
chart "$LOGDIR/resources/gpu.txt"
32-
```
33-
3428
=== "Advanced"
3529
=== "Node Utilization"
3630

@@ -53,3 +47,14 @@ layout:
5347
--8<-- "$LOGDIR/events/kubernetes.txt"
5448
```
5549

50+
--8<-- "./dashboard-choices.md"
51+
52+
---
53+
54+
```shell
55+
---
56+
execute: now
57+
outputOnly: true
58+
---
59+
chart "$LOGDIR/resources/gpu.txt"
60+
```

plugins/plugin-codeflare/src/components/GPUChart.tsx

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ import React from "react"
1818
import { Chart, ChartAxis, ChartGroup, ChartArea } from "@patternfly/react-charts"
1919
import { Log } from "../types"
2020

21+
import "../../web/scss/components/Dashboard/Charts.scss"
22+
2123
type Props = {
2224
logs: Log[]
2325
}
@@ -36,6 +38,10 @@ const generateXValues = (logs: Log[]) => {
3638
return [...new Set(logs.filter((item) => item.utilizationGPU > 0).map((item) => item.timestamp))]
3739
}
3840

41+
const axisStyle = { tickLabels: { fontSize: 9 } }
42+
const yTickValues = [0, 25, 50, 75, 100]
43+
const yTickLabels = yTickValues.map((_) => `${_}%`)
44+
3945
const GPUChart = (props: Props) => {
4046
const { logs } = props
4147
console.log(generateXValues(logs))
@@ -44,19 +50,21 @@ const GPUChart = (props: Props) => {
4450
<Chart
4551
ariaTitle="GPU Utilization"
4652
ariaDesc="Chart showing GPU utilization over time"
47-
height={400}
53+
height={135}
4854
width={1000}
4955
maxDomain={{ y: 100 }}
5056
minDomain={{ y: 0 }}
5157
padding={{
52-
bottom: 30,
53-
left: 60,
54-
right: 20,
55-
top: 20,
58+
bottom: 25,
59+
left: 50,
60+
right: 5,
61+
top: 10,
5662
}}
5763
>
58-
<ChartAxis dependentAxis showGrid tickValues={[0, 25, 50, 75, 100]} label="Percentage (%)" />
64+
<ChartAxis dependentAxis showGrid style={axisStyle} tickValues={yTickValues} tickFormat={yTickLabels} />
5965
<ChartAxis
66+
scale="time"
67+
style={axisStyle}
6068
tickValues={generateXValues(logs)}
6169
tickFormat={generateXFormat(logs)}
6270
tickCount={generateXFormat(logs).length}

plugins/plugin-codeflare/src/controller/dashboard.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,11 @@ export default function registerDashboardCommands(registrar: Registrar) {
5151
}
5252

5353
registrar.listen("/dashboard", dashboardcli, { flags })
54-
registrar.listen("/codeflare/dashboardui", dashboardui, { needsUI: true, outputOnly: true, flags })
54+
registrar.listen("/codeflare/dashboardui", dashboardui, {
55+
needsUI: true,
56+
outputOnly: true,
57+
flags,
58+
width: 1400,
59+
height: 1050,
60+
})
5561
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Copyright 2022 The Kubernetes Authors
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
.pf-c-chart {
18+
path {
19+
fill: var(--color-latency-1) !important;
20+
stroke: var(--color-latency-1) !important;
21+
}
22+
23+
line {
24+
stroke: var(--color-base01) !important;
25+
}
26+
27+
tspan {
28+
fill: var(--color-text-02) !important;
29+
font-family: var(--font-sans-serif) !important;
30+
}
31+
}

plugins/plugin-codeflare/web/scss/components/Dashboard/_index.scss

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,20 @@
1414
* limitations under the License.
1515
*/
1616

17-
@import "@kui-shell/plugin-client-common/web/scss/components/Card/_mixins";
18-
@import "@kui-shell/plugin-client-common/web/scss/components/Editor/_mixins";
19-
@import "@kui-shell/plugin-client-common/web/scss/components/Terminal/_mixins";
17+
@import "@kui-shell/plugin-client-common/web/scss/components/Card/mixins";
18+
@import "@kui-shell/plugin-client-common/web/scss/components/Editor/mixins";
19+
@import "@kui-shell/plugin-client-common/web/scss/components/Terminal/mixins";
20+
@import "@kui-shell/plugin-client-common/web/scss/components/TopLevelTab/mixins";
2021
@import "@kui-shell/plugin-client-common/web/scss/components/Terminal/Maximized";
2122

22-
@include Split(2) {
23-
@include Rows(3);
24-
@include Columns(1);
25-
grid-template-areas: "T1" "T2" "T2";
23+
@include TopLevelTab {
24+
@include HasOnlyLeftStrip {
25+
@include Split(3) {
26+
@include Rows(5);
27+
@include Columns(5);
28+
grid-template-areas: "L1 L1 T1 T1 T1" "L1 L1 T1 T1 T1" "L1 L1 T1 T1 T1" "L1 L1 T1 T1 T1" "T2 T2 T2 T2 T2";
29+
}
30+
}
2631
}
2732

2833
@mixin Fill {
@@ -32,7 +37,7 @@
3237
}
3338

3439
@include SplitContainer {
35-
grid-gap: 0;
40+
grid-gap: 3px;
3641
}
3742

3843
@include Scrollback {
@@ -51,6 +56,9 @@
5156
overflow: hidden;
5257

5358
@include CardBody {
59+
& > pre {
60+
background-color: var(--color-repl-background-02);
61+
}
5462
& > pre > .paragraph {
5563
@include Fill;
5664
}
@@ -66,6 +74,10 @@
6674
}
6775

6876
@include Markdown {
77+
h4 {
78+
margin: 0;
79+
}
80+
6981
@include EditorBackground {
7082
background-color: transparent;
7183
}

0 commit comments

Comments
 (0)