-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Creates ConcurrencyOptions
pydantic model.
#15291
Merged
jeanluciano
merged 29 commits into
main
from
jean/oss-66-create-a-concurrency-options-pydantic-model
Sep 17, 2024
Merged
Changes from 24 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
346bdfb
creates pydantic model and updates deployment orm model
jeanluciano 594e6b2
formatting
jeanluciano fad0161
moved Options schema
jeanluciano e12243a
postgress migration location change
jeanluciano 20fda19
import fix
jeanluciano 1de6209
seperates and limit
jeanluciano 32ff726
updates migration notes
jeanluciano d8f98c3
Merge branch 'main' into jean/oss-66-create-a-concurrency-options-pyd…
jeanluciano 5183872
Add an explicit, client-side GCL upsert for deployment concurrency li…
collincchoy 837d5d5
Fix deployment concurrency limits > 1 never correctly acquire concurr…
collincchoy 9f45162
Fix deployment concurrency limits > 1 never correctly acquire slots f…
collincchoy 0a4940f
Change deployment-concurrency related GCL naming pattern to be more c…
collincchoy 771100a
Revert "Change deployment-concurrency related GCL naming pattern to b…
collincchoy cd2c759
Tweak tests to cover correct # of slots being acquired and include ma…
collincchoy 9eb04e0
Merge branch 'main' into deployment-concurrency/concurrency-limit-mgmt
collincchoy d2aeeb0
Reduce network calls when concurrency limit is reached and better han…
collincchoy 1d01d87
Merge branch 'jean/oss-66-create-a-concurrency-options-pydantic-model…
jeanluciano 1ef7d67
seperates pydantic from db concurrency options schema
jeanluciano 43421d9
Merge branch 'main' into jean/oss-66-create-a-concurrency-options-pyd…
jeanluciano 066b655
updated shcema in model
jeanluciano 2af6789
Merge branch 'jean/oss-66-create-a-concurrency-options-pydantic-model…
jeanluciano d8a74d1
Merge branch 'main' into jean/oss-66-create-a-concurrency-options-pyd…
jeanluciano 9d4fa72
updated schema
jeanluciano 8641a1f
Merge branch 'main' into jean/oss-66-create-a-concurrency-options-pyd…
jeanluciano b7feac6
split concurrency options and limit fields
jeanluciano 0b33418
Merge branch 'jean/oss-66-create-a-concurrency-options-pydantic-model…
jeanluciano e0db3a8
Merge branch 'main' into jean/oss-66-create-a-concurrency-options-pyd…
jeanluciano 13e72f1
removed ConcurrencyLimitConfig
jeanluciano abfcf23
Merge branch 'jean/oss-66-create-a-concurrency-options-pydantic-model…
jeanluciano 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
33 changes: 33 additions & 0 deletions
33
.../migrations/versions/postgresql/2024_09_11_090317_555ed31b284d_add_concurrency_options.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 @@ | ||
"""add concurrency options | ||
|
||
Revision ID: 555ed31b284d | ||
Revises: 97429116795e | ||
Create Date: 2024-09-11 09:03:17.744587 | ||
|
||
""" | ||
import sqlalchemy as sa | ||
from alembic import op | ||
|
||
import prefect | ||
from prefect.server.schemas.core import ConcurrencyOptions | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "555ed31b284d" | ||
down_revision = "97429116795e" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
op.add_column( | ||
"deployment", | ||
sa.Column( | ||
"concurrency_options", | ||
prefect.server.utilities.database.Pydantic(ConcurrencyOptions), | ||
nullable=True, | ||
), | ||
) | ||
|
||
|
||
def downgrade(): | ||
op.drop_column("deployment", "concurrency_options") |
34 changes: 34 additions & 0 deletions
34
...base/migrations/versions/sqlite/2024_09_11_090106_7d6350aea855_add_concurrency_options.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,34 @@ | ||
"""add concurrency options | ||
|
||
Revision ID: 7d6350aea855 | ||
Revises: f93e1439f022 | ||
Create Date: 2024-09-11 09:01:06.678866 | ||
|
||
""" | ||
import sqlalchemy as sa | ||
from alembic import op | ||
|
||
import prefect | ||
from prefect.server.schemas.core import ConcurrencyOptions | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "7d6350aea855" | ||
down_revision = "f93e1439f022" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
with op.batch_alter_table("deployment", schema=None) as batch_op: | ||
batch_op.add_column( | ||
sa.Column( | ||
"concurrency_options", | ||
prefect.server.utilities.database.Pydantic(ConcurrencyOptions), | ||
nullable=True, | ||
) | ||
) | ||
|
||
|
||
def downgrade(): | ||
with op.batch_alter_table("deployment", schema=None) as batch_op: | ||
batch_op.drop_column("concurrency_options") |
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
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
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.
did this server default get added w/o a db migration?
or well - why did this get added?
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.
Oh. TIL alembic doesn't pick up server_default changes by default so I guess this doesn't matter but I think this line isn't doing anything as the DDL has already been generated and the updated DDL to alter the column w/ a db-server-side default isn't tracked via migrations.