Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI: Topology Visualization #9077

Merged
merged 52 commits into from
Oct 15, 2020
Merged

UI: Topology Visualization #9077

merged 52 commits into from
Oct 15, 2020

Conversation

DingoEatingFuzz
Copy link
Contributor

@DingoEatingFuzz DingoEatingFuzz commented Oct 13, 2020

This adds a topology visualization to the UI. It can be used to the see the state of every client and allocation at a glance. You can read more about it on Discuss where prototypes were posted.

image

TODO

@github-actions
Copy link

github-actions bot commented Oct 13, 2020

Ember Asset Size action

As of 8f94a98

Files that got Bigger 🚨:

File raw gzip
nomad-ui.js +67.9 kB +9.32 kB
vendor.js +54.5 kB +8.07 kB
nomad-ui.css +3.78 kB +693 B

Files that stayed the same size 🤷‍:

File raw gzip
vendor.css 0 B 0 B

@github-actions
Copy link

github-actions bot commented Oct 13, 2020

Ember Test Audit comparison

master 8f94a98 change
passes 1393 1450 +57
failures 0 0 0
flaky 0 0 0
duration 6m 39s 156ms 8m 06s 150ms +1m 26s 994ms

- Plot all datacenters
- For each datacenter, plot all nodes
- For each node, plot all allocations by memory and cpu
- For empty nodes, highlight the emptiness
- When hovering over allocations, give them visual focus
TBH, it's buggy and I don't like it.
… structures

Now all data loading happens in the TopoViz component as well as
computation of resource proportions.

Allocation selection state is also managed centrally uses a dedicated
structure indexed by group key (job id and task group name). This way
allocations don't need to be scanned at the node level, which is O(n) at
the best (assuming no ember overhead on recomputes).
Copy link
Contributor

@backspace backspace left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I documented some browser-specific problems but those can be addressed in followups, maybe the only thing I’d consider blocking is the changes to the environment file/default scenario, unless that was deliberate. I tried this out locally (only with Mirage) but it’s fun to toy with and seems like it’ll be useful!


test('formats x > 1024 * 1024 * 1024 * 1024 as GiB, since it is the highest allowed unit', function(assert) {
assert.equal(formatBytes([1024 * 1024 * 1024 * 1024]), '1024 GiB');
assert.equal(formatBytes([1024 * 1024 * 1024 * 1024 * 4]), '4096 GiB');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, maybe I can use this elsewhere 😀


allocationAssociationsArePresent: isPresent('[data-test-allocation-associations]'),
allocationAssociations: collection('[data-test-allocation-association]'),
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is surely not something you have any influence on but starting with this file there’s no more syntax highlighting, strangely!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

lol now this file has it but not the next 🙃

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find this happens pretty regularly with mega PRs.

margin-left: 1.5em;
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe legend entries could be made non-wrapping somehow?

image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good 🎉

transform: translate(50%, 50%);
text-anchor: middle;
alignment-baseline: central;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Safari disappointments:

image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😱 Browsers, please.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whew, sad times but nice fix

{{/each}}
</g>
</svg>
{{/if}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Firefox on the Netlify deployment:

image

Strangely, resizing the window doesn’t change anything (I thought window-resize might be related) but zooming out a few steps caused it to become aligned properly and then stay that way when I returned to default zoom!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is on Chrome locally with topoMedium scenario:

image

I’d think there shouldn’t be anything pointing to an empty client?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The resizing might be a bug, but the lines pointing to weird places is a quirk of the fixtures.

I didn't bother making sure allocations weren't "placed" on clients that didn't have room for them. The result is allocations taking up more than 100% of the width. So that line going to the empty client is actually going to the memory rect for the client in the left column, except it's beyond the width of the client.

It would be nice to make this better at some point, but I'm not sure how important it is since it's just for our local dev experience.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah understood, doesn’t seem worth fixing to me then, thanks

.reduce((sum, memory) => sum + (memory || 0), 0);
const totalReservedCPU = node.allocations
.mapBy('cpu')
.reduce((sum, cpu) => sum + (cpu || 0), 0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like these reducer functions could be shared?

// the yOffset to match heights with unstroked shapes.
get selectedYOffset() {
return this.height + 2.5;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I appreciate these explanations, sad that it has to be this way 😐

// Steps are used to restrict the range of curves. The closer control points are placed, the less
// curvature the curve generator will generate.
const stepsMain = [0, 0.8, 1.0];
// The second prong the fork does not need to retrace the entire path from the activePoint
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I appreciate these comments, would be nice if it were easy to have a reference diagram, but such is not the way hehe

@action
reflow() {
run.next(() => {
// There's nothing to do if this is single column layout
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tiny typo!


// Set the max height of the container to the height of the tallest column
this.element.style.maxHeight = max(columns.mapBy('height')) + 1 + 'px';
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I appreciate the explanations, I hope this ends up being useful somewhere else too!

@backspace
Copy link
Contributor

I forgot to mention this failing test, not sure if it’s a random flakiness problem that’s unrelated to this PR though as I don’t see any obvious change here that would relate 🤔

@DingoEatingFuzz
Copy link
Contributor Author

Yeah, this is the first time I've seen that test file. I cleaned up everything other than the SVG bugs, so I'll push that now to see what Circle says this time.

@DingoEatingFuzz
Copy link
Contributor Author

Okay @backspace, ready for re-review.

A few things I won't address right now (but feel free to disagree with me):

  1. M/C alignment in firefox: turns out firefox doesn't support alignment-baseline so I'll need a new approach here. Seems too minor to delay things further.
  2. Mirage scenarios that don't overload nodes causing weird lines drawn to visually the wrong clients: definitely this is unfortunate, but it can't happen on a real cluster, so I think it's low priority.
  3. Mhz vs. MHz: I'll do this in a follow up PR across everything, including instances like primary metric which already had this problem.

Copy link
Contributor

@backspace backspace left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ya I’m definitely fine with you ignoring those things! I had a question about a remaining change to the environment file but it’s looking good 😀

transform: translate(50%, 50%);
text-anchor: middle;
alignment-baseline: central;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whew, sad times but nice fix

margin-left: 1.5em;
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good 🎉

@@ -25,10 +25,10 @@ module.exports = function(environment) {

APP: {
blockingQueries: false,
mirageScenario: 'topoSmall',
mirageScenario: 'smallCluster',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This still has blockingQueries changed to false by default, just making sure that’s by choice 🤓

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It wasn't...but I also like it? Ha. Blocking queries + Mirage is kinda janky anyway.

Copy link
Contributor Author

@DingoEatingFuzz DingoEatingFuzz Oct 15, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh shoot, nvm, I'll flip it back. I forget that this impacts non-mirage too.


export function topoMediumBatch(server) {}

export function topoMediumVariadic(server) {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There’s another empty topoSmallProblems higher up… not a big deal but might be worth removing. I’m viewing “changes since” or whatever hence me not commenting on that line 🙃

// Used in glimmer component unit tests. Glimmer components should typically
// be tested with integration tests, but occasionally individual methods or
// properties have logic that isn't coupled to rendering or the DOM and can
// be better tested in a unit fashion.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, now I understand why I might use this 😀

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants