Skip to content

Commit

Permalink
replace 'gids' column with ('main_gid' and 'additional_gids')
Browse files Browse the repository at this point in the history
  • Loading branch information
fregataa committed Jan 3, 2025
1 parent 21419e9 commit b5affba
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@ def upgrade() -> None:
)
op.add_column(
"kernels",
sa.Column("gids", sa.ARRAY(sa.Integer()), server_default=sa.text("NULL"), nullable=True),
sa.Column("main_gid", sa.Integer(), server_default=sa.text("NULL"), nullable=True),
)
op.add_column(
"kernels",
sa.Column(
"additional_gids", sa.ARRAY(sa.Integer()), server_default=sa.text("NULL"), nullable=True
),
)
op.add_column(
"users",
Expand All @@ -31,13 +37,24 @@ def upgrade() -> None:
op.add_column(
"users",
sa.Column(
"container_gids", sa.ARRAY(sa.Integer()), server_default=sa.text("NULL"), nullable=True
"container_main_gid", sa.Integer(), server_default=sa.text("NULL"), nullable=True
),
)
op.add_column(
"users",
sa.Column(
"container_additional_gids",
sa.ARRAY(sa.Integer()),
server_default=sa.text("NULL"),
nullable=True,
),
)


def downgrade() -> None:
op.drop_column("users", "container_gids")
op.drop_column("users", "container_main_gid")
op.drop_column("users", "container_additional_gids")
op.drop_column("users", "container_uid")
op.drop_column("kernels", "gids")
op.drop_column("kernels", "additional_gids")
op.drop_column("kernels", "main_gid")
op.drop_column("kernels", "uid")
5 changes: 4 additions & 1 deletion src/ai/backend/manager/models/kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,10 @@ class KernelRow(Base):
"cluster_hostname", sa.String(length=64), nullable=False, default=default_hostname
)
uid = sa.Column("uid", sa.Integer, nullable=True, server_default=sa.null())
gids = sa.Column("gids", sa.ARRAY(sa.Integer), nullable=True, server_default=sa.null())
main_gid = sa.Column("main_gid", sa.Integer, nullable=True, server_default=sa.null())
additional_gids = sa.Column(
"additional_gids", sa.ARRAY(sa.Integer), nullable=True, server_default=sa.null()
)

# Resource ownership
scaling_group = sa.Column(
Expand Down
5 changes: 4 additions & 1 deletion src/ai/backend/manager/models/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,10 @@ class UserStatus(enum.StrEnum):
nullable=True, # keypairs.user is non-nullable
),
sa.Column("container_uid", sa.Integer, nullable=True, server_default=sa.null()),
sa.Column("container_gids", sa.ARRAY(sa.Integer), nullable=True, server_default=sa.null()),
sa.Column("container_main_gid", sa.Integer, nullable=True, server_default=sa.null()),
sa.Column(
"container_additional_gids", sa.ARRAY(sa.Integer), nullable=True, server_default=sa.null()
),
)


Expand Down

0 comments on commit b5affba

Please sign in to comment.