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: create node pool model #17301

Merged
merged 17 commits into from
Jun 22, 2023
Merged

ui: create node pool model #17301

merged 17 commits into from
Jun 22, 2023

Conversation

ChaiWithJai
Copy link
Contributor

Resolves #17292

This PR adds a new NodePool model and serializer. The NodePool model is used to represent a pool of nodes that can be used to run applications. The serializer is used to serialize the JSON response of a NodePool object to a JSON:API object.

The NodePool model has the following properties:

name: The name of the node pool
description: A description of the node pool
meta: A map of additional metadata about the node pool
schedulerConfiguration: The configuration of the scheduler for the node pool

The serializer serializes NodePool objects to JSON:API by converting the properties of the objects to strings. The following is an example of the serialized object that is generated for a NodePool object:

{
  "name": "prod-eng",
  "description": "Production workloads",
  "meta": {
    "env": "production",
    "team": "engineering"
  },
  "schedulerConfiguration": {
    "SchedulerAlgorithm": "spread" // pattern match:  We don't apply camelCasing for nested objects in other models
  }
}

@github-actions
Copy link

github-actions bot commented May 24, 2023

Ember Test Audit comparison

main f2fc72a change
passes 1478 1493 +15
failures 0 1 +1
flaky 0 0 0
duration 12m 12s 024ms 000ms -12m 12s 024ms

ui/app/serializers/node-pool.js Show resolved Hide resolved
ui/app/models/node-pool.js Show resolved Hide resolved
ui/app/serializers/node-pool.js Show resolved Hide resolved
ui/tests/unit/serializers/node-pool-test.js Outdated Show resolved Hide resolved
Copy link
Contributor

@lgfa29 lgfa29 left a comment

Choose a reason for hiding this comment

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

Looking great!

I think removing the all node pool from the client list dropdown is the main blocker, otherwise you would always get an empty list result.

It would nice to have the topoviz updates as well, since it's such a useful page 😄

ui/app/controllers/clients/index.js Outdated Show resolved Hide resolved
ui/app/routes/topology.js Outdated Show resolved Hide resolved
ui/app/styles/components/dashboard-metric.scss Outdated Show resolved Hide resolved
ui/app/templates/topology.hbs Show resolved Hide resolved
ui/app/templates/components/job-row.hbs Outdated Show resolved Hide resolved
@lgfa29 lgfa29 self-requested a review June 21, 2023 21:34
ChaiWithJai and others added 12 commits June 22, 2023 11:36
* refact:  update models for relationship

* chore: setup mirage models + factory hooks (#17321)

* chore: setup mirage models + factory hooks

* Acceptance test hardening to avoid faker/mirage randomness

---------

Co-authored-by: Phil Renaud <phil@riotindustries.com>

* chore:  update comment

Co-authored-by: Luiz Aoqui <luiz@hashicorp.com>

---------

Co-authored-by: Phil Renaud <phil@riotindustries.com>
Co-authored-by: Luiz Aoqui <luiz@hashicorp.com>
* chore: create pool adapter

* chore: mirage route handler

* ui: add pool count to topo

* ui:  node pools data on `jobs.index` page (#17368)

* ui: node filter on jobs.index

* ui: add node pool to table viz

* ui:  node pools - client page visualization (#17372)

* refact: update mirage models

* ui: add pool filter to client list

* ui:  add pool to table viz

* ui:  add pool to statsboxes (#17373)
Require node pools to be created before nodes and jobs to force correct
environment setup and improve test repeatability.
The built-in node pool `all` should not be a client filter because nodes
are not allowed to register there.
Add node pool filter and tooltips to nodes and datacenters labels, and don't count node pool `all` in topoviz metrics.
The namespace, node pool, type, and priority values were already
displayed at the page header, so they made the children job table quite
crowded.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme/node-pools Issues related to node pools theme/ui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create a Node Pool Model in Ember Data
3 participants