Skip to content
Snippets Groups Projects
Commit 5614d9a2 authored by Daniel Nemergut's avatar Daniel Nemergut Committed by Sam Kagan
Browse files

Added flags for processing in CV to the restore_cms templates

parent aafe7b74
No related branches found
No related tags found
No related merge requests found
# Copyright (C) 2023 Associated Universities, Inc. Washington DC, USA.
#
# This file is part of NRAO Workspaces.
#
# Workspaces is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Workspaces is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Workspaces. If not, see <https://www.gnu.org/licenses/>.
#
"""alma restores
Revision ID: 175c5c2accf8
Revises: 985ca1bdec62
Create Date: 2024-07-18 09:58:07.092540
"""
from pathlib import Path
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "175c5c2accf8"
down_revision = "985ca1bdec62"
branch_labels = None
depends_on = None
workflow = "restore_cms"
old_suffix = "_condor_2.8.4.txt"
new_suffix = "_condor_2.8.5.txt"
def set_content(filename: str) -> bytes:
return (Path.cwd() / "versions" / "templates" / workflow / filename).read_text().encode()
def upgrade():
conn = op.get_bind()
# Update the restore_cms condor templates to handle processing in CV
for task in ["fetch", "envoy", "deliver"]:
conn.execute(
f"""
UPDATE workflow_templates
SET content=%s
WHERE filename=E'{workflow}_{task}.condor' AND workflow_name=E'{workflow}'
""",
set_content(task + new_suffix),
)
def downgrade():
conn = op.get_bind()
for task in ["fetch", "envoy", "deliver"]:
conn.execute(
f"""
UPDATE workflow_templates
SET content=%s
WHERE filename=E'{workflow}_{task}.condor' AND workflow_name=E'{workflow}'
""",
set_content(task + old_suffix),
)
executable = restore_cms_deliver.sh
arguments = {{request_id}} {{spool_dir}}
output = deliver.out
error = deliver.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
executable = restore_cms_deliver.sh
arguments = {{request_id}} {{spool_dir}}
output = deliver.out
error = deliver.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}} LD_LIBRARY_PATH=/home/ssa/share/oracle/instantclient_21_1"
requirements = HasLustre == True && (CVPOST == True)
+partition = "CVPOST"
{{/remote-cv}}
queue
executable = restore_cms_envoy.sh
arguments = metadata.json PPR.xml
output = envoy.out
error = envoy.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}} LD_LIBRARY_PATH=/home/ssa/share/oracle/instantclient_21_1"
requirements = HasLustre == True && (CVPOST == True)
+partition = "CVPOST"
{{/remote-cv}}
queue
executable = restore_cms_fetch.sh
arguments = {{product_locator}} {{cal_locator}}
output = fetch.out
error = fetch.err
log = condor.log
should_transfer_files = NO
+WantIOProxy = True
getenv = True
environment = "CAPO_PATH=/home/casa/capo"
requirements = HasLustre == True
queue
executable = restore_cms_fetch.sh
arguments = {{product_locator}} {{cal_locator}}
output = fetch.out
error = fetch.err
log = condor.log
should_transfer_files = NO
+WantIOProxy = True
{{^remote-cv}}
getenv = True
environment = "CAPO_PATH=/home/casa/capo"
requirements = HasLustre == True
{{/remote-cv}}
{{#remote-cv}}
environment = "CAPO_PATH=. CAPO_PROFILE={{profile}} LD_LIBRARY_PATH=/home/ssa/share/oracle/instantclient_21_1"
requirements = HasLustre == True && (CVPOST == True)
+partition = "CVPOST"
{{/remote-cv}}
queue
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