|
@@ -181,7 +181,7 @@ public class AlgorithmSubtaskServiceImpl extends BaseServiceImpl<AlgorithmSubtas
|
|
|
// // 算法调用
|
|
|
// } else if ("3".equals(firstNeedProcessSubtask.getType())) {
|
|
|
// error branch
|
|
|
- List<AlgorithmBizProcessVo> bizProcessVoList = bizProcessService.getProcessBySubtaskId(firstNeedProcessSubtask.getId());
|
|
|
+ List<AlgorithmBizProcessVo> bizProcessVoList = bizProcessService.getStatus0ProcessBySubtaskId(firstNeedProcessSubtask.getId());
|
|
|
bizProcess(bizProcessVoList);
|
|
|
// } else {
|
|
|
// log.warn("type is wrong, type: {}", firstNeedProcessSubtask.getType());
|
|
@@ -229,7 +229,7 @@ public class AlgorithmSubtaskServiceImpl extends BaseServiceImpl<AlgorithmSubtas
|
|
|
algorithmRequestDto.setBizId(bizProcessVo.getId());
|
|
|
algorithmRequestDto.setSourcePath(BizConstant.DOCKER_BASE_PATH + preprocessPath);
|
|
|
algorithmRequestDto.setResultPath(BizConstant.DOCKER_BASE_PATH + resultPath);
|
|
|
- algorithmRequestDto.setLogPath(bizProcessVo.getLog());
|
|
|
+ algorithmRequestDto.setLogPath(BizConstant.DOCKER_BASE_PATH + bizProcessVo.getLog());
|
|
|
Gson gson = new Gson();
|
|
|
Type listType = new TypeToken<List<AlgorithmConfigParamDto>>() {}.getType();
|
|
|
if (StringUtils.isNotEmpty(parameters)) {
|
|
@@ -238,14 +238,14 @@ public class AlgorithmSubtaskServiceImpl extends BaseServiceImpl<AlgorithmSubtas
|
|
|
if (model == null) {
|
|
|
log.error("模型配置未找到!!!modelId:{}", modelId);
|
|
|
errorMsg.add("模型配置未找到!!!");
|
|
|
- } else {
|
|
|
- SysOssVo modelOss = ossService.getById(Long.valueOf(model.getModelAddress()));
|
|
|
- otherParams.put("pretrained_model", BizConstant.DOCKER_BASE_PATH + StringUtils.substringAfter(modelOss.getFileName(), Constants.RESOURCE_PREFIX));
|
|
|
// 找到训练的模型地址
|
|
|
String trainModelPath = mapper.getTrainModelPath(bizProcessVo.getId());
|
|
|
if (StringUtils.isNotEmpty(trainModelPath)){
|
|
|
otherParams.put("weight_path", BizConstant.DOCKER_BASE_PATH + trainModelPath + BizConstant.DOCKER_PT_PATH);
|
|
|
}
|
|
|
+ } else {
|
|
|
+ SysOssVo modelOss = ossService.getById(Long.valueOf(model.getModelAddress()));
|
|
|
+ otherParams.put("pretrained_model", BizConstant.DOCKER_BASE_PATH + StringUtils.substringAfter(modelOss.getFileName(), Constants.RESOURCE_PREFIX));
|
|
|
}
|
|
|
for (AlgorithmConfigParamDto algorithmConfigParamDto : paramDtoList) {
|
|
|
String value = StringUtils.isNotEmpty(algorithmConfigParamDto.getValue()) ? algorithmConfigParamDto.getValue() : algorithmConfigParamDto.getDefaultValue();
|
|
@@ -258,17 +258,17 @@ public class AlgorithmSubtaskServiceImpl extends BaseServiceImpl<AlgorithmSubtas
|
|
|
algorithmRequestDto.setOtherParams(otherParams);
|
|
|
}
|
|
|
String httpResult = null;
|
|
|
+ Mono<String> response = null;
|
|
|
if (StringUtils.isEmpty(url)) {
|
|
|
errorMsg.add("url是空!!!");
|
|
|
} else {
|
|
|
log.info("http post url:{},body:{}", url,algorithmRequestDto);
|
|
|
WebClient webClient = webClientBuilder.build();
|
|
|
- Mono<String> response = webClient.post()
|
|
|
+ response = webClient.post()
|
|
|
.uri(url)
|
|
|
.bodyValue(algorithmRequestDto)
|
|
|
.retrieve()
|
|
|
.bodyToMono(String.class);
|
|
|
- httpResult = response.block();
|
|
|
}
|
|
|
// process httpResult
|
|
|
log.info("httpResult:{}", httpResult);
|
|
@@ -276,12 +276,16 @@ public class AlgorithmSubtaskServiceImpl extends BaseServiceImpl<AlgorithmSubtas
|
|
|
AlgorithmBizProcess algorithmBizProcess = MapstructUtils.convert(bizProcessVo, AlgorithmBizProcess.class);
|
|
|
if (errorMsg.length() != 0) {
|
|
|
algorithmBizProcess.setStatus(BizConstant.TASK_STATUS_FAILED);
|
|
|
- algorithmBizProcess.setLog(errorMsg.toString());
|
|
|
+ algorithmBizProcess.setRemarks(errorMsg.toString());
|
|
|
} else {
|
|
|
algorithmBizProcess.setStatus(BizConstant.TASK_STATUS_PROCESSING);
|
|
|
algorithmBizProcess.setStartTime(new Date());
|
|
|
}
|
|
|
bizProcessService.updateById(algorithmBizProcess);
|
|
|
+ if (response != null) {
|
|
|
+ httpResult = response.block();
|
|
|
+ log.info("bizProcess id: {} http response {}", bizProcessVo.getId(), httpResult);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|