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: match field version compatibility for vfolder v3 #2292

Merged
merged 14 commits into from
Apr 5, 2024

Conversation

agatha197
Copy link
Contributor

@agatha197 agatha197 commented Apr 2, 2024

original issue: #1742
related PR: lablup/backend.ai#1993

Description

  • add deprecated and support variables to _updateSupportList() in backend.ai-client-esm.ts
  • Show max_vfolder_count according to the manager version.
    • Data & Storage page - number of folders of storage status panel
    • Users - CREDENTIALS
    • Users - RESOURCE POLICIES - list and setting dialog
  • update schema
  • Add deleting status to deadVFolderStatuses and VFolderOperationStatus for version compatibility

Version compatibility (Updated at 230404)

Keypair Resource Policy

Field 23.09 24.03
max_vfolder_count from 23.09.4 X same
max_quota_scope_size from 23.09.6 X same
max_vfolder_size from 23.09.4 X same

User/Project Resource Policy

Field 23.09 24.03
max_vfolder_count from 23.09.6 O same
max_quota_scope_size from 23.09.2 O same
max_vfolder_size from 23.09.2 X same

How to setup

Checklist

  • manager version < 23.09.4: visible
    • Data page
      • Capacity column, Folder usage - Capacity (click the info icon of the control icon) is visible.
        (* If you want to see the capacity, make sure the current host is one of the quotaSupportStorageBackends ('xfs', 'weka', 'spectrumscale', 'netapp', 'vast', 'cephfs','ddn') and directoryBasedUsage is true.)
        - I used deprecated-max-quota-scope-in-keypair-resource-policy when checking the quotaSupportStorageBackends. refer
        https://github.com/lablup/backend.ai/blob/main/src/ai/backend/manager/api/vfolder.py#L1054
      • Number of folders - Limit is visible.
    • User page
      • Credential tab - max_vfolder_count of resource policy column is visible
      • Resource Policies tab - max_vfolder_count of resources column / max # of folders when creating or modifying policy are visible.
  • manager version >= 24.09.6: invisible except for Number of folders - Limit
    • In the data page, the Limit value will be max_vfolder_count of user_resource_policy.
      Except that, all data is invisible.
      // Support version:
      // keypair resource policy < 23.09.4
      // user resource policy, project resource policy >= 23.09.6
      let maxVfolderCount;
      if (
      // manager version >= 23.09.6
      baiClient?.supports('max-vfolder-count-in-user-and-project-resource-policy')
      ) {
      maxVfolderCount = user_resource_policy?.max_vfolder_count || 0;
      } else {
      maxVfolderCount = keypair_resource_policy?.max_vfolder_count || 0;
      }

Checklist: (if applicable)

  • Mention to the original issue
  • Documentation
  • Minium required manager version
  • Specific setting for review (eg., KB link, endpoint or how to setup)
  • Minimum requirements to check during review
  • Test case(s) to demonstrate the difference of before/after

@agatha197 agatha197 added type:fix Fix features that are not working urgency:blocker IT SHOULD BE RESOLVED BEFORE DISTRIBUTING urgency:4 As soon as feasible, implementation is essential. platform:general impact:invisible This change is invisible to users (internal changes). field:UI / UX labels Apr 2, 2024
@agatha197 agatha197 added this to the 24.03 milestone Apr 2, 2024
@agatha197 agatha197 requested a review from yomybaby April 2, 2024 08:28
@agatha197 agatha197 self-assigned this Apr 2, 2024
@github-actions github-actions bot added size:L 100~500 LoC and removed field:UI / UX labels Apr 2, 2024
Copy link

github-actions bot commented Apr 2, 2024

Coverage report for ./react

St.
Category Percentage Covered / Total
🔴 Statements
3.11% (-0% 🔻)
117/3764
🔴 Branches
3.51% (-0.02% 🔻)
87/2481
🔴 Functions 1.53% 19/1244
🔴 Lines
3.06% (-0% 🔻)
113/3691

Test suite run success

32 tests passing in 4 suites.

Report generated by 🧪jest coverage report action from 7d5c0e0

{t('data.Limit')}:
</Typography.Text>
{maxVfolderCount === 0 ? '-' : maxVfolderCount}
{maxVfolderCount && (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if maxVfolderCount === 0, react display 0 instead of nothing. Does maxVfolderCount === 0 means? unlimited or 0 or -?

Copy link
Contributor Author

@agatha197 agatha197 Apr 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I modified the codes. If maxVfolderCount is 0, display 0. And the numberOfFolderPercent is 100.
@yomybaby you can test by editing the max_vfolder_count in Users - Resource Policy tab - Edit Max. # of folders.
image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check this thread. Currently, the manager handles 0 as unlimited. It should be changed in the near future. But for now, let's display it as unlimited. @agatha197

@agatha197 agatha197 requested a review from yomybaby April 3, 2024 04:23
Copy link
Member

@yomybaby yomybaby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check this out.

@agatha197
Copy link
Contributor Author

agatha197 commented Apr 5, 2024

Please check this out.

Updated!
image

@agatha197 agatha197 requested a review from yomybaby April 5, 2024 01:53
Copy link
Member

@yomybaby yomybaby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

The count of created folders has to include virtual folders in the trash bin if the trash bin is supported, right?

Also, the count doesn't change after creating and deleting permanently. It updates after refreshing the browser.

@lizable lizable requested a review from yomybaby April 5, 2024 05:06
@agatha197
Copy link
Contributor Author

image The count of created folders has to include virtual folders in the trash bin if the trash bin is supported, right?

Also, the count doesn't change after creating and deleting permanently. It updates after refreshing the browser.

handled in #2302

@agatha197 agatha197 requested a review from lizable April 5, 2024 05:17
@agatha197 agatha197 merged commit 7f5c7c1 into main Apr 5, 2024
8 checks passed
@agatha197 agatha197 deleted the feature/hide-directory-based-info branch April 5, 2024 05:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact:invisible This change is invisible to users (internal changes). platform:general size:L 100~500 LoC type:fix Fix features that are not working urgency:blocker IT SHOULD BE RESOLVED BEFORE DISTRIBUTING urgency:4 As soon as feasible, implementation is essential.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants