Ordering policy of resource presets
- Dominant language
- Python
- Stars
- 670
- Forks
- 183
- Avg merge
- 17h 7m
- Merged PRs (30d)
- 358
Description
Currently, resource presets are only alphabetically ordered (when requesting a specific set of resource presets by names):
https://github.com/lablup/backend.ai/blob/dec5284b7e836209af657fbf25fa09515fbf4cab/src/ai/backend/manager/models/resource_preset.py#L88
or unordered (when listing all resource presets at once):
https://github.com/lablup/backend.ai/blob/dec5284b7e836209af657fbf25fa09515fbf4cab/src/ai/backend/manager/models/resource_preset.py#L70
Let's add an option to explicitly order them:
- `LEXICOGRAPHIC_ASC`: alphabetically ordered
- `LEXICOGRAPHIC_DESC`: alphabetically reverse-ordered (new)
- `RESOURCE_SIZE_ASC`: smaller resource preset first (new)
- `RESOURCE_SIZE_DESC`: larger resource preset first (new)
To define the relative size of resource presets, we should have a resource slot precedence to make them comparable with each other. Fortunately, we already apply a similar precedence-based ordering when calculating the optimal hardware layouts in the agents as the allocation order config:https://github.com/lablup/backend.ai/blob/dec5284b7e836209af657fbf25fa09515fbf4cab/configs/agent/sample.toml#L286
We also need to add a new, similar shared config option to separately set the resource slot precedence for the UI displays.
JIRA Issue: BA-189
Contributor guide
Assessment
This issue has not been assessed yet.