From 87c0be3ea3c7c00faf4aac5d9c8d20690920b2f7 Mon Sep 17 00:00:00 2001 From: sanderegg <35365065+sanderegg@users.noreply.github.com> Date: Fri, 1 Nov 2024 16:55:15 +0100 Subject: [PATCH 1/3] reverted tools in dv-0 --- services/director/requirements/_tools.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/services/director/requirements/_tools.txt b/services/director/requirements/_tools.txt index 24945ba6807..38ed7220aed 100644 --- a/services/director/requirements/_tools.txt +++ b/services/director/requirements/_tools.txt @@ -30,8 +30,6 @@ pathspec==0.9.0 # via black pep517==0.12.0 # via pip-tools -pip==24.3.1 - # via pip-tools pip-tools==6.4.0 # via -r requirements/_tools.in pyyaml==5.4 From 7b83e63822b4a07f1034ae77d94e227b9598ccb7 Mon Sep 17 00:00:00 2001 From: sanderegg <35365065+sanderegg@users.noreply.github.com> Date: Fri, 1 Nov 2024 18:21:08 +0100 Subject: [PATCH 2/3] fixed target --- packages/postgres-database/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/postgres-database/Makefile b/packages/postgres-database/Makefile index 35f3024fa98..55836d33040 100644 --- a/packages/postgres-database/Makefile +++ b/packages/postgres-database/Makefile @@ -99,7 +99,7 @@ setup-commit: install-dev up-pg ## sets up a database to create a new commit int sleep 2 # discovering sc-pg --help - sc-pg discover -u test -p test -d test + sc-pg discover -u test -p test -d test --host localhost # upgrade sc-pg upgrade # some info From 75537068ef42956e99957a879cb5a2727f4eefe4 Mon Sep 17 00:00:00 2001 From: sanderegg <35365065+sanderegg@users.noreply.github.com> Date: Fri, 1 Nov 2024 18:25:35 +0100 Subject: [PATCH 3/3] added mark for cancellation in DB --- .../10097b74cf5a_added_cancellation_mark.py | 35 +++++++++++++++++++ .../models/comp_runs.py | 8 +++++ 2 files changed, 43 insertions(+) create mode 100644 packages/postgres-database/src/simcore_postgres_database/migration/versions/10097b74cf5a_added_cancellation_mark.py diff --git a/packages/postgres-database/src/simcore_postgres_database/migration/versions/10097b74cf5a_added_cancellation_mark.py b/packages/postgres-database/src/simcore_postgres_database/migration/versions/10097b74cf5a_added_cancellation_mark.py new file mode 100644 index 00000000000..0bebb1921be --- /dev/null +++ b/packages/postgres-database/src/simcore_postgres_database/migration/versions/10097b74cf5a_added_cancellation_mark.py @@ -0,0 +1,35 @@ +"""added_cancellation_mark + +Revision ID: 10097b74cf5a +Revises: fce5d231e16d +Create Date: 2024-11-01 17:24:21.002659+00:00 + +""" +import sqlalchemy as sa +from alembic import op + +# revision identifiers, used by Alembic. +revision = "10097b74cf5a" +down_revision = "fce5d231e16d" +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.add_column( + "comp_runs", + sa.Column( + "marked_for_cancellation", + sa.Boolean(), + server_default=sa.text("false"), + nullable=False, + ), + ) + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.drop_column("comp_runs", "marked_for_cancellation") + # ### end Alembic commands ### diff --git a/packages/postgres-database/src/simcore_postgres_database/models/comp_runs.py b/packages/postgres-database/src/simcore_postgres_database/models/comp_runs.py index e402a171562..724526709be 100644 --- a/packages/postgres-database/src/simcore_postgres_database/models/comp_runs.py +++ b/packages/postgres-database/src/simcore_postgres_database/models/comp_runs.py @@ -1,6 +1,7 @@ """ Computational Runs Table """ + import sqlalchemy as sa from sqlalchemy.dialects.postgresql import JSONB from sqlalchemy.sql import func @@ -106,5 +107,12 @@ nullable=False, doc="the run uses on demand clusters", ), + sa.Column( + "marked_for_cancellation", + sa.Boolean(), + server_default=sa.sql.expression.false(), + nullable=False, + doc="the run was marked for cancellation", + ), sa.UniqueConstraint("project_uuid", "user_id", "iteration"), )