-
Notifications
You must be signed in to change notification settings - Fork 27
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
🎨Computational backend: DV-2 computational scheduler becomes replicable (🗃️🚨) #6736
Merged
sanderegg
merged 127 commits into
ITISFoundation:master
from
sanderegg:computational-backend/release-scheduler-gil3
Dec 2, 2024
Merged
Changes from all commits
Commits
Show all changes
127 commits
Select commit
Hold shift + click to select a range
59c72e9
added last_scheduled datetime
sanderegg 1828bf5
ongoing new scheduler
sanderegg 2b12dcd
ongoing new scheduler
sanderegg 70c6573
ongoing new scheduler
sanderegg b1fb6c0
initial test
sanderegg 9250d06
initial test
sanderegg 0810978
initial test
sanderegg 94caa2a
added rabbit message exchange
sanderegg 655d514
skeleton for distributed scheduler
sanderegg 3654444
skeleton for distributed scheduler
sanderegg 4771071
checking rabbit mq
sanderegg adb6689
checking comp_runs table
sanderegg 081d7e1
checking comp_runs table
sanderegg dd5cce7
ongoing new scheduler tests
sanderegg 39a4633
ongoing new scheduler tests
sanderegg 01cf898
fixed tests
sanderegg dad78fb
100% tested
sanderegg acceed4
setup distributed scheduler
sanderegg a6ddc56
first connection manager/worker
sanderegg 353e180
updated syntax in tests
sanderegg dfbf38f
splitted code
sanderegg 8dc49d6
refactored
sanderegg fd50743
refactored
sanderegg 96a2424
cleanup
sanderegg 4dbfc09
almost there
sanderegg 1add067
ensure naming
sanderegg 083ca86
renaming
sanderegg 68cb686
rename method
sanderegg 864591e
moved method
sanderegg 5aac1ea
cleanup
sanderegg 10bbcb4
renaming
sanderegg 8d8cb66
renaming
sanderegg 1381706
ongoing
sanderegg c4b13ce
missing import
sanderegg 22c27b6
moved utils
sanderegg 8843b2e
moved iteartion to models
sanderegg d037813
moved iteartion to models
sanderegg fe64bf8
move test to context
sanderegg 63612b6
checking tests
sanderegg 01406fb
base test for worker init/shutdown
sanderegg 86df8bf
re-order
sanderegg f736f54
rename
sanderegg c37f1b5
put it back in working state
sanderegg 96402ce
cleaning
sanderegg 748cbb9
rename
sanderegg 1a5157e
refactor and fixes
sanderegg 2eacd17
refactoring before testing
sanderegg b3e7ac2
test if fixed
sanderegg 68f9f56
missing service dependencies
sanderegg 7e418b3
added basic test
sanderegg f9ff4e5
ensure we call shutdown on the worker as well
sanderegg 962b5da
the callback is run in a separate thread
sanderegg 6aba458
add documentation
sanderegg dac33f3
removed wake_up callback from api interface
sanderegg a6ee7c7
add no cover for abstract methods
sanderegg 7ab4dc0
revert
sanderegg 71e0079
use new style
sanderegg d7c49a0
use docstrings so that coverage is correctly computed
sanderegg 62f34c9
pyv2
sanderegg 7701430
unskip test
sanderegg 2fa420a
improve name
sanderegg a79df13
add docs
sanderegg a758376
merge
sanderegg 75b7983
add doc for next PR
sanderegg 328e518
add doc for next PR
sanderegg dec4b4b
ruff
sanderegg 34def37
fix after merge
sanderegg 819b71f
cleanup
sanderegg a4bca60
cleanup
sanderegg c0d749f
change signature
sanderegg dc2e7ce
changed syntax
sanderegg f36adc4
initial implementation
sanderegg d5dcf7f
maybe
sanderegg 3c964ad
maybe
sanderegg cb65ccb
refactor
sanderegg cc2a002
refactor
sanderegg 5ddab65
docs
sanderegg 57b770e
ruff
sanderegg 5a5b2db
some fine tuning for tests
sanderegg b45f33f
use the correct v2 method
sanderegg 1fcbf12
changed syntax
sanderegg 3281ffe
test the callback mechanism
sanderegg db50afb
test callback mechanism
sanderegg 4c80279
renaming
sanderegg c54337f
creation of parallel test
sanderegg 8df0116
renaming
sanderegg 1e78145
added rabbitmq queue purger
sanderegg b2596bb
cleanup
sanderegg efc46f1
test parallelism
sanderegg d90312e
added setting to control scheduling concurrency
sanderegg a45cfbe
ensure unsubscribe consumer is only unsubscribing the right consumer …
sanderegg 1c4ae48
fix test after renaming
sanderegg 986cd42
fixed after new syntax
sanderegg 7dc96af
ensure worker marks the scheduling as done
sanderegg 34fa851
manager checks for properly scheduled tasks and lost ones
sanderegg 7ed3b92
changed column names and add processed column
sanderegg 94c1ed2
createing tests for repository
sanderegg 47c4aff
moving to asyncengine
sanderegg c9b85af
moving to asyncengine
sanderegg 28cb4b9
use begin
sanderegg 2357932
repository almost tested
sanderegg 0963624
repository almost tested
sanderegg 743f82b
repository almost tested
sanderegg 11eede8
testing listing
sanderegg 4028fbb
testing listing with filter
sanderegg a9c7cf8
listing with processed since works
sanderegg 76b494a
handling of processed and scheduled
sanderegg f37a3b5
doc
sanderegg 1580044
convert comp_tasks timestamps to tz aware
sanderegg 7a586f4
convert timestamps to utc aware
sanderegg f4eecf9
ensure metadata are jsonable encoded
sanderegg f7898c2
refactor
sanderegg adb865b
linter
sanderegg 5c54a68
mypy
sanderegg 28d5b53
revert
sanderegg a642af1
mypy
sanderegg 3832cca
the lifespan manager cannot be used with the TestClient
sanderegg 9f1b748
added a silence_exceptions decorator
sanderegg 570bfd0
added test for silencing exceptions
sanderegg 33e7259
typo
sanderegg 11cb145
fix serialization using context
sanderegg dede26a
revert and fix
sanderegg 7f279c5
fix tests
sanderegg 3c93db2
@pcrespov review: remove match and use a mapping
sanderegg b7d1d2c
fixed typo
sanderegg 5604886
@pcrespov review: use more robust checks
sanderegg a0e3990
fixed syntax
sanderegg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
68 changes: 68 additions & 0 deletions
68
.../src/simcore_postgres_database/migration/versions/7ad64e963e0f_add_timezone_comp_tasks.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,68 @@ | ||
"""add_timezone_comp_tasks | ||
|
||
Revision ID: 7ad64e963e0f | ||
Revises: b7f23f6d8aa2 | ||
Create Date: 2024-11-27 22:28:51.898433+00:00 | ||
|
||
""" | ||
import sqlalchemy as sa | ||
from alembic import op | ||
from sqlalchemy.dialects import postgresql | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "7ad64e963e0f" | ||
down_revision = "b7f23f6d8aa2" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.alter_column( | ||
"comp_tasks", | ||
"submit", | ||
existing_type=postgresql.TIMESTAMP(), | ||
type_=sa.DateTime(timezone=True), | ||
existing_nullable=True, | ||
) | ||
op.alter_column( | ||
"comp_tasks", | ||
"start", | ||
existing_type=postgresql.TIMESTAMP(), | ||
type_=sa.DateTime(timezone=True), | ||
existing_nullable=True, | ||
) | ||
op.alter_column( | ||
"comp_tasks", | ||
"end", | ||
existing_type=postgresql.TIMESTAMP(), | ||
type_=sa.DateTime(timezone=True), | ||
existing_nullable=True, | ||
) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.alter_column( | ||
"comp_tasks", | ||
"end", | ||
existing_type=sa.DateTime(timezone=True), | ||
type_=postgresql.TIMESTAMP(), | ||
existing_nullable=True, | ||
) | ||
op.alter_column( | ||
"comp_tasks", | ||
"start", | ||
existing_type=sa.DateTime(timezone=True), | ||
type_=postgresql.TIMESTAMP(), | ||
existing_nullable=True, | ||
) | ||
op.alter_column( | ||
"comp_tasks", | ||
"submit", | ||
existing_type=sa.DateTime(timezone=True), | ||
type_=postgresql.TIMESTAMP(), | ||
existing_nullable=True, | ||
) | ||
# ### end Alembic commands ### |
33 changes: 33 additions & 0 deletions
33
...ore_postgres_database/migration/versions/b7f23f6d8aa2_added_distributed_comp_scheduler.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,33 @@ | ||
"""added_distributed_comp_scheduler | ||
|
||
Revision ID: b7f23f6d8aa2 | ||
Revises: c9db8bf5091e | ||
Create Date: 2024-11-26 17:06:27.053774+00:00 | ||
|
||
""" | ||
import sqlalchemy as sa | ||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "b7f23f6d8aa2" | ||
down_revision = "c9db8bf5091e" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.add_column( | ||
"comp_runs", sa.Column("scheduled", sa.DateTime(timezone=True), nullable=True) | ||
) | ||
op.add_column( | ||
"comp_runs", sa.Column("processed", sa.DateTime(timezone=True), nullable=True) | ||
) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_column("comp_runs", "processed") | ||
op.drop_column("comp_runs", "scheduled") | ||
# ### end Alembic commands ### |
87 changes: 87 additions & 0 deletions
87
...e/src/simcore_postgres_database/migration/versions/e05bdc5b3c7b_add_timezone_comp_runs.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,87 @@ | ||
"""add_timezone_comp_runs | ||
|
||
Revision ID: e05bdc5b3c7b | ||
Revises: 7ad64e963e0f | ||
Create Date: 2024-11-27 22:51:21.112336+00:00 | ||
|
||
""" | ||
|
||
import sqlalchemy as sa | ||
from alembic import op | ||
from sqlalchemy.dialects import postgresql | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "e05bdc5b3c7b" | ||
down_revision = "7ad64e963e0f" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.alter_column( | ||
"comp_runs", | ||
"created", | ||
existing_type=postgresql.TIMESTAMP(), | ||
type_=sa.DateTime(timezone=True), | ||
existing_nullable=False, | ||
existing_server_default="now()", | ||
) | ||
op.alter_column( | ||
"comp_runs", | ||
"modified", | ||
existing_type=postgresql.TIMESTAMP(), | ||
type_=sa.DateTime(timezone=True), | ||
existing_nullable=False, | ||
existing_server_default="now()", | ||
) | ||
op.alter_column( | ||
"comp_runs", | ||
"started", | ||
existing_type=postgresql.TIMESTAMP(), | ||
type_=sa.DateTime(timezone=True), | ||
existing_nullable=True, | ||
) | ||
op.alter_column( | ||
"comp_runs", | ||
"ended", | ||
existing_type=postgresql.TIMESTAMP(), | ||
type_=sa.DateTime(timezone=True), | ||
existing_nullable=True, | ||
) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.alter_column( | ||
"comp_runs", | ||
"ended", | ||
existing_type=sa.DateTime(timezone=True), | ||
type_=postgresql.TIMESTAMP(), | ||
existing_nullable=True, | ||
) | ||
op.alter_column( | ||
"comp_runs", | ||
"started", | ||
existing_type=sa.DateTime(timezone=True), | ||
type_=postgresql.TIMESTAMP(), | ||
existing_nullable=True, | ||
) | ||
op.alter_column( | ||
"comp_runs", | ||
"modified", | ||
existing_type=sa.DateTime(timezone=True), | ||
type_=postgresql.TIMESTAMP(), | ||
existing_nullable=False, | ||
existing_server_default="now()", | ||
) | ||
op.alter_column( | ||
"comp_runs", | ||
"created", | ||
existing_type=sa.DateTime(timezone=True), | ||
type_=postgresql.TIMESTAMP(), | ||
existing_nullable=False, | ||
existing_server_default="now()", | ||
) | ||
# ### end Alembic commands ### |
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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Q1: I thought the convention to follow in datetime columns is to use a verb in the past, i.e.
submitted
,started
etc? Actually, I am going to changetrashed_at
because in the API we use the_at
suffix but not in the database so i did this mistake. And because i havetrashed_by
to track the user as well.Are we getting here in an unnecessary camel-vs-snake case type of discussion? should we just use one and only one reasonable convention in both the api and database instead of so much unnecessary conversion overhead? :-) Which one you like? :-)
Q2: these are not nullable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These entries are older than you 🤣
I prefer not to add even more noise in this PR.