Skip to content
Snippets Groups Projects
Commit 1b3483a0 authored by Daniel Nemergut's avatar Daniel Nemergut
Browse files

Merge branch 'workflows_oracle_updoot' into '2.8.2.1-DEVELOMENT'

Added instantclient to the curator condor file for CV nodes

See merge request !1537
parents e18eb372 67f64b49
No related branches found
No related tags found
2 merge requests!1605Merge 2.8.2.3 work to main,!1537Added instantclient to the curator condor file for CV nodes
Pipeline #13018 passed
"""workflows oracle update
Revision ID: 49b7c8150e72
Revises: f2a76d224984
Create Date: 2023-11-22 14:26:55.355861
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '49b7c8150e72'
down_revision = 'f2a76d224984'
branch_labels = None
depends_on = None
# Add instantclient_21_1 to the path for CV nodes
old_curator_condor = """executable = curator.sh
arguments = metadata.json {{curator_type}}
output = curator.out
error = curator.err
log = condor.log
should_transfer_files = NO
+WantIOProxy = True
request_memory = {{ramInGb}}
getenv = True
environment = "CAPO_PATH=/home/casa/capo"
requirements = HasLustre == True
queue
"""
new_curator_condor = """executable = curator.sh
arguments = metadata.json {{curator_type}}
output = curator.out
error = curator.err
log = condor.log
should_transfer_files = NO
+WantIOProxy = True
request_memory = {{ramInGb}}
{{^remote-cv}}
getenv = True
environment = "CAPO_PATH=/home/casa/capo"
requirements = HasLustre == True
{{/remote-cv}}
{{#remote-cv}}
environment = "CAPO_PATH=. CAPO_PROFILE={{profile}} ORACLE_HOME=/home/ssa/share/oracle/instantclient_21_1 LD_LIBRARY_PATH=/home/ssa/share/oracle/instantclient_21_1 PATH=/bin:/usr/bin:$(PATH)/home/ssa/share/oracle/instantclient_21_1"
requirements = HasLustre == True && (CVPOST == True)
+partition = "CVPOST"
{{/remote-cv}}
queue
"""
def upgrade():
op.execute(
f"""
UPDATE workflow_templates
SET content=E'{new_curator_condor}'
WHERE filename='curator.condor'
"""
)
# Use instantclient_21_1 in the other templates
op.execute(
f"""
UPDATE workflow_templates
SET content= regexp_replace(convert_from(content, 'utf-8'), E'instantclient_12_1', E'instantclient_21_1', 'g')::bytea
WHERE filename='download.condor' OR filename='ingest_cal.condor'
"""
)
def downgrade():
op.execute(
f"""
UPDATE workflow_templates
SET content=E'{old_curator_condor}'
WHERE filename='curator.condor'
"""
)
op.execute(
f"""
UPDATE workflow_templates
SET content= regexp_replace(convert_from(content, 'utf-8'), E'instantclient_21_1', E'instantclient_12_1', 'g')::bytea
WHERE filename='download.condor' OR filename='ingest_cal.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