Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: merged resource limit is affected by remaining in the resource g…
…roup. (#2696) ### TL;DR Fixed and refactored resource limit and remaining calculations in useResourceLimitAndRemaining hook. This PR resolves the issue where the merged resource limit in useResourceLimitAndRemaining is affected by the remaining in the resource group. Now, the maximum value is determined as the minimum value of the following: - pre-container configuration (e.g., maxCPUCoresPerContainer) - keypair resource limit - group resource limit The useResourceLimitAndRemaining should consider the domain resource limit and the total slot size of the resource group. This will be handled by another PR. ### What changed? - Updated ResourceLimits type to use ResourceSlotName as key - Commented out resourceGroupResourceSize calculations for cpu and mem - Added keypair and group limits for accelerators - Updated type assertions in remaining resource calculations ### How to test? 1. Test resource allocation functionality in the UI 2. Verify that resource limits are correctly applied for different resource types (CPU, memory, accelerators) 3. Check that remaining resources are calculated accurately 4. Ensure that the changes don't introduce any regressions in resource management
- Loading branch information