Skip to content
Snippets Groups Projects
Commit bc0b7267 authored by Nathan Bockisch's avatar Nathan Bockisch
Browse files

Added script sketch for review

parent c7074643
No related branches found
No related tags found
1 merge request!1076WS-1013: Create the pims_split Workspaces workflow
"""add pimscache split workflow
Revision ID: e8e6d54d8444
Revises: 55e5b37d1ccf
Create Date: 2022-09-21 11:19:03.245980
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'e8e6d54d8444'
down_revision = '55e5b37d1ccf'
branch_labels = None
depends_on = None
# Main DAG for the workflow
pims_split_dag = """JOB RESTORE restore_cms_content.condor
VARS RESTORE jobname="$(JOB)"
{#phase_centers}
JOB {{center_name}} split.sub
VARS {{center_name}} phase_center={{phase_center}}
{/phase_centers}
JOB FINISH write_finished_file.condor
PARENT RESTORE CHILD SPLIT
PARENT SPLIT CHILD FINISH
"""
# DAG run on each split
split_dag = """JOB SPLITWF split_workflow.condor
PARENT SPLITWF
"""
restore_cms_content = """executable = restore_cms.sh
"""
split_workflow_condor = """split_workflow.sh
"""
split_workflow_sh = """#!/bin/sh
set -o errexit
# Something to link measurement set to rawdata directory
# CASA envoy call?
# Populate the cache area
"""
# Finish file creation
write_finished_file_condor = """write_finished_file.sh
output = write_finished.out
error = write_finished.err
log = condor.log
"""
write_finished_file_sh = """#!/bin/sh
set -o errexit
/bin/date > finished
"""
def upgrade():
op.execute(
"""
INSERT INTO workflows (workflow_name) VALUES ('pims_split')
"""
)
op.execute(
f"""
INSERT INTO workflow_templates (filename, content, workflow_name)
VALUES ('pims_split.dag', E'{pims_split_dag}', 'pims_split')
"""
)
pass
def downgrade():
pass
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