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

fix: merged resource limit is affected by remaining in the resource group. #2696

Merged
merged 1 commit into from
Sep 9, 2024

Commits on Sep 9, 2024

  1. 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
    yomybaby committed Sep 9, 2024
    Configuration menu
    Copy the full SHA
    40b6062 View commit details
    Browse the repository at this point in the history