|
@@ -3,6 +3,7 @@ package com.css.simulation.resource.scheduler.service;
|
|
|
import api.common.pojo.constants.DictConstants;
|
|
|
import api.common.pojo.dto.ProjectMessageDTO;
|
|
|
import api.common.util.*;
|
|
|
+import com.css.simulation.resource.scheduler.configuration.docker.DockerConfiguration;
|
|
|
import com.css.simulation.resource.scheduler.mapper.*;
|
|
|
import com.css.simulation.resource.scheduler.pojo.po.*;
|
|
|
import com.css.simulation.resource.scheduler.pojo.to.*;
|
|
@@ -95,6 +96,8 @@ public class ProjectService {
|
|
|
ApiClient apiClient;
|
|
|
@Resource
|
|
|
ProjectUtil projectUtil;
|
|
|
+ @Resource
|
|
|
+ DockerConfiguration dockerConfiguration;
|
|
|
|
|
|
|
|
|
// -------------------------------- Comment --------------------------------
|
|
@@ -335,12 +338,12 @@ public class ProjectService {
|
|
|
public String handleAlgorithm(String projectId, String algorithmId) {
|
|
|
//4-1 根据算法 id 获取算法文件地址、是否已导入成镜像。
|
|
|
AlgorithmPO algorithmPO = algorithmMapper.selectById(algorithmId);
|
|
|
- String dockerImage;
|
|
|
+ String dockerImage = dockerConfiguration.getRegistry() + "/";
|
|
|
String algorithmTarLinuxTempPath;
|
|
|
if (algorithmPO != null) { // 使用仿真平台自己的算法
|
|
|
String algorithmCode = algorithmPO.getAlgorithmCode();
|
|
|
String dockerImport = algorithmPO.getDockerImport();
|
|
|
- dockerImage = "algorithm_" + algorithmCode + ":latest";
|
|
|
+ dockerImage += "algorithm_" + algorithmCode + ":latest";
|
|
|
algorithmTarLinuxTempPath = linuxTempPath + "algorithm/" + algorithmCode + ".tar";
|
|
|
if ("1".equals(dockerImport) && StringUtil.isNotEmpty(dockerImport)) { // 已经导入同时存在镜像名称
|
|
|
dockerImage = algorithmPO.getDockerImage();
|
|
@@ -369,7 +372,7 @@ public class ProjectService {
|
|
|
log.info("ProjectService--handleAlgorithm 项目" + projectId + "需要从索为平台下载算法 " + algorithmId);
|
|
|
algorithmTarLinuxTempPath = linuxTempPath + "algorithm/" + algorithmId + ".tar";
|
|
|
String dockerImageWithoutVersion = "algorithm_" + algorithmId;
|
|
|
- dockerImage = dockerImageWithoutVersion + ":latest";
|
|
|
+ dockerImage += dockerImageWithoutVersion + ":latest";
|
|
|
//0 查看算法是否已经导入
|
|
|
if (!projectUtil.isImported(dockerImageWithoutVersion)) {
|
|
|
//1 获取 token
|