-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added router tests for pools * Handle unexpected exceptions * Added tests for process_pool.py. Improve termination handling
- Loading branch information
Sergey Mezentsev
authored
Feb 21, 2024
1 parent
5e62c44
commit 718eeff
Showing
9 changed files
with
974 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
src/dstack/_internal/server/migrations/versions/1a48dfe44a40_rework_termination_handling.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
"""Rework termination handling | ||
Revision ID: 1a48dfe44a40 | ||
Revises: 9eea6af28e10 | ||
Create Date: 2024-02-21 10:11:32.350099 | ||
""" | ||
import sqlalchemy as sa | ||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "1a48dfe44a40" | ||
down_revision = "9eea6af28e10" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade() -> None: | ||
with op.batch_alter_table("instances", schema=None) as batch_op: | ||
batch_op.drop_column("fail_reason") | ||
batch_op.drop_column("fail_count") | ||
|
||
with op.batch_alter_table("instances", schema=None) as batch_op: | ||
batch_op.add_column(sa.Column("termination_deadline", sa.DateTime(), nullable=True)) | ||
batch_op.add_column( | ||
sa.Column("termination_reason", sa.VARCHAR(length=4000), nullable=True) | ||
) | ||
batch_op.add_column(sa.Column("health_status", sa.VARCHAR(length=4000), nullable=True)) | ||
|
||
|
||
def downgrade() -> None: | ||
with op.batch_alter_table("instances", schema=None) as batch_op: | ||
batch_op.add_column( | ||
sa.Column("fail_count", sa.Integer(), server_default=sa.text("0"), nullable=False) | ||
) | ||
batch_op.add_column(sa.Column("fail_reason", sa.String(length=4000), nullable=True)) | ||
|
||
with op.batch_alter_table("instances", schema=None) as batch_op: | ||
batch_op.drop_column("termination_deadline") | ||
batch_op.drop_column("termination_reason") | ||
batch_op.drop_column("health_status") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.