Browse Source

优化dvc测试

dev-opt-homepage
chenzhihang 10 months ago
parent
commit
2f618703e4
2 changed files with 7 additions and 6 deletions
  1. +1
    -1
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ModelsServiceImpl.java
  2. +6
    -5
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/NewDatasetServiceImpl.java

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

@@ -613,7 +613,7 @@ public class ModelsServiceImpl implements ModelsService {
String relatePath = ci4sUsername + "/model/" + gitlinIid + "/" + repositoryName + "/" + branchName + "/model";

// 创建分支
gitService.createBranch(token, (String) userInfo.get("login"), repositoryName, branchName, "master");
gitService.createBranch(token, owner, repositoryName, branchName, "master");
// 定义标签 标签1:model 标签2:ModelTag 标签3:ModelType
gitService.createTopic(token, gitlinIid, Constant.Topic_model);
if (StringUtils.isNotEmpty(modelsVo.getModelTag())) {


+ 6
- 5
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";
String relatePath = ci4sUsername + "/datasets/" + gitlinIid + "/" + repositoryName + "/master-dvc";
String localPath = localPathlocal + relatePath;
String datasetPath = localPath + "/dataset";
String s3Path = bucketName + "/mini-model-management-platform-files" + "/" + relatePath;
@@ -144,8 +144,9 @@ public class NewDatasetServiceImpl implements NewDatasetService {
// 得到项目地址
String projectUrl = gitCloneEndpoint + "/" + owner + "/" + repositoryName + ".git";

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

// 命令行操作 git clone 项目地址
dvcUtils.gitClone(localPath1, projectUrl, "master", gitLinkUsername, gitLinkPassword);
dvcUtils.refreshRemoteBranches(localPath1, gitLinkUsername, gitLinkPassword, "master");
dvcUtils.gitClone(localPath1, projectUrl, "master-dvc", gitLinkUsername, gitLinkPassword);
dvcUtils.refreshRemoteBranches(localPath1, gitLinkUsername, gitLinkPassword, "master-dvc");
//检查是否存在本地重名分支,有的话干掉
dvcUtils.deleteLocalBranch(localPath1, branchName);
// 创建本地分支


Loading…
Cancel
Save