-
Notifications
You must be signed in to change notification settings - Fork 2k
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: Task Group Scaling Controls #8207
Conversation
This prevents the svg from being a target in click events.
…alue onto separate lines
This was a disturbing discovery. Requests in watch loops would recycle AbortControllers meaning once any request was aborted, all requests forever after were skipped. I noticed it with deployments and job summary on the job detail page. I suspect this regression occurred when jQuery was removed. This needs test coverage still to make sure it doesn't happen again.
Ember Asset Size actionAs of c70ea97 Files that got Bigger 🚨:
Files that stayed the same size 🤷:
|
Ember Test Audit comparison
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found this fun to toy around with, which to me is one aspect of a good design. I have some mega-detail UX suggestions but nothing blocking this from being merged. Success! 🥳
|
||
@computed('[email protected]') | ||
get policiesSupportScaling() { | ||
return this.activeNamespaceIncludesCapability('scale-job'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that we are slowly building up useful abstractions here as appropriate 🤩
export default scope => ({ | ||
scope, | ||
|
||
isPresent: isPresent(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really quite minor (ignorable even??) but since this is a page object “component”, isPresent
comes for free.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤯 Today I learned!
); | ||
assert.equal(scaleRequests.length, 1); | ||
assert.equal(JSON.parse(scaleRequests[0].requestBody).Count, 4); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love the granularity here 😀
await StepperInput.input.esc(); | ||
assert.equal(StepperInput.input.value, this.value); | ||
}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I enter a decimal value in the field, it results in a failed POST …/scale
event with a string response (!):
json: cannot unmarshal number 3.5 into Go struct field ScalingRequest.Count of type int64
Some kind of error-handling would be nice to have, or maybe a few kinds. I’m not sure what the best approach to this specific case would be, maybe reverting to the last number that worked? 🤔 That could be confusing though if you enter a valid number and it fails for unrelated reasons, there’s not really anywhere obvious to indicate what happened.
UX suggestions:
• when I tried entering a non-number (“x”) or deleting the contents of the field, it reset to the minimum count, what if it reverted to the last number instead? Or maybe the current behaviour is fine but should have attendant edge case assertions?
• could clicking the pseudo-label of “count” cause the number to become highlighted for editing?
• and maybe even clicking the field itself could highlight it instead of showing the caret? But maybe that’s too much of a departure from standard input field UX
That’s a lot of tiny details though, more questions than things I would insist on 😀 AND I can tell there’s a lot of UX attention already, like handling the Escape key for instance, I love it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really appreciate you hammering on this component! I of course want the UX of all the components to be as good as possible.
I tried to keep as much of the default number input experience as possible, but I agree with your critique. I'll add the following to our known issues list:
- invalid input should revert the value, not set to min (number input default)
- clicking the label of the stepper input should focus the input field
- when the input field is focused, the value should be highlighted so you don't have to deleting the existing value before providing a new one
avg_conn: { | ||
Source: 'prometheus', | ||
Query: | ||
'scalar(avg((haproxy_server_current_sessions{backend="http_back"}) and (haproxy_server_up{backend="http_back"} == 1)))', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wildness 🙃
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right? I copied it straight from the autoscaler docs.
@max={{model.scaling.max}} | ||
@value={{model.count}} | ||
@class="is-primary is-small" | ||
@disabled={{or model.job.runningDeployment (cannot "scale job")}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The task group row tells you you lack permissions when it’s turned off but this one is just turned off with no indication of why (example on Netlify), maybe the same tooltip could show? I hope it’s not Hard 😳
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeeeaaah. The reason (if you're curious) is there's a running deployment.
This definitely needs a tooltip, but it wasn't easy to shim it in with a good enough message, so I cut that corner to make the beta. I'll log it as a known issue though.
@@ -68,4 +68,20 @@ export default class JobAdapter extends WatchableNamespaceIDs { | |||
}, | |||
}); | |||
} | |||
|
|||
scale(job, group, count, reason) { | |||
const url = addToPath(this.urlForFindRecord(job.get('id'), 'job'), '/scale'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hadn’t known about addToPath
before, I feel like I could have used it at some point, I’ll try to remember it exists 😯
Nice, excited to see hashi-ui becoming less and less relevant! |
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. |
A fan favorite feature from Hashi UI is finally landing in the Nomad UI 🎉
We have always been cautious about allowing casual changes to job definitions outside of the source control loop given our core principle of infrastructure as code. However! The new scaling APIs means we can do the best of both worlds.
With this feature, in its initial form, if you have a task group that specifies a scaling block, the UI will let you scale a task group up and down within the min/max range declared in the job.
This can be done one of two ways: