Backend.AI is a streamlined, container-based computing cluster platform that hosts popular computing/ML frameworks and diverse programming languages, with pluggable heterogeneous accelerator support including CUDA GPU, ROCm GPU, TPU, IPU and other NPUs.
Let's implement persistent per-user preferences such as timezones, appearance settings, preferred language, etc.
There are several classes of preferences:
Unmodifiable (fixed) user preference
Settings applied to individual users, but set by superadmins only.
e.g., Activation of functions like showing or hiding specific feature menus
Modifiable user preference
Settings applied to individual users which users may change by themselves.
e.g., Localization (language, timezone) and generic appearance settings like dark-mode
UI states
More UI-specific fine-grained states
e.g., Whether the sidebar is expanded or collapsed.
[!NOTE]
There is a working branch somewhere (?) worked by @inureyes several years ago.
It implements the server-side storage of the SettingsStore interface in the frontend.
Let's inspect and revive it and implement the differentiated level of per-user preference and UI states using its namespace concept.
[!NOTE]
This is a different issue from #98. The current /user-config API is to CRUD per-user dotfiles which are auto-populated on the session container startup.
[ ] Add a config-user json schema definition, placing it under src/ai/backend/manager/models/schema.
Let's share the validation logic in the manager and webui using this json schema.
In the manager, we could use pydantic to process the schema and validation.
[ ] #2513
Fill the default settings when migrating the database.
[ ] Add a user configuration API set to the manager:
Q: Whether to allow updating only a specific key by accepting a partial json object?
GET /config/schema/user (return the content of json schema)
[ ] Update the user fixtures for development to include some default settings.
Currently we are storing per-user frontend settings in the browser's local storage, which is not traferrable to different browser sessions. Let's store this in the manager.
Let's implement persistent per-user preferences such as timezones, appearance settings, preferred language, etc.
There are several classes of preferences:
config-user
json schema definition, placing it undersrc/ai/backend/manager/models/schema
.POST|GET /config/user/{user_id}
(write/read config)GET /config/schema/user
(return the content of json schema)Currently we are storing per-user frontend settings in the browser's local storage, which is not traferrable to different browser sessions. Let's store this in the manager.