Skip to content
Permalink
Browse files
Making workflow manage base work dir configurable
  • Loading branch information
DImuthuUpe committed Mar 3, 2022
1 parent 5f06ba9 commit 03ae002e3b82a8deb39d9e49752545bf6ff83481
Showing 2 changed files with 12 additions and 3 deletions.
@@ -132,4 +132,5 @@ workflow_manager_mft_client_secret: "{{ vault_workflow_manager_mft_client_secret
workflow_manager_custos_host: services.usecustos.org
workflow_manager_custos_port: 31161
workflow_manager_custos_id: "{{ vault_workflow_manager_custos_id }}"
workflow_manager_custos_secret: "{{ vault_workflow_manager_custos_secret }}"
workflow_manager_custos_secret: "{{ vault_workflow_manager_custos_secret }}"
workflow_manager_work_dir: /home/airavata/tmp_data
@@ -82,6 +82,9 @@ public class DataParsingWorkflowManager {
@org.springframework.beans.factory.annotation.Value("${mft.clientSecret}")
private String mftClientSecret;

@org.springframework.beans.factory.annotation.Value("${base.work.dir}")
private String baseWorkingDir;


@Autowired
private CallbackWorkflowStore callbackWorkflowStore;
@@ -91,6 +94,11 @@ public class DataParsingWorkflowManager {
public void init() throws Exception {
workflowOperator = new WorkflowOperator();
workflowOperator.init(clusterName, workflowManagerName, zkAddress, callbackWorkflowStore);

if (! baseWorkingDir.endsWith(File.separator)) {
baseWorkingDir = baseWorkingDir + File.separator;
}

logger.info("Successfully initialized Data Parsing Workflow Manager");
}

@@ -123,7 +131,7 @@ public void submitDataParsingWorkflow(WorkflowInvocationRequest request) throws

ParsingJobListResponse parsingJobs = parserClient.listParsingJobs(ParsingJobListRequest.newBuilder().build());

String tempDownloadPath = "/tmp/" + UUID.randomUUID().toString();
String tempDownloadPath = baseWorkingDir + UUID.randomUUID().toString();

Map<String, StringMap> parserInputMappings = new HashMap<>();
List<DataParsingJob> selectedPJs = parsingJobs.getParsersList().stream().filter(pj -> {
@@ -178,7 +186,7 @@ public void submitDataParsingWorkflow(WorkflowInvocationRequest request) throws

for(String parserId: parserInputMappings.keySet()) {

String parserWorkingDir = "/tmp/" + UUID.randomUUID();
String parserWorkingDir = baseWorkingDir + UUID.randomUUID();

GenericDataParsingTask dataParsingTask = new GenericDataParsingTask();
dataParsingTask.setTaskId("DPT-" + UUID.randomUUID().toString());

0 comments on commit 03ae002

Please sign in to comment.