修改:hpc执行流程查询文件目录优化

This commit is contained in:
yangyang01000846
2025-12-05 10:37:35 +08:00
parent f7077ef106
commit fd43685c8a

View File

@@ -52,12 +52,21 @@ public class HpcHandler implements ExecutionHandler<Map<String, Object>,HPCExecu
* */
@Override
public void execute(DelegateExecution execution, Map<String, Object> params, HPCExecuteConfig config) {
CoreLogger.info("hpc process excite,params:{},config:{}",JSONObject.toJSONString(params),JSONObject.toJSONString(config));
CoreLogger.info("hpc process excute,params:{},config:{}",JSONObject.toJSONString(params),JSONObject.toJSONString(config));
SubmitHpcTaskRemoteReq submitHpcTaskRemoteReq = convertParamsToReq(params);
String beforeNodeId = config.getBeforeNodeId();
String masterFileRegularStr = config.getMasterFileRegularStr();
String inputFilesRegularStr = config.getInputFilesRegularStr();
dealHpcFile(submitHpcTaskRemoteReq,beforeNodeId,masterFileRegularStr,inputFilesRegularStr);
// params 取只是测试使用
String processDefinitionId = (execution==null||StringUtils.isBlank(execution.getProcessDefinitionId()))?
params.get("processDefinitionId").toString():execution.getProcessDefinitionId();
// params 取只是测试使用
String processInstanceId = (execution==null||StringUtils.isBlank(execution.getProcessInstanceId()))?
params.get("processInstanceId").toString():execution.getProcessInstanceId();
// hpc文件处理
dealHpcFile(submitHpcTaskRemoteReq,beforeNodeId,masterFileRegularStr,inputFilesRegularStr,
processDefinitionId,processInstanceId);
// 实现HPC处理逻辑...
// INIT(初始化)/RUNNING(执行中)/SUCCESS(执行成功)/FAIL(执行失败)
@@ -83,11 +92,14 @@ public class HpcHandler implements ExecutionHandler<Map<String, Object>,HPCExecu
log.info("HPC 任务 {} 已提交", "hpcTaskId");
}
private void dealHpcFile(SubmitHpcTaskRemoteReq submitHpcTaskRemoteReq, String beforeNodeId,
String masterFileRegularStr, String inputFilesRegularStr) {
private void dealHpcFile(SubmitHpcTaskRemoteReq submitHpcTaskRemoteReq, String beforeNodeId, String masterFileRegularStr,
String inputFilesRegularStr,String processDefinitionId,String processInstanceId) {
// 查询前节点的工作目录---》本地磁盘对应目录
ProcessNodeParam processNodeParam = processNodeParamService.lambdaQuery().
eq(ProcessNodeParam::getNodeId, beforeNodeId).one();
eq(ProcessNodeParam::getNodeId, beforeNodeId).
eq(ProcessNodeParam::getProcessDefinitionId,processDefinitionId).
eq(ProcessNodeParam::getProcessInstanceId,processInstanceId).
one();
String paramJson = processNodeParam.getParamJson();
JSONObject paramJsonObject = JSONObject.parseObject(paramJson);
// outputDirId
@@ -161,8 +173,10 @@ public class HpcHandler implements ExecutionHandler<Map<String, Object>,HPCExecu
req.setTaskName(params.get("taskName").toString());
req.setRunId(params.get("runId").toString());
req.setRunName(params.get("runName").toString());
// mock 时暂时自己传递,后面根据软件名称查询命令
req.setCommand(params.get("command").toString());
// mock 时暂时自己传递,后面根据软件名称查询命令 todo 后面从表配置查询
String command =(params.get("command")==null||StringUtils.isBlank(params.get("command").toString()))?
"\\\\CARSAFE\\share\\solver\\RLithium\\reta.exe -i %s" : params.get("command").toString();
req.setCommand(command);
req.setProjectname(params.get("projectname").toString());
// req.setFeatchFileType(params.get("featchFileType").toString());
// req.setBeforeNodeId(params.get("beforeNodeId").toString());