-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
KVS storage for bringing automatic re-execution daemon to OSS. Will be a bit odd- we need to stick this in run storage in oss, while have it in cloud storage in cloud. Couple ways to handle that, I think we can just make the kvs methods on cloud run storage error
- Loading branch information
Showing
5 changed files
with
135 additions
and
0 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
python_modules/dagster/dagster/core/storage/alembic/versions/031_add_kvs_table.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,43 @@ | ||
"""add kvs table | ||
Revision ID: 5e139331e376 | ||
Revises: 6860f830e40c | ||
Create Date: 2022-06-06 15:48:51.559562 | ||
""" | ||
import sqlalchemy as db | ||
from alembic import op | ||
|
||
from dagster.core.storage.migration.utils import has_column, has_index, has_table | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "5e139331e376" | ||
down_revision = "6860f830e40c" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
if not has_table("kvs"): | ||
op.create_table( | ||
"kvs", | ||
db.Column("key", db.Text, nullable=False), | ||
db.Column("value", db.Text), | ||
) | ||
|
||
if not has_index("kvs", "idx_kvs_keys_unique"): | ||
op.create_index( | ||
"idx_kvs_keys_unique", | ||
"kvs", | ||
["key"], | ||
unique=True, | ||
mysql_length={"key": 64}, | ||
) | ||
|
||
|
||
def downgrade(): | ||
if has_index("kvs", "idx_kvs_keys_unique"): | ||
op.drop_index("idx_kvs_keys_unique") | ||
|
||
if has_table("kvs"): | ||
op.drop_table("kvs") |
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