Browse Source

优化dvc测试

dev-opt-homepage
chenzhihang 9 months ago
parent
commit
163e9bab8d
1 changed files with 7 additions and 7 deletions
  1. +7
    -7
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/NewDatasetServiceImpl.java

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

@@ -136,7 +136,7 @@ public class NewDatasetServiceImpl implements NewDatasetService {
gitService.createTopic(token, gitlinIid, "datatype-" + datasetVo.getDataType());
}

String relatePath = ci4sUsername + "/datasets/" + gitlinIid + "/" + repositoryName + "/master-dvc";
String relatePath = ci4sUsername + "/datasets/" + gitlinIid + "/" + repositoryName + "/origin";
String localPath = localPathlocal + relatePath;
String datasetPath = localPath + "/dataset";
String s3Path = bucketName + "/mini-model-management-platform-files" + "/" + relatePath;
@@ -145,8 +145,8 @@ public class NewDatasetServiceImpl implements NewDatasetService {
String projectUrl = gitCloneEndpoint + "/" + owner + "/" + repositoryName + ".git";

// 创建master-dvc分支
gitService.createBranch(token, owner, repositoryName, "master-dvc", "master");
dvcUtils.gitClone(localPath, projectUrl, "master-dvc", gitLinkUsername, gitLinkPassword);
gitService.createBranch(token, owner, repositoryName, "origin", "master");
dvcUtils.gitClone(localPath, projectUrl, "origin", gitLinkUsername, gitLinkPassword);
// 拼接生产的元数据后写入yaml文件
datasetVo.setCreateBy(String.valueOf(StringUtils.isNotEmpty((String) userInfo.get("nickname")) ? userInfo.get("nickname") : userInfo.get("login")));
datasetVo.setUpdateTime(DateUtils.getTime());
@@ -183,8 +183,8 @@ public class NewDatasetServiceImpl implements NewDatasetService {
String datasetPath1 = localPath1 + "/dataset";

// 命令行操作 git clone 项目地址
dvcUtils.gitClone(localPath1, projectUrl, "master-dvc", gitLinkUsername, gitLinkPassword);
dvcUtils.refreshRemoteBranches(localPath1, gitLinkUsername, gitLinkPassword, "master-dvc");
dvcUtils.gitClone(localPath1, projectUrl, "origin", gitLinkUsername, gitLinkPassword);
dvcUtils.refreshRemoteBranches(localPath1, gitLinkUsername, gitLinkPassword, "origin");
//检查是否存在本地重名分支,有的话干掉
dvcUtils.deleteLocalBranch(localPath1, branchName);
// 创建本地分支
@@ -271,8 +271,8 @@ public class NewDatasetServiceImpl implements NewDatasetService {
// String oldBranch = (String) brancheList.stream()
// .filter(branch -> !"master".equals(branch.get("name"))).collect(Collectors.toList()).get(0).get("name");

dvcUtils.gitClone(localPath, projectUrl, "master", gitLinkUsername, gitLinkPassword);
dvcUtils.refreshRemoteBranches(localPath, gitLinkUsername, gitLinkPassword, "master");
dvcUtils.gitClone(localPath, projectUrl, "origin", gitLinkUsername, gitLinkPassword);
dvcUtils.refreshRemoteBranches(localPath, gitLinkUsername, gitLinkPassword, "origin");

//检查是否存在本地重名分支,有的话删掉
dvcUtils.deleteLocalBranch(localPath, branchName);


Loading…
Cancel
Save