|
@@ -335,16 +335,15 @@ public class ProjectService {
|
|
|
public String handleAlgorithm(String projectId, String algorithmId) {
|
|
|
//4-1 根据算法 id 获取算法文件地址、是否已导入成镜像。
|
|
|
AlgorithmPO algorithmPO = algorithmMapper.selectById(algorithmId);
|
|
|
- String dockerImage = dockerConfiguration.getRegistry() + "/";
|
|
|
+ String dockerImage;
|
|
|
String algorithmDirectoryLinuxTempPath;
|
|
|
String algorithmTarLinuxTempPath = null;
|
|
|
if (algorithmPO != null) { // 使用仿真平台自己的算法
|
|
|
String algorithmCode = algorithmPO.getAlgorithmCode();
|
|
|
String dockerImport = algorithmPO.getDockerImport();
|
|
|
- dockerImage += dockerConfiguration.getRegistry() + "/algorithm_" + algorithmCode + ":latest";
|
|
|
+ dockerImage = dockerConfiguration.getRegistry() + "/algorithm_" + algorithmCode + ":latest";
|
|
|
if ("1".equals(dockerImport) && StringUtil.isNotEmpty(dockerImport)) { // 已经导入同时存在镜像名称
|
|
|
- dockerImage = algorithmPO.getDockerImage();
|
|
|
- return dockerImage;
|
|
|
+ return algorithmPO.getDockerImage();
|
|
|
} else if (dockerImport == null || "0".equals(dockerImport)) { // 未导入
|
|
|
String uploadMode = algorithmPO.getUploadMode();
|
|
|
if (DictConstants.ALGORITHM_UPLOAD_MODE_FILE.equals(uploadMode)) {
|
|
@@ -380,7 +379,7 @@ public class ProjectService {
|
|
|
log.info("ProjectService--handleAlgorithm 项目" + projectId + "需要从索为平台下载算法 " + algorithmId);
|
|
|
algorithmTarLinuxTempPath = linuxTempPath + "algorithm/" + algorithmId + ".tar";
|
|
|
String dockerImageWithoutVersion = "algorithm_" + algorithmId;
|
|
|
- dockerImage += dockerImageWithoutVersion + ":latest";
|
|
|
+ dockerImage = dockerConfiguration.getRegistry() + "/" + dockerImageWithoutVersion + ":latest";
|
|
|
//0 查看算法是否已经导入
|
|
|
if (!projectUtil.isImported(dockerImageWithoutVersion)) {
|
|
|
//1 获取 token
|