Commit Graph

1622 Commits

Author SHA1 Message Date
Michael Lange e221eefdd2 Quietly ignore orphaned allocs in the topo viz 2020-12-17 11:18:43 -08:00
Buck Doyle 7e4c746c82
Move breadcrumbs objects into shared layout object (#9576)
Various page objects had breadcrumbs and breadcrumbFor within them, this
moves those to the existing Layout page object that contains shared page objects.
2020-12-10 11:51:22 -06:00
Buck Doyle 8348576473
Fix job recommendation test flakiness (#9591)
Instead of creating recommendations for all the jobs used
across these tests, this creates a specific job with
a higher group count, which reduces the likelihood
of having no recommendations to 0.0001%.

It was incorrect to assume that each task group would always
have recommendations, since there’s a 1% chance that a task
won’t have a recommendation. (10% chance for CPU and memory.)
This uses the number of groups with recommendations instead.
2020-12-10 10:10:25 -06:00
Michael Lange 27c16d1f0a Test coverage for the scale event serializer 2020-12-07 12:28:47 -08:00
Michael Lange 58ecacc710 Guard against a null Meta property in the scale event API 2020-12-07 12:28:23 -08:00
Buck Doyle 543fb24764
Fix allocation count in CSI volumes table (#9515)
This closes #9495. As detailed in there, the collection query GET
/v1/volumes?type=csi doesn’t return ReadAllocs and WriteAllocs, so the #
Allocs cell was always showing 0 upon first load because it was derived
from the lengths of those arrays. This uses the heretofore-ignored
CurrentReaders and CurrentWriters values to calculate the total instead.

The single-resource query GET /v1/volume/csi%2F:id doesn’t return
CurrentReaders and CurrentWriters that absence doesn’t override the
stored values when visiting an individual item.

Thanks to @apollo13 for reporting this and to @tgross for the API logs
and suggestion.
2020-12-07 08:51:41 -06:00
Buck Doyle 2d344179d3
Migrate preview deployments from Netlify to Vercel (#9471)
This adds:

* a script for building and deploying the Ember UI and Storybook to
  Vercel
* configuration for that deployment
* a header link to the UI to link to Storybook when built with
  STORYBOOK_LINK=true

It also removes a file used to configure Netlify redirects.

The Netlify setup had two “sites”: nomad-storybook and nomad-ui. I
attempted to replicate that here but ran into some platform limitations
with Vercel: two “projects” cannot share the same root directory without
also sharing the same vercel.json that lets us specify configuration
such as the rewrite needed to handle deep linking into the Ember UI. I
tried having Storybook use /ui/storybook as the root directory (and
adding a symbolically-linked package.json to bypass Vercel’s refusal
to build without it) but that produced broken Storybook deployments.

This instead combines the two projects into one
(nomad-storybook-and-ui), defaults to forwarding / to /ui/, and
adds the header link to the UI to navigate to Storybook.

Rather than have a complex build script in the Vercel configuration UI,
this delegates to a script in the repository.
2020-12-07 08:33:49 -06:00
Buck Doyle 3b0f876ae5
Add DAS namespaces toggle and fix empty card bug (#9337)
This builds on filtering to allow the optimize page to show recommendations
for the active namespace vs all namespaces. If turning off the toggle causes
the summary from the active card to become excluded from the filtered list,
the active summary changes, as with the facets.

It also includes a fix for this bug:
https://github.com/hashicorp/nomad/pull/9294#pullrequestreview-527748994
2020-11-30 08:18:44 -06:00
Buck Doyle ba147a4fca
Add query parameter to override Mirage scenario (#9380) 2020-11-30 08:12:15 -06:00
Tim Gross 4e79ddea45
csi/api: populate ReadAllocs/WriteAllocs fields (#9377)
The API is missing values for `ReadAllocs` and `WriteAllocs` fields, resulting
in allocation claims not being populated in the web UI. These fields mirror
the fields in `nomad/structs.CSIVolume`. Returning a separate list of stubs
for read and write would be ideal, but this can't be done without either
bloating the API response with repeated full `Allocation` data, or causing a
panic in previous versions of the CLI.

The `nomad/structs` fields are persisted with nil values and are populated
during RPC, so we'll do the same in the HTTP API and populate the `ReadAllocs`
and `WriteAllocs` fields with a map of allocation IDs, but with null
values. The web UI will then create its `ReadAllocations` and
`WriteAllocations` fields by mapping from those IDs to the values in
`Allocations`, instead of flattening the map into a list.
2020-11-25 16:44:06 -05:00
Tim Gross aa7c77d324
csi/ui: show Node Only for volumes when controllers aren't required (#9416)
Plugin health for controllers should show "Node Only" in the UI only when both
conditions are true: controllers are not required, and no controllers have
registered themselves (0 expected controllers). This accounts for "monolith"
plugins which might register as both controllers and nodes but not necessarily
have `ControllerRequired = true` because they don't implement the Controller
RPC endpoints we need (this requirement was added in #7844)

This changeset includes the following fixes:

* Update the Plugins tab of the UI so that monolith plugins don't show "Node
  Only" once they've registered.
* Add the missing "Node Only" logic to the Volumes tab of the UI.
2020-11-25 14:50:33 -05:00
Tim Gross 8df5f28dc3
ui/csi: fix links to volume IDs (#9355) 2020-11-13 15:44:34 -05:00
Michael Lange c041236629 Fix flaky lifecycle chart tests 2020-11-12 09:16:53 -08:00
Michael Lange f543137ec9 Revert "Temporarily remove poststop from the UI"
This reverts commit f8a505ea2f9def2a7ce7a93e6d0529e1b5da4894.
2020-11-12 09:16:52 -08:00
Michael Lange 9de4351eae Add missing feature fixture that was introduced while this feature was being developed 2020-11-11 16:43:47 -08:00
Michael Lange 4b32265867
Merge pull request #9294 from hashicorp/f-ui/das-filter-toggle
UI: Add DAS summary table filtering
2020-11-11 14:04:25 -08:00
Buck Doyle ba5e6983bb Move page object component to reflect page order 2020-11-10 13:42:15 -06:00
Buck Doyle e5089dec44 Remove unnecessary uses of createList 2020-11-10 13:38:27 -06:00
Buck Doyle 508adbf0ac Remove unused action
This is a remnant of another approach I tried when rerouting
/optimize when the filter excluded all summaries.
2020-11-10 10:07:48 -06:00
Buck Doyle 3ef7f9f89e Add redirect to parent when filter excludes all 2020-11-10 09:38:46 -06:00
Buck Doyle 7ed1f4dda8 Fix proceed to use filtered summaries 2020-11-09 15:00:58 -06:00
Buck Doyle 1cfbac5483 Add check that active summary isn’t filtered out 2020-11-09 13:02:16 -06:00
Buck Doyle 87b82a446d Add no matches empty state 2020-11-09 09:41:18 -06:00
Buck Doyle a1ea822ab7 Add count to search field placeholder 2020-11-09 09:32:49 -06:00
Buck Doyle 7b25b43ec6 Add summary-filtering field
This only filters by slug for now… 🧐
2020-11-09 09:28:40 -06:00
Buck Doyle 75861b8b4f Remove copypasted to-be-unused query parameters 2020-11-09 09:04:14 -06:00
Buck Doyle cc0336bf0f Add facets for recommendation summaries
This is mostly copied from the jobs list. One uncertainty
is what to do when changing a facet causes the currently-
active card to be excluded from the filtered list 🤔
2020-11-06 15:53:58 -06:00
Buck Doyle 8b5b2116ec
Fix job detail crash when recommendations off (#9269)
Without this, visiting any job detail page on Nomad OSS would crash with
an error like this:

Error: Ember Data Request GET
/v1/recommendations?job=ping%F0%9F%A5%B3&namespace=default returned a
404 Payload (text/xml)

The problem was twofold.

1. The recommendation ability didn’t include anything about checking
whether the feature was present. This adds a request to
/v1/operator/license on application load to determine which features are
present and store them in the system service. The ability now looks for
'Dynamic Application Sizing' in that feature list.

2. Second, I didn’t check permissions at all in the job-fetching or job
detail templates.
2020-11-06 08:21:38 -06:00
Michael Lange 36ac4ba840
Merge pull request #9271 from hashicorp/b-ui/missing-warning-in-stories
UI: Update lingering instances of the old warning icon in stories
2020-11-05 13:56:07 -08:00
Michael Lange be7b0040d3 Show dismissable no live updating notice on the topology page 2020-11-04 19:25:12 -08:00
Michael Lange 7494188013 Update lingering instances of the old warning icon in stories 2020-11-04 19:24:39 -08:00
Michael Lange 148d4429cf Show a partial view notice when ACLs are enabled and the mgmt token isn't being used 2020-11-04 15:24:34 -08:00
Michael Lange 093a935a71 Update URL for namespace globbing 2020-11-04 15:23:47 -08:00
Michael Lange 4dcf454d81 Forbidden state for the topo viz 2020-11-04 12:32:22 -08:00
Buck Doyle 20ec481090
Add DAS subroute and copy button (#9201)
This continues iteration on the DAS UI by adding the ability to directly
navigate to a recommendation summary by (namespaced) slug and a copy
button for the direct navigation link.

It includes a change to CopyButton allowing it to take a block that’s
rendered within the button.

It also changes some instances of multi-relationship traversal to use
in-summary attributes, such as summary.jobNamespace instead of
summary.job.namespace.name.
2020-11-04 12:22:24 -06:00
Buck Doyle 6450abfe76
Change node id search to prefix-only (#9244)
This test has been periodically failing, like here:
https://app.circleci.com/pipelines/github/hashicorp/nomad/12879/workflows/40c0445c-b244-4a04-a5a3-d9685b656c94/jobs/114751/tests

The failure was because sometimes the first node contains the
beginning of the ”otherNode” id somewhere within its id. It seems
less useful to match within the node, so this changes id search to
only match at the beginning of the id.
2020-11-04 12:12:31 -06:00
Michael Lange dc6ec319c2
Merge pull request #9074 from Liraim/fix_download
ui: "View Raw File" download using JS instead simple link
2020-11-04 10:09:35 -08:00
Michael Lange 34392ea280
Merge pull request #9256 from hashicorp/ui/upgrade-node
Use Node v12 for UI development
2020-11-04 10:06:41 -08:00
Michael Lange 59626344be Use Node v12 for UI development 2020-11-04 09:04:22 -08:00
Michael Lange 67bbd3770f
Merge pull request #9240 from hashicorp/f-ui/topo-viz-tooltips
UI: Topo Viz Tooltips
2020-11-02 13:46:58 -08:00
Michael Lange 521df4db97 Fix the raw 'blue' in recommendation cards to use '$blue' 2020-11-02 13:29:44 -08:00
Michael Lange 5f2ebf7a00 Replace visualViewport with the more compatible scrollX and scrollY 2020-11-02 13:25:50 -08:00
Michael Lange b5044250e6 Add tooltips to the topo viz 2020-11-02 13:25:33 -08:00
Vyacheslav Morov 48ebd36fce Add type=button to View Raw Data buttons. 2020-11-01 02:47:11 +03:00
Vyacheslav Morov c6fc37cf29 Change to button.
Rewrite tests to check that proper urls was called.
2020-10-31 23:11:14 +03:00
Michael Lange 654533229c Make the style-string property glimmer safe 2020-10-30 16:14:31 -07:00
Michael Lange d9cac96e5a Add new is-static chart tooltip variant and decouple from charts 2020-10-30 16:14:31 -07:00
Buck Doyle ab4b04e940
Add handling for empty state flaky test edge case (#9234)
This test occasionally fails because the random generation
sometimes produces a node with no allocations, such as here:
https://app.circleci.com/pipelines/github/hashicorp/nomad/12735/workflows/9a407f87-0383-48ee-8e41-7e6e351dce28/jobs/113130/steps

This is a temporary measure to solve it without trying to force the
generated data to always have an allocation.
2020-10-30 15:57:09 -05:00
Michael Lange 628fef86a5 Add namespace and task states query params to the topo viz route 2020-10-29 11:28:41 -07:00
Buck Doyle 39af5c709b
Fix Firefox positioning of chart resource label (#9209)
alignment-baseline appears to be ignored in Firefox, but dominant-baseline
works. This also moves the anchor into CSS.
2020-10-29 08:13:41 -05:00