Browse Source

优化创建数据集模型版本

dev-czh
chenzhihang 1 year ago
parent
commit
663aa97b77
2 changed files with 8 additions and 0 deletions
  1. +4
    -0
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ModelsServiceImpl.java
  2. +4
    -0
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/NewDatasetServiceImpl.java

+ 4
- 0
ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ModelsServiceImpl.java View File

@@ -706,6 +706,10 @@ public class ModelsServiceImpl implements ModelsService {
String metaPath = rootPath + "/metadata"; String metaPath = rootPath + "/metadata";
String relatePath = ci4sUsername + "/model/" + modelsVo.getId() + "/" + repositoryName + "/" + branchName + "/model"; String relatePath = ci4sUsername + "/model/" + modelsVo.getId() + "/" + repositoryName + "/" + branchName + "/model";


//干掉目标文件夹
dvcUtils.deleteDirectory(rootPath);
FileUtil.renameFile(rootPath, rootPath + "_deleted_" + System.currentTimeMillis());

//克隆 //克隆
dvcUtils.gitClone(rootPath, projectUrl, oldModelDependencys.get(0).getVersion(), gitLinkUsername, gitLinkPassword); dvcUtils.gitClone(rootPath, projectUrl, oldModelDependencys.get(0).getVersion(), gitLinkUsername, gitLinkPassword);
dvcUtils.refreshRemoteBranches(rootPath, gitLinkUsername, gitLinkPassword, oldModelDependencys.get(0).getVersion()); dvcUtils.refreshRemoteBranches(rootPath, gitLinkUsername, gitLinkPassword, oldModelDependencys.get(0).getVersion());


+ 4
- 0
ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/NewDatasetServiceImpl.java View File

@@ -191,6 +191,10 @@ public class NewDatasetServiceImpl implements NewDatasetService {
String datasetPath = localPath + "/dataset"; String datasetPath = localPath + "/dataset";
String projectUrl = gitendpoint + "/" + owner + "/" + repositoryName + ".git"; String projectUrl = gitendpoint + "/" + owner + "/" + repositoryName + ".git";


//干掉目标文件夹
dvcUtils.deleteDirectory(localPath);
FileUtil.renameFile(localPath, localPath + "_deleted_" + System.currentTimeMillis());

//查询项目信息 //查询项目信息
Map projectDetail = gitService.getProjectDetail(owner, repositoryName, token); Map projectDetail = gitService.getProjectDetail(owner, repositoryName, token);




Loading…
Cancel
Save