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

Workflow execute now works when run though vulture. wf_monitor reads the...

Workflow execute now works when run though vulture. wf_monitor reads the produced log messages correctly
parent cd87df87
No related branches found
No related tags found
No related merge requests found
......@@ -9,7 +9,7 @@ import argparse as ap
import json
from pathlib import Path
from workspaces.services import WorkflowService, WorkflowInfo
from workspaces.services import WorkflowService
def submit_request(ns: ap.Namespace):
......
......@@ -375,10 +375,10 @@ class Workflow(Base, WorkflowIF):
contents = template.content
if filename == "null.condor":
contents = (
"executable = null.sh\n"
f"arguments = {str(argument)}\n"
"executable = null\n"
f"arguments = {str(argument)[2:4]}\n" # TODO: fix templates
"error = null.err\n"
"log = condor.log\n"
"log = condor.log\n\n\n"
"queue".encode()
)
file = AbstractFile(filename, contents)
......
......@@ -3,6 +3,7 @@ Services defined by the Workspaces system, to be used by our APIs and client pro
"""
import shutil
import stat
import subprocess
from collections import namedtuple
from pathlib import Path
from queue import PriorityQueue, Queue, Empty
......@@ -469,15 +470,23 @@ class WorkflowService(WorkflowServiceIF):
dagman = list(folder.glob("*.dag"))[0]
print(f"dagman file {dagman} exists.")
# need .condor file for vulture submission
condor = list(folder.glob("*.condor"))[0]
print(f"condor file {condor} exists.")
# ensure the log file exists
logfile = folder / "condor.log"
print("condor.log exists.")
logfile.touch()
# submit
print("submitting to condor...")
# print("submitting to condor...")
# subprocess.run(["condor_submit_dag", str(dagman)], cwd=str(folder.absolute()))
# vulture is a workaround for testing locally without submitting to condor
print("submitting to vulture...")
subprocess.run(["vulture", 'job', 'execute', str(condor)], cwd=str(folder.absolute()))
# return the logfile
return logfile
......@@ -528,7 +537,8 @@ class WorkflowService(WorkflowServiceIF):
CapabilityRequest.update_status("COMPLETE")
# remove temp directory and rendered templates
shutil.rmtree(tmp_folder, ignore_errors=False, onerror=None)
# TODO: decide on lifetime of temp directory
# shutil.rmtree(tmp_folder, ignore_errors=False, onerror=None)
else:
# there is an event type of OTHER which we can basically
# ignore for now
......
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