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] Disconnected Clients: "Unknown" allocations in the UI #12544

Merged
merged 13 commits into from
Apr 22, 2022

Conversation

philrenaud
Copy link
Contributor

@philrenaud philrenaud commented Apr 11, 2022

Resolves #12485
Resolves #12486

Adds "Unknown" as a valid status in allocation tables, to the allocation status bar, and the allocation legend.
image

// from being visually centered
&:nth-child(2n + 1):last-child {
margin-right: calc(35% + 0.75em);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Without this rule:
image

With this rule:
image

@@ -211,6 +211,7 @@ export default class ClientController extends Controller.extend(
{ key: 'complete', label: 'Complete' },
{ key: 'failed', label: 'Failed' },
{ key: 'lost', label: 'Lost' },
{ key: 'unknown', label: 'Unknown' },
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This change (and similar changes to jobs/job/allocations controller, etc.) all correspond to these filters:

image

@philrenaud philrenaud marked this pull request as ready for review April 11, 2022 18:11
@github-actions
Copy link

github-actions bot commented Apr 11, 2022

Ember Asset Size action

As of 9f8ae31

Files that got Bigger 🚨:

File raw gzip
nomad-ui.js +2.82 kB +623 B
nomad-ui.css +275 B +72 B

Files that stayed the same size 🤷‍:

File raw gzip
vendor.js 0 B 0 B
vendor.css 0 B 0 B

@github-actions
Copy link

github-actions bot commented Apr 11, 2022

Ember Test Audit comparison

main 9f8ae31 change
passes 1272 1275 +3
failures 0 0 0
flaky 1 1 0
duration 9m 03s 324ms 9m 30s 418ms +27s 094ms

Copy link
Contributor

@DerekStrickland DerekStrickland left a comment

Choose a reason for hiding this comment

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

One minor suggestion to the help text but nothing blocking. Nice job!

ui/app/components/allocation-status-bar.js Outdated Show resolved Hide resolved
Copy link
Contributor

@ChaiWithJai ChaiWithJai left a comment

Choose a reason for hiding this comment

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

There's 11 failing tests which definitely makes me think we should poke around a little bit more and we might need to update our utility for computing derived state for job-client-status.

spread.nomad Outdated Show resolved Hide resolved
ui/app/components/allocation-status-bar.js Show resolved Hide resolved
Copy link
Contributor

@ChaiWithJai ChaiWithJai left a comment

Choose a reason for hiding this comment

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

Excellent job! I think there's a few things we should discuss. I like to use a bottoms-up approach starting with views (chatting about components if necessary), then moving up routes/controllers, and then models + services and then tie it all back with tests.

The following views are impacting by the surface area of this change, which sends back a new status on the Allocation and Node models:

  • ui/clients
  • /ui/clients/:id
  • /ui/allocations/:id
  • /ui/jobs/:id
  • /ui/jobs/:id/allocations
  • /ui/jobs/:id/deployments
  • /ui/topology

I'm unsure if we're addressing the changes in /clients or allocations.

What should we do about the Topology Visualization?
@DerekStrickland did a great job spotting this out in his RFC. And I think, during the design process we missed talking about impact to the Topology visualization which visualizes Allocations and decorates them based on their status (starting, running, or failed).

We should turn back to @mikenomitch and @juliezzhou regarding this.

How should we handle the new Allocation clientStatus of unknown and the Node being in a state of disconnected instead of down?
This issue is more than a color-swatch but about getting an inventory of derived state computations that will be used throughout the application via related Ember Data models and services (our Stats Tracker Registry). I don't think there will be too much to look into re: Stats Tracker Registry at a cursory glance, but just wanted to highlight all of the possible places we should be looking.

How can I set this environment up myself?
I think we'll want to include some documentation about how to reproduce this without Mirage. @DerekStrickland is there any documentation about setting this environment up?

There are certain actions the user can take against nodes and allocations such as setting node eligibility and draining the node in the UI, and we'll need intense testing around these possible behaviors.

ui/tests/acceptance/client-detail-test.js Show resolved Hide resolved
@@ -74,6 +74,7 @@ module('Unit | Util | JobClientStatus', function () {
notScheduled: [],
queued: [],
starting: [],
unknown: [],
Copy link
Contributor

Choose a reason for hiding this comment

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

thought: should we write a unit test for unknown statuses and how it can impact our computation?

ui/app/models/job-summary.js Show resolved Hide resolved
ui/tests/acceptance/client-detail-test.js Show resolved Hide resolved
ui/app/styles/charts/colors.scss Show resolved Hide resolved
@@ -18,6 +18,7 @@ export default Factory.extend({
Running: faker.random.number(10),
Starting: faker.random.number(10),
Lost: faker.random.number(10),
Unknown: faker.random.number(10),
Copy link
Contributor

Choose a reason for hiding this comment

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

question: Should this impact all jobs?

In the edge case, we're developing this feature to enable those users to maintain their up-time requirements. That makes me feel like this situation is only regarding service jobs which are long-standing jobs compared to system and batch jobs.

cc: @DerekStrickland @mikenomitch do I have this to be, correct?

Copy link
Contributor

Choose a reason for hiding this comment

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

System, sysbatch, service and batch jobs can all transition to unknown.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah all of them can be unknown.

Not important for the code, but actually in some ways batch is more vital than service. Since batch jobs are "stateful" more often that service, the cost of restarting them can often be higher. So losing connection and coming back gracefully is more important.

ui/mirage/factories/job-summary.js Show resolved Hide resolved
@DerekStrickland
Copy link
Contributor

I think we'll want to include some documentation about how to reproduce this without Mirage. @DerekStrickland is there any documentation about setting this environment up?

There is! You can follow the steps outlined here for setting up a Vagrant environment. I can also help support you as you work through that process if it would help. Another alternative is to set up an E2E environment using our E2E test terraform. The README is pretty awesome. If you need/want to do it together just let me know.

Once you have the environment up and running, you can find some sample jobs and basic instructions in this repo. I sent you an invite. The instructions in the root readme should be G2G for the basic use case. They are geared towards the Vagrant environment, so if you go with E2E you'll have to make some adjustments. Just let me know if you need help.

@github-actions
Copy link

Ember Test Audit flaky tests

Ember Test Audit detected these flaky tests on main:

  • Acceptance | job dispatch (with namespace): required meta fields are properly indicated

Ember Test Audit detected these flaky tests on 9f8ae31:

  • Acceptance | job dispatch: required meta fields are properly indicated

@philrenaud philrenaud merged commit cabe057 into main Apr 22, 2022
@philrenaud philrenaud deleted the 12486-disconnected-clients-ui-update-client-statuses branch April 22, 2022 15:25
@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 Oct 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

disconnected clients: UI: Update Client Statuses disconnected clients: UI: Update Allocation Statuses
4 participants