Skip to content

user_settings

UserSettings

Bases: SQLModel

Comprehensive list of user settings.

Attributes:

Name Type Description
id Optional[int]

ID of database object

slurm_accounts list[str]

List of SLURM accounts, to be used upon Fractal job submission.

ssh_host Optional[str]

SSH-reachable host where a SLURM client is available.

ssh_username Optional[str]

User on ssh_host.

ssh_private_key_path Optional[str]

Path of private SSH key for ssh_username.

ssh_tasks_dir Optional[str]

Task-venvs base folder on ssh_host.

ssh_jobs_dir Optional[str]

Jobs base folder on ssh_host.

slurm_user Optional[str]

Local user, to be impersonated via sudo -u

project_dir Optional[str]

Folder where slurm_user can write.

Source code in fractal_server/app/models/user_settings.py
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
class UserSettings(SQLModel, table=True):
    """
    Comprehensive list of user settings.

    Attributes:
        id: ID of database object
        slurm_accounts:
            List of SLURM accounts, to be used upon Fractal job submission.
        ssh_host: SSH-reachable host where a SLURM client is available.
        ssh_username: User on `ssh_host`.
        ssh_private_key_path: Path of private SSH key for `ssh_username`.
        ssh_tasks_dir: Task-venvs base folder on `ssh_host`.
        ssh_jobs_dir: Jobs base folder on `ssh_host`.
        slurm_user: Local user, to be impersonated via `sudo -u`
        project_dir: Folder where `slurm_user` can write.
    """

    __tablename__ = "user_settings"

    id: Optional[int] = Field(default=None, primary_key=True)
    slurm_accounts: list[str] = Field(
        sa_column=Column(JSON, server_default="[]", nullable=False)
    )
    ssh_host: Optional[str] = None
    ssh_username: Optional[str] = None
    ssh_private_key_path: Optional[str] = None
    ssh_tasks_dir: Optional[str] = None
    ssh_jobs_dir: Optional[str] = None
    slurm_user: Optional[str] = None
    project_dir: Optional[str] = None