-
Notifications
You must be signed in to change notification settings - Fork 5.5k
feat(ui): Add cluster tag #26485
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
feat(ui): Add cluster tag #26485
Conversation
Reviewer's GuideIntroduce a new Sequence diagram for fetching and displaying cluster tag in the UIsequenceDiagram
participant User as actor User
participant UI as Presto UI (PageTitle.jsx)
participant Server as Presto Server (/v1/cluster)
User->>UI: Load page
UI->>Server: GET /v1/cluster
Server-->>UI: { ..., clusterTag: "..." }
UI-->>User: Display clusterTag in navbar if present
Entity relationship diagram for clusterTag propagationerDiagram
SERVER_CONFIG ||--o{ CLUSTER_STATS : provides
CLUSTER_STATS {
string clusterTag
}
SERVER_CONFIG {
string clusterTag
}
Class diagram for updated ClusterStats and ServerConfig classesclassDiagram
class ServerConfig {
+String clusterTag
+String getClusterTag()
+ServerConfig setClusterTag(String)
}
class ClusterStats {
+String clusterTag
+getClusterTag()
}
ServerConfig <.. ClusterStats : provides clusterTag
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
@tdcmeehan WIP as a step 1, lemme know if this is in line with what you were envisioning |
steveburnett
left a comment
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.
LGTM! (docs)
Pull branch, local doc build, looks good. Thanks!
This is almost exactly what I had in mind! |
f825d99 to
d0f2926
Compare
d0f2926 to
fbe9923
Compare
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.
Hey there - I've reviewed your changes and they look great!
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `presto-ui/src/components/PageTitle.jsx:225-235` </location>
<code_context>
+ {clusterTag && (
</code_context>
<issue_to_address>
**suggestion (bug_risk):** Check for empty string or whitespace-only clusterTag before rendering.
The current check allows empty or whitespace-only clusterTag values, resulting in unnecessary rendering. Please trim clusterTag and ensure it is not empty before rendering.
```suggestion
{clusterTag && clusterTag.trim() !== "" && (
<li key="cluster-tag" className="min-width-0 flex-shrink-0">
<div className="navbar-cluster-info">
<div className="uppercase">Tag</div>
<div className="text" title="Cluster Tag">
<span
title={clusterTag}
className="badge bg-secondary truncated-badge d-inline-block"
>
{clusterTag}
</span>
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| {clusterTag && ( | ||
| <li key="cluster-tag" className="min-width-0 flex-shrink-0"> | ||
| <div className="navbar-cluster-info"> | ||
| <div className="uppercase">Tag</div> | ||
| <div className="text" title="Cluster Tag"> | ||
| <span | ||
| title={clusterTag} | ||
| className="badge bg-secondary truncated-badge d-inline-block" | ||
| > | ||
| {clusterTag} | ||
| </span> |
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.
suggestion (bug_risk): Check for empty string or whitespace-only clusterTag before rendering.
The current check allows empty or whitespace-only clusterTag values, resulting in unnecessary rendering. Please trim clusterTag and ensure it is not empty before rendering.
| {clusterTag && ( | |
| <li key="cluster-tag" className="min-width-0 flex-shrink-0"> | |
| <div className="navbar-cluster-info"> | |
| <div className="uppercase">Tag</div> | |
| <div className="text" title="Cluster Tag"> | |
| <span | |
| title={clusterTag} | |
| className="badge bg-secondary truncated-badge d-inline-block" | |
| > | |
| {clusterTag} | |
| </span> | |
| {clusterTag && clusterTag.trim() !== "" && ( | |
| <li key="cluster-tag" className="min-width-0 flex-shrink-0"> | |
| <div className="navbar-cluster-info"> | |
| <div className="uppercase">Tag</div> | |
| <div className="text" title="Cluster Tag"> | |
| <span | |
| title={clusterTag} | |
| className="badge bg-secondary truncated-badge d-inline-block" | |
| > | |
| {clusterTag} | |
| </span> |
yhwang
left a comment
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 UX changes look good to me
Good enhancement.
|
One question for the tag: |
Yeah good question, I could see that being a nice improvement. Maybe worth seeing how folks use the cluster tag first? I know for our initial use case a single tag does the job, but others may be different. Definitely UI wise we would need some kind of tooltip or dropdown, or more real estate in one way or another. |
|
LGTM, but please check the test failure, it's related. |
steveburnett
left a comment
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.
LGTM! (docs)
Pull branch, local doc build.
@tdcmeehan Apologies, I've updated the failing tests to include the new flag. New failures seem like unrelated network errors grabbing jars. Is there an easy way to re-run? |
Adds cluster tag config to our velox-testing start scripts for java, cpu, gpu. Sister PR to prestodb/presto#26485, which will display this tag in the UI so we can easily identify which type of cluster we have created.
Hi @johallar, I just started a re-run of failed jobs for this PR. Hope that helps! |
|
Thanks @johallar! |
Description
With many flavors of presto, it has become more important to be able to identify which flavor is running. As a first step, a generic "cluster tag" approach was decided upon to allow this.
Motivation and Context
Allow presto users to tag a cluster for easy identification from the UI, eg. Worker type: Java, C++, GPU
Impact
With and without a cluster tag configured:
Test Plan
Contributor checklist
Release Notes
Please follow release notes guidelines and fill in the release notes below.