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

feat(Node): display node version [YTFRONT-4555] #927

Merged
merged 1 commit into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ interface Props {
physicalHost: Node['physicalHost'];
host: Node['host'];
maintenanceRequests?: Node['maintenanceRequests'];
version?: Node['version'];
jobProxyBuildVersion?: Node['jobProxyBuildVersion'];
}

function NodeMeta({
Expand All @@ -53,9 +55,11 @@ function NodeMeta({
disableJobs,
disableTabletCells,
disableWriteSession,
jobProxyBuildVersion,
physicalHost,
host,
maintenanceRequests,
version,
}: Props): ReturnType<React.VFC> {
const clusterConfig = useSelector(getCurrentClusterConfig);

Expand All @@ -71,10 +75,12 @@ function NodeMeta({
disableTabletCells,
disableWriteSession,
full,
jobProxyBuildVersion,
lastSeenTime,
rack,
state,
maintenanceRequests,
version,
});
}, [
alertCount,
Expand All @@ -87,10 +93,12 @@ function NodeMeta({
disableTabletCells,
disableWriteSession,
full,
jobProxyBuildVersion,
lastSeenTime,
rack,
state,
maintenanceRequests,
version,
]);

const tagsItems = React.useMemo(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ export class Node {
'/statistics/total_used_space',
'/statistics/total_available_space',
'maintenance_requests',
'job_proxy_build_version',
] as const;

static getResourcesSlots(resourceUsage: unknown, resourceLimits: unknown, key: string) {
Expand Down Expand Up @@ -162,6 +163,7 @@ export class Node {
userSlotsProgress: number | undefined;
userTags!: string[];
version?: string;
jobProxyBuildVersion?: string;

private statistics: unknown;

Expand All @@ -187,6 +189,7 @@ export class Node {
this.memory = ypath.getValue(this.statistics, '/memory') || {};

this.version = ypath.getValue(attributes, '/version');
this.jobProxyBuildVersion = ypath.getValue(attributes, '/job_proxy_build_version');
this.physicalHost = ypath.getValue(attributes, '/annotations')?.['physical_host'];
this.dataCenter = ypath.getValue(attributes, '/data_center');
this.state = ypath.getValue(attributes, '/state');
Expand Down Expand Up @@ -491,6 +494,7 @@ export const AttributesByProperty: Record<keyof Node, ReadonlyArray<AttributeNam
gpu: gpuAttributes,
host: hostAttributes,
IOWeight: ['/statistics/media'],
jobProxyBuildVersion: ['job_proxy_build_version'],
lastSeenTime: ['last_seen_time'],
locations: locationsAttributes,
maintenanceRequests: ['maintenance_requests'],
Expand Down
14 changes: 14 additions & 0 deletions packages/ui/src/ui/utils/components/nodes/node-meta-items.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@ export function getNodeMetaItems({
disableWriteSession,
disableTabletCells,
full,
jobProxyBuildVersion,
lastSeenTime,
maintenanceRequests,
state,
rack,
version,
}: Pick<
Node,
| 'alertCount'
Expand All @@ -46,10 +48,12 @@ export function getNodeMetaItems({
| 'disableWriteSession'
| 'disableTabletCells'
| 'full'
| 'jobProxyBuildVersion'
| 'lastSeenTime'
| 'maintenanceRequests'
| 'state'
| 'rack'
| 'version'
>): Array<MetaTableItem> {
const stateText = hammer.format['FirstUppercase'](state);
const stateTheme = getStateTheme(state);
Expand Down Expand Up @@ -124,5 +128,15 @@ export function getNodeMetaItems({
format: 'full',
}),
},
{
key: 'version',
value: version,
visible: Boolean(version),
},
{
key: 'job_proxy_build_version',
value: jobProxyBuildVersion,
visible: Boolean(jobProxyBuildVersion),
},
];
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading