Skip to content
Snippets Groups Projects
Commit 60600f78 authored by Charlotte Hausman's avatar Charlotte Hausman
Browse files

fix htcondor job id setting

parent b0822517
No related branches found
No related tags found
3 merge requests!1605Merge 2.8.2.3 work to main,!1581catch up with 2.8.2.3,!1578Try fixing condor id issues
......@@ -157,7 +157,7 @@ def is_final_stage(body: str) -> bool:
:return: boolean for final stage
"""
dag_node = r"DAG Node: (?P<dagnode>[A-Z]{4,})"
dag_node = r"DAG Node: (?P<dagnode>[A-Z]{1,})"
dagnode = re.search(dag_node, body)
logger.info(f"current DAG stage: {dagnode.group('dagnode')}")
......@@ -321,10 +321,10 @@ class WorkflowMonitor:
# determine current DAG stage from event, if final, set exit condition for DAG
if self.is_dag and event["type"] == WorkflowStatusMessages.EXECUTING.value:
job_count += 1
is_final_node = is_final_stage(event["condor_metadata"]["log"])
# DAG is still running, change message to 'continue'
if not is_final_node:
event["type"] = WorkflowStatusMessages.CONTINUE.value
event["type"] = WorkflowStatusMessages.CONTINUE.value
# set is final node flag if necessary
is_final_node = is_final_stage(event["condor_metadata"]["log"])
send_message(event, self.message_router)
# Empty contents to prepare for next event
......
"""fix null dag logs
Revision ID: f49af22c5c0e
Revises: 008590dd66fd
Create Date: 2024-02-20 14:32:15.149922
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "f49af22c5c0e"
down_revision = "008590dd66fd"
branch_labels = None
depends_on = None
old_log = """log = null_dag.$(jobname).log"""
new_log = """log = condor.log"""
def upgrade():
op.execute(
f"""
UPDATE workflow_templates
SET content = replace(convert_from(content, 'utf8'),E'{old_log}', E'{new_log}' )::bytea
WHERE filename like 'null_dag_%.condor';
"""
)
def downgrade():
op.execute(
f"""
UPDATE workflow_templates
SET content = replace(convert_from(content, 'utf8'),E'{new_log}', E'{old_log}' )::bytea
WHERE filename like 'null_dag_%.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