Skip to content
Snippets Groups Projects
Commit 92cd4593 authored by Andrew Kapuscinski's avatar Andrew Kapuscinski
Browse files

added schema revision to add needsLustre requirement for workflow templates...

added schema revision to add needsLustre requirement for workflow templates running on prod condor cluster
parent 60f609b3
No related branches found
No related tags found
1 merge request!416WS-602: adding needs lustre to wf templates
Pipeline #2499 passed
"""add needsLustre to lustre-needing workflows
Revision ID: 77b4647443bd
Revises: 1d653467ede6
Create Date: 2021-08-11 23:02:07.327306
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '77b4647443bd'
down_revision = '1d653467ede6'
branch_labels = None
depends_on = None
lustre_needing_workflows = [
"test_download",
"std_calibration",
"std_cms_imaging",
"ingest_image",
"ingest_cal",
"restore_cms",
"std_restore_imaging"
]
def upgrade():
for wf in lustre_needing_workflows:
op.execute(f"UPDATE workflow_templates SET content = regexp_replace(convert_from(content, 'utf-8'), E'queue', E'requirements = HasLustre == True\n\nqueue')::bytea WHERE filename = '{wf}.condor'")
def downgrade():
for wf in lustre_needing_workflows:
op.execute(f"UPDATE workflow_templates SET content = regexp_replace(convert_from(content, 'utf-8'), E'requirements = HasLustre == True\n\nqueue', E'queue')::bytea WHERE filename = '{wf}.condor'")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment