Skip to content

Commit

Permalink
feat: Workflow minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
aldbr committed Jan 25, 2024
1 parent 002b7c1 commit 4a8abab
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/DIRAC/Core/Workflow/Workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,7 @@ def createStepInstance(self, type_o, name):
raise KeyError("Can not find StepDefinition " + type + " to create StepInstrance " + name)

def removeStepInstance(self, name):
self.step_instances[name].setParent(None)
self.step_instances.delete(name)
self.step_instances = [step for step in self.step_instances if step.getName() != name]

def updateParents(self):
self.module_definitions.updateParents(self)
Expand Down
10 changes: 6 additions & 4 deletions src/DIRAC/WorkloadManagementSystem/Agent/PushJobAgent.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def __init__(self, agentName, loadName, baseAgentName=False, properties=None):
# Choose the submission policy
# - Workflow: the agent will submit a workflow to a PoolCE, the workflow is responsible for interacting with the remote site
# - JobWrapper: the agent will submit a JobWrapper directly to the remote site, it is responsible of the remote execution
self.submissionPolicy = "Workflow"
self.submissionPolicy = "Application"

# cleanTask is used to clean the task in the remote site
self.cleanTask = True
Expand All @@ -80,7 +80,7 @@ def initialize(self):
# Get the submission policy
# Initialized here because it cannot be dynamically modified during the execution
self.submissionPolicy = self.am_getOption("SubmissionPolicy", self.submissionPolicy)
if self.submissionPolicy not in ["Workflow", "JobWrapper"]:
if self.submissionPolicy not in ["Application", "JobWrapper"]:
return S_ERROR("SubmissionPolicy must be either Workflow or JobWrapper")

result = self._initializeComputingElement("Pool")
Expand Down Expand Up @@ -283,7 +283,7 @@ def execute(self):

# Submit the job to the CE
self.log.debug(f"Before self._submitJob() ({self.ceName}CE)")
if self.submissionPolicy == "Workflow":
if self.submissionPolicy == "Application":
resultSubmission = self._submitJob(
jobID=jobID,
jobParams=params,
Expand Down Expand Up @@ -412,9 +412,11 @@ def _setCEDict(self, ceDict):
ceDict["ReleaseProject"] = project

# Add a RemoteExecution entry, which can be used in the next stages
if self.submissionPolicy == "Workflow":
if self.submissionPolicy == "Application":
ceDict["RemoteExecution"] = True

ceDict["SubmissionPolicy"] = self.submissionPolicy

def _checkMatchingIssues(self, jobRequest):
"""Check the source of the matching issue
Expand Down

0 comments on commit 4a8abab

Please sign in to comment.