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

Introduce user settings #1774

Closed
30 of 31 tasks
tcompa opened this issue Sep 18, 2024 · 1 comment · Fixed by #1778
Closed
30 of 31 tasks

Introduce user settings #1774

tcompa opened this issue Sep 18, 2024 · 1 comment · Fixed by #1778
Assignees
Labels
High Priority Current Priorities & Blocking Issues user_settings v2.6.0

Comments

@tcompa
Copy link
Collaborator

tcompa commented Sep 18, 2024

Branching from #1769 (comment) with a more specific plan.

Database

Two-steps rollout (and update-db-data script)

The two-steps rollout is described in #1786. Running update-db-data for v2.6.0 should lead to a state which is fully usable, and where all relevant information has already been moved to user_settings.

  • Create a single settings row per existing user, and establish one-to-one relationship
  • Copy user attributes into user_settings (slurm_user, slurm_accounts, cache_dir)
  • Copy global variables into user_settings (SSH-related ones)

API

User API

  • User registration must also create an empty settings row
  • Remove legacy attributes from User Update/Read schemas

Settings API

  • Set up SettingsRead response schema, with a SettingReadStrict version which is visible to users
  • Add GET /auth/users/{user_id}/settings/ and /auth/current-user/settings/ (paths TBD), which returns the user's settings.
  • Add PATCH endpoints for /auth/users/{user_id}/settings/ (path TBD) and for /auth/current-user/settings/, with different request-body schemas. For the moment, the current-user SettingsUpdateStrict schema will be empty, while the superuser-only SettingsUpdate under /users includes all columns.
  • A note for the backend: it seems that the /auth/users/{user_id}/settings endpoint accepts empty strings in the SLURM accounts array: slurm_accounts: [""]

Task-collection and job-execution API

  • Establish validation schema for the required settings in a given context (e.g. SSH job execution)
  • Let's add slurm_accounts: list[str] to the required and validated settings, both for sudo and ssh slurm backends
  • Establish validation model for slurm-sudo backend
  • Perform validation in SSH task-collection endpoint
  • Perform validation in standard task-collection endpoint EDIT: not needed
  • Perform validation in V1 job submission endpoint (as for V2)
  • Perform validation in V2 job submission endpoint
  • Propagate the user settings to v1 job-execution background task
  • Propagate the user settings to v2 job-execution background task
  • Propagate the user settings to v2 standard task-collection background task
  • Propagate the user settings to v2 SSH task-collection background task
  • Replace all user.slurm_user with user.settings.slurm_user

Task-collection and job-execution subpackages

  • Use the new settings in the SSH task-collection background tasks
  • Use the new settings in the SSH job-execution background tasks
  • Use the new settings in the v1 slurm-sudo background tasks
  • Use the new settings in the v2 slurm-sudo background tasks
tcompa added a commit that referenced this issue Sep 18, 2024
@tcompa tcompa linked a pull request Sep 19, 2024 that will close this issue
7 tasks
This was referenced Sep 19, 2024
@tcompa tcompa pinned this issue Sep 19, 2024
@tcompa tcompa added the High Priority Current Priorities & Blocking Issues label Sep 19, 2024
@tcompa tcompa assigned tcompa and ychiucco and unassigned tcompa Sep 19, 2024
@tcompa
Copy link
Collaborator Author

tcompa commented Sep 19, 2024

New UserSettings columns: slurm_user, slurm_accounts, cache_dir

UserSettingsUpdateStrict is the same as current UserUpdateStrict, while UserSettingsUpdate may modify all columns.

For the moment, we do not modify the User API/schemas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
High Priority Current Priorities & Blocking Issues user_settings v2.6.0
Projects
Development

Successfully merging a pull request may close this issue.

2 participants