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

Deprecate user settings variables outside of UserSettings #1804

Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/migrations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ env:
# with the SOURCE_VERSION of fractal-server.
# Here we test the script that upgrades the DB from SOURCE_VERSION to the
#current version.
SOURCE_VERSION: 2.4.0
SOURCE_VERSION: 2.6.0
ROOTDIR: tests/data/testing_databases

jobs:
Expand Down
3 changes: 2 additions & 1 deletion docs/internals/runners/slurm.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ export LIBRARY_2_FILE=/my/cache/somewhere/else/library_2.json
```
Note that all paths in the values of `user_local_exports` are interpreted as
relative to a base directory which is user-specific (for instance `/my/cache/`,
in the example above), and which is defined in the `User.cache_dir` attribute.
in the example above), and which is defined in the `User.settings.cache_dir`
attribute.
Also note that in this case `fractal-server` only compiles the configuration
options into lines of the SLURM submission script, without performing any check
on the validity of the given paths.
Expand Down
6 changes: 0 additions & 6 deletions fractal_server/app/models/security.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
from pydantic import EmailStr
from sqlalchemy import Column
from sqlalchemy.types import DateTime
from sqlalchemy.types import JSON
from sqlmodel import Field
from sqlmodel import Relationship
from sqlmodel import SQLModel
Expand Down Expand Up @@ -93,11 +92,6 @@ class UserOAuth(SQLModel, table=True):
is_superuser: bool = Field(False, nullable=False)
is_verified: bool = Field(False, nullable=False)

slurm_user: Optional[str]
slurm_accounts: list[str] = Field(
sa_column=Column(JSON, server_default="[]", nullable=False)
)
cache_dir: Optional[str]
username: Optional[str]

oauth_accounts: list["OAuthAccount"] = Relationship(
Expand Down
19 changes: 0 additions & 19 deletions fractal_server/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,25 +512,6 @@ def check_tasks_python(cls, values) -> None:
`JobExecutionError`.
"""

FRACTAL_SLURM_SSH_HOST: Optional[str] = None
"""
SSH-reachable host where a SLURM client is available.
"""
FRACTAL_SLURM_SSH_USER: Optional[str] = None
"""
User on `FRACTAL_SLURM_SSH_HOST`.
"""
FRACTAL_SLURM_SSH_PRIVATE_KEY_PATH: Optional[str] = None
"""
Private key for connecting to `FRACTAL_SLURM_SSH_HOST` as
`FRACTAL_SLURM_SSH_USER`.
"""
# FIXME SSH: Split this into two folders (for tasks and for jobs)
FRACTAL_SLURM_SSH_WORKING_BASE_DIR: Optional[str] = None
"""
Remote folder on `FRACTAL_SLURM_SSH_HOST`.
"""

FRACTAL_API_SUBMIT_RATE_LIMIT: int = 2
"""
Interval to wait (in seconds) to be allowed to call again
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
"""remove cache_dir slurm_user and slurm_accounts from user

Revision ID: 94a47ea2d3ff
Revises: 9c5ae74c9b98
Create Date: 2024-09-25 09:33:18.014831

"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision = "94a47ea2d3ff"
down_revision = "9c5ae74c9b98"
branch_labels = None
depends_on = None


def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table("user_oauth", schema=None) as batch_op:
batch_op.drop_column("slurm_user")
batch_op.drop_column("slurm_accounts")
batch_op.drop_column("cache_dir")

# ### end Alembic commands ###


def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table("user_oauth", schema=None) as batch_op:
batch_op.add_column(
sa.Column(
"cache_dir", sa.VARCHAR(), autoincrement=False, nullable=True
)
)
batch_op.add_column(
sa.Column(
"slurm_accounts",
postgresql.JSON(astext_type=sa.Text()),
server_default=sa.text("'[]'::json"),
autoincrement=False,
nullable=False,
)
)
batch_op.add_column(
sa.Column(
"slurm_user", sa.VARCHAR(), autoincrement=False, nullable=True
)
)

# ### end Alembic commands ###
Loading
Loading