Skip to content

Commit

Permalink
feat(Node): display node version [YTFRONT-4555]
Browse files Browse the repository at this point in the history
  • Loading branch information
Kanstantsin Autushka authored and KostyaAvtushko committed Jan 13, 2025
1 parent 1ebf9c2 commit 0e460d2
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 0 deletions.
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.

0 comments on commit 0e460d2

Please sign in to comment.