Skip to content

Commit b898457

Browse files
committed
feature(FR-529): Aplication memory bar (#3473)
Resolves #3177 (FR-529) # Enhanced Shared Memory UI in Resource Allocation Form This PR improves the shared memory (SHMEM) allocation UI in the resource allocation form by: 1. Adding a visual representation of memory allocation with a slider that shows the proportion of application memory vs shared memory 2. Implementing an auto/manual toggle switch for shared memory allocation 3. Adding tooltips with explanatory text about shared memory allocation 4. Displaying memory allocation values with appropriate units 5. Adding validation to recommend that shared memory be less than half of application memory The new UI makes it clearer to users how memory is being allocated between application memory and shared memory, while providing both automatic and manual configuration options. ![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/XqC2uNFuj0wg8I60sMUh/64072a97-b3ad-4840-9aa3-2cf5690437ef.png) ![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/XqC2uNFuj0wg8I60sMUh/b167e9c1-eb9e-4f01-9859-472b6956bcba.png)
1 parent 97fa510 commit b898457

23 files changed

Lines changed: 363 additions & 106 deletions

react/src/components/ResourceAllocationFormItems.tsx

Lines changed: 265 additions & 105 deletions
Large diffs are not rendered by default.

react/src/helper/index.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ function convertSizeUnit(
201201
return {
202202
number: finalBytes,
203203
numberFixed,
204-
unit: sizes[targetIndex],
204+
unit: sizes[targetIndex] as SizeUnit,
205205
numberUnit: `${numberFixed}${sizes[targetIndex]}`,
206206
};
207207
}
@@ -267,6 +267,19 @@ export function addNumberWithUnits(
267267
)?.numberUnit;
268268
}
269269

270+
export function subNumberWihUnits(
271+
size1: string,
272+
size2: string,
273+
targetUnit: SizeUnit = 'm',
274+
) {
275+
return convertBinarySizeUnit(
276+
(convertBinarySizeUnit(size1, 'b')?.number || 0) -
277+
(convertBinarySizeUnit(size2, 'b')?.number || 0) +
278+
'b',
279+
targetUnit,
280+
)?.numberUnit;
281+
}
282+
270283
export type QuotaScopeType = 'project' | 'user';
271284
export const addQuotaScopeTypePrefix = (type: QuotaScopeType, str: string) => {
272285
if (str === '' || str === undefined) return '';

resources/i18n/de.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,7 @@
593593
"Add": "Hinzufügen",
594594
"Advanced": "Fortgeschritten",
595595
"All": "Alle",
596+
"Auto": "Auto",
596597
"Change": "Ändern Sie",
597598
"ConfirmPassword": "Kennwort bestätigen",
598599
"Control": "Steuerung",
@@ -607,6 +608,7 @@
607608
"InProgress": "In Arbeit",
608609
"InvalidJSONFormat": "Ungültiges JSON-Format.",
609610
"LastUpdated": "Zuletzt aktualisiert",
611+
"Manual": "Handbuch",
610612
"MaxValueNotification": "{{name}} muss maximal {{max}} sein",
611613
"NSelected": "{{Zahl}} ausgewählt",
612614
"NewPassword": "Neues Kennwort",
@@ -1259,6 +1261,7 @@
12591261
"AllocateNode": "Cluster-Modus",
12601262
"Architecture": "Architektur",
12611263
"AutoSelect": "Automatische Auswahl",
1264+
"AutoSharedMemoryTooltip": "Sie können die Größe des gemeinsamen Speichers innerhalb des zugewiesenen Speichers automatisch auswählen oder manuell eingeben.",
12621265
"Base": "Base",
12631266
"BatchJobTimeoutDuration": "Dauer des Batch-Job-Timeouts",
12641267
"BatchJobTimeoutDurationDesc": "Legen Sie die maximale Ausführungszeit für Batch-Jobs fest. \nDie Sitzung wird automatisch beendet, wenn die angegebene Zeit überschritten wird.",
@@ -1384,6 +1387,7 @@
13841387
"ResourceAllocationPerContainer": "Ressourcenzuweisung pro Container",
13851388
"ResourceGroup": "Ressourcengruppe",
13861389
"ResourceMonitorToggle": "Siehe Ressourcenmonitor",
1390+
"SHMEMShouldBeLessThanHalfOfAppMemory": "Es wird empfohlen, dass der gemeinsam genutzte Speicher weniger als die Hälfte des Anwendungsspeichers beträgt.",
13871391
"ScheduleTime": "Zeit einplanen (optional)",
13881392
"ScheduleTimeSimple": "Startzeit einstellen",
13891393
"SelectAgent": "Wählen Sie Agent aus",

resources/i18n/el.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,7 @@
589589
"Add": "Προσθήκη",
590590
"Advanced": "Προχωρημένος",
591591
"All": "Όλα",
592+
"Auto": "Auto",
592593
"Change": "Αλλαγή",
593594
"ConfirmPassword": "Επιβεβαίωση Κωδικού",
594595
"Control": "Ελεγχος",
@@ -603,6 +604,7 @@
603604
"InProgress": "Σε εξέλιξη",
604605
"InvalidJSONFormat": "Μη έγκυρη μορφή JSON.",
605606
"LastUpdated": "Τελευταία ενημέρωση",
607+
"Manual": "Χειροκίνητο",
606608
"MaxValueNotification": "{{name}} πρέπει να είναι το μέγιστο {{max}}",
607609
"NSelected": "{{count}} selected",
608610
"NewPassword": "νέος κωδικός πρόσβασης",
@@ -1255,6 +1257,7 @@
12551257
"AllocateNode": "Λειτουργία συμπλέγματος",
12561258
"Architecture": "Αρχιτεκτονική",
12571259
"AutoSelect": "Αυτόματη επιλογή",
1260+
"AutoSharedMemoryTooltip": "Μπορείτε να επιλέξετε αυτόματα ή να εισαγάγετε χειροκίνητα το μέγεθος της κοινόχρηστης μνήμης εντός της διατιθέμενης μνήμης.",
12581261
"Base": "Βάση",
12591262
"BatchJobTimeoutDuration": "Διάρκεια χρονικού ορίου λήξης παρτίδας εργασίας",
12601263
"BatchJobTimeoutDurationDesc": "Ορίστε τον μέγιστο χρόνο εκτέλεσης για εργασίες παρτίδας. \nΗ συνεδρία θα τερματιστεί αυτόματα εάν ξεπεραστεί ο καθορισμένος χρόνος.",
@@ -1380,6 +1383,7 @@
13801383
"ResourceAllocationPerContainer": "Κατανομή πόρων ανά εμπορευματοκιβώτιο",
13811384
"ResourceGroup": "Ομάδα πόρων",
13821385
"ResourceMonitorToggle": "Δείτε την παρακολούθηση πόρων",
1386+
"SHMEMShouldBeLessThanHalfOfAppMemory": "Η κοινόχρηστη μνήμη συνιστάται να είναι μικρότερη από το ήμισυ της μνήμης της εφαρμογής.",
13831387
"ScheduleTime": "Χρόνος προγραμματισμού (προαιρετικά)",
13841388
"ScheduleTimeSimple": "Ρύθμιση ώρας έναρξης",
13851389
"SelectAgent": "Επιλέξτε Πράκτορας",

resources/i18n/en.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,7 @@
599599
"Add": "Add",
600600
"Advanced": "Advanced",
601601
"All": "All",
602+
"Auto": "Auto",
602603
"Change": "Change",
603604
"ConfirmPassword": "Confirm Password",
604605
"Control": "Control",
@@ -613,6 +614,7 @@
613614
"InProgress": "In progress",
614615
"InvalidJSONFormat": "Invalid JSON format.",
615616
"LastUpdated": "Last Updated",
617+
"Manual": "Manual",
616618
"MaxValueNotification": "{{name}} must be maximum {{max}}",
617619
"NSelected": "{{count}} selected",
618620
"NewPassword": "New Password",
@@ -1265,6 +1267,7 @@
12651267
"AllocateNode": "Cluster mode",
12661268
"Architecture": "Architecture",
12671269
"AutoSelect": "Auto Select",
1270+
"AutoSharedMemoryTooltip": "You can automatically select or manually enter the shared memory size within the allocated memory.",
12681271
"Base": "Base",
12691272
"BatchJobTimeoutDuration": "Batch Job Timeout Duration",
12701273
"BatchJobTimeoutDurationDesc": "Set the maximum execution time for batch jobs. The session will automatically terminate if the specified time is exceeded.",
@@ -1391,6 +1394,7 @@
13911394
"ResourceAllocationPerContainer": "Resource Allocation Per Container",
13921395
"ResourceGroup": "Resource Group",
13931396
"ResourceMonitorToggle": "See resource monitor",
1397+
"SHMEMShouldBeLessThanHalfOfAppMemory": "Shared memory is recommended to be less than half of the application memory.",
13941398
"ScheduleTime": "Schedule time (optional)",
13951399
"ScheduleTimeSimple": "Set start time",
13961400
"SelectAgent": "Select Agent",

resources/i18n/es.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,7 @@
593593
"Add": "Añadir",
594594
"Advanced": "Avanzado",
595595
"All": "Todos",
596+
"Auto": "Auto",
596597
"Change": "Cambia",
597598
"ConfirmPassword": "Confirmar contraseña",
598599
"Control": "Controlar",
@@ -607,6 +608,7 @@
607608
"InProgress": "En curso",
608609
"InvalidJSONFormat": "Formato JSON no válido.",
609610
"LastUpdated": "Última actualización",
611+
"Manual": "Manual",
610612
"MaxValueNotification": "{{name}} debe ser máximo {{max}}",
611613
"NSelected": "{{cuenta}} seleccionado",
612614
"NewPassword": "Nueva contraseña",
@@ -1259,6 +1261,7 @@
12591261
"AllocateNode": "Modo clúster",
12601262
"Architecture": "Arquitectura",
12611263
"AutoSelect": "Selección automática",
1264+
"AutoSharedMemoryTooltip": "Puede seleccionar automáticamente o introducir manualmente el tamaño de la memoria compartida dentro de la memoria asignada.",
12621265
"Base": "Base",
12631266
"BatchJobTimeoutDuration": "Duración del tiempo de espera del trabajo por lotes",
12641267
"BatchJobTimeoutDurationDesc": "Establezca el tiempo máximo de ejecución para trabajos por lotes. \nLa sesión finalizará automáticamente si se excede el tiempo especificado.",
@@ -1384,6 +1387,7 @@
13841387
"ResourceAllocationPerContainer": "Asignación de recursos por contenedor",
13851388
"ResourceGroup": "Grupo de recursos",
13861389
"ResourceMonitorToggle": "Ver monitor de recursos",
1390+
"SHMEMShouldBeLessThanHalfOfAppMemory": "Se recomienda que la memoria compartida sea inferior a la mitad de la memoria de la aplicación.",
13871391
"ScheduleTime": "Programar hora (opcional)",
13881392
"ScheduleTimeSimple": "Establecer hora de inicio",
13891393
"SelectAgent": "Seleccionar Agente",

resources/i18n/fi.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,7 @@
592592
"Add": "Lisää",
593593
"Advanced": "Edistynyt",
594594
"All": "Kaikki",
595+
"Auto": "Auto",
595596
"Change": "Muuta",
596597
"ConfirmPassword": "Vahvista salasana",
597598
"Control": "Valvonta",
@@ -606,6 +607,7 @@
606607
"InProgress": "Käynnissä",
607608
"InvalidJSONFormat": "Väärä JSON-muoto.",
608609
"LastUpdated": "Viimeksi päivitetty",
610+
"Manual": "Manuaalinen",
609611
"MaxValueNotification": "{{name}} on oltava maksimi {{max}}",
610612
"NSelected": "{{count}} valittu",
611613
"NewPassword": "Uusi salasana",
@@ -1257,6 +1259,7 @@
12571259
"AllocateNode": "Cluster-tila",
12581260
"Architecture": "Arkkitehtuuri",
12591261
"AutoSelect": "Automaattinen valinta",
1262+
"AutoSharedMemoryTooltip": "Voit valita jaetun muistin koon automaattisesti tai syöttää sen manuaalisesti jaetun muistin sisällä.",
12601263
"Base": "Base",
12611264
"BatchJobTimeoutDuration": "Erätyön aikakatkaisun kesto",
12621265
"BatchJobTimeoutDurationDesc": "Aseta erätöiden enimmäissuoritusaika. \nIstunto päättyy automaattisesti, jos määritetty aika ylittyy.",
@@ -1382,6 +1385,7 @@
13821385
"ResourceAllocationPerContainer": "Resurssien jakaminen konttia kohti",
13831386
"ResourceGroup": "Resurssiryhmä",
13841387
"ResourceMonitorToggle": "Katso resurssimonitori",
1388+
"SHMEMShouldBeLessThanHalfOfAppMemory": "Jaetun muistin suositellaan olevan alle puolet sovelluksen muistista.",
13851389
"ScheduleTime": "Aikatauluaika (valinnainen)",
13861390
"ScheduleTimeSimple": "Aseta aloitusaika",
13871391
"SelectAgent": "Valitse Agentti",

resources/i18n/fr.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,7 @@
593593
"Add": "Ajouter",
594594
"Advanced": "Avancée",
595595
"All": "Tous",
596+
"Auto": "Auto",
596597
"Change": "Changer",
597598
"ConfirmPassword": "Confirmez le mot de passe",
598599
"Control": "Contrôler",
@@ -607,6 +608,7 @@
607608
"InProgress": "En cours",
608609
"InvalidJSONFormat": "Format JSON non valide.",
609610
"LastUpdated": "Dernière mise à jour",
611+
"Manual": "Manuel",
610612
"MaxValueNotification": "{{nom}} doit être maximum {{max}}",
611613
"NSelected": "{{count}} sélectionné",
612614
"NewPassword": "nouveau mot de passe",
@@ -1259,6 +1261,7 @@
12591261
"AllocateNode": "Mode cluster",
12601262
"Architecture": "Architecture",
12611263
"AutoSelect": "Sélection automatique",
1264+
"AutoSharedMemoryTooltip": "Vous pouvez sélectionner automatiquement ou saisir manuellement la taille de la mémoire partagée dans la mémoire allouée.",
12621265
"Base": "Base",
12631266
"BatchJobTimeoutDuration": "Durée d'expiration du travail par lots",
12641267
"BatchJobTimeoutDurationDesc": "Définissez la durée d'exécution maximale des tâches par lots. \nLa session se terminera automatiquement si la durée spécifiée est dépassée.",
@@ -1384,6 +1387,7 @@
13841387
"ResourceAllocationPerContainer": "Allocation de ressources par conteneur",
13851388
"ResourceGroup": "Groupe de ressources",
13861389
"ResourceMonitorToggle": "Voir le moniteur de ressources",
1390+
"SHMEMShouldBeLessThanHalfOfAppMemory": "Il est recommandé que la mémoire partagée soit inférieure à la moitié de la mémoire de l'application.",
13871391
"ScheduleTime": "Programmation de l'heure (facultatif)",
13881392
"ScheduleTimeSimple": "Définir l'heure de début",
13891393
"SelectAgent": "Sélectionnez un agent",

resources/i18n/id.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,7 @@
592592
"Add": "Tambah",
593593
"Advanced": "Lanjutan",
594594
"All": "Semua",
595+
"Auto": "Otomatis",
595596
"Change": "Perubahan",
596597
"ConfirmPassword": "Periksa Password",
597598
"Control": "Kontrol",
@@ -606,6 +607,7 @@
606607
"InProgress": "Sedang Berlangsung",
607608
"InvalidJSONFormat": "Format JSON tidak valid.",
608609
"LastUpdated": "Terakhir diperbarui",
610+
"Manual": "Manual",
609611
"MaxValueNotification": "{{nama}} harus maksimal {{max}}",
610612
"NSelected": "{{count}} dipilih",
611613
"NewPassword": "Kata Sandi Baru",
@@ -1257,6 +1259,7 @@
12571259
"AllocateNode": "Modus klaster",
12581260
"Architecture": "Arsitektur",
12591261
"AutoSelect": "Pilih Otomatis",
1262+
"AutoSharedMemoryTooltip": "Anda dapat memilih secara otomatis atau secara manual memasukkan ukuran memori bersama dalam memori yang dialokasikan.",
12601263
"Base": "Basis",
12611264
"BatchJobTimeoutDuration": "Durasi Batas Waktu Tugas Batch",
12621265
"BatchJobTimeoutDurationDesc": "Tetapkan waktu eksekusi maksimum untuk pekerjaan batch. \nSesi akan otomatis berakhir jika waktu yang ditentukan terlampaui.",
@@ -1383,6 +1386,7 @@
13831386
"ResourceAllocationPerContainer": "Alokasi Sumber Daya Per Kontainer",
13841387
"ResourceGroup": "Grup Sumber Daya",
13851388
"ResourceMonitorToggle": "Lihat monitor sumber daya",
1389+
"SHMEMShouldBeLessThanHalfOfAppMemory": "Memori bersama disarankan kurang dari setengah memori aplikasi.",
13861390
"ScheduleTime": "Jadwalkan waktu (opsional)",
13871391
"ScheduleTimeSimple": "Tetapkan waktu mulai",
13881392
"SelectAgent": "Pilih Agen",

resources/i18n/it.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,7 @@
592592
"Add": "Inserisci",
593593
"Advanced": "Avanzate",
594594
"All": "Tutti",
595+
"Auto": "Auto",
595596
"Change": "Cambiamento",
596597
"ConfirmPassword": "conferma password",
597598
"Control": "Controllo",
@@ -606,6 +607,7 @@
606607
"InProgress": "In corso",
607608
"InvalidJSONFormat": "Formato JSON non valido.",
608609
"LastUpdated": "Ultimo aggiornamento",
610+
"Manual": "Manuale",
609611
"MaxValueNotification": "{{nome}} deve essere massimo {{max}}",
610612
"NSelected": "{{count}} selezionato",
611613
"NewPassword": "nuova password",
@@ -1256,6 +1258,7 @@
12561258
"AllocateNode": "Modalità cluster",
12571259
"Architecture": "Architettura",
12581260
"AutoSelect": "Auto selezione",
1261+
"AutoSharedMemoryTooltip": "È possibile selezionare automaticamente o inserire manualmente la dimensione della memoria condivisa all'interno della memoria allocata.",
12591262
"Base": "Base",
12601263
"BatchJobTimeoutDuration": "Durata del timeout del lavoro batch",
12611264
"BatchJobTimeoutDurationDesc": "Imposta il tempo di esecuzione massimo per i lavori batch. \nLa sessione terminerà automaticamente se viene superato il tempo specificato.",
@@ -1381,6 +1384,7 @@
13811384
"ResourceAllocationPerContainer": "Allocazione delle risorse per contenitore",
13821385
"ResourceGroup": "Gruppo di risorse",
13831386
"ResourceMonitorToggle": "Vedi il monitoraggio delle risorse",
1387+
"SHMEMShouldBeLessThanHalfOfAppMemory": "Si raccomanda che la memoria condivisa sia inferiore alla metà della memoria dell'applicazione.",
13841388
"ScheduleTime": "Programmare l'orario (opzionale)",
13851389
"ScheduleTimeSimple": "Imposta l'ora di inizio",
13861390
"SelectAgent": "Seleziona Agente",

0 commit comments

Comments
 (0)