Browse Source

优化dvc测试

dev-check
chenzhihang 1 year ago
parent
commit
cc567ce45a
1 changed files with 12 additions and 12 deletions
  1. +12
    -12
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/NewDatasetServiceImpl.java

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

@@ -153,11 +153,11 @@ public class NewDatasetServiceImpl implements NewDatasetService {
datasetVo.setId(gitlinIid);
datasetVo.setOwner(owner);
datasetVo.setRelativePaths(relatePath + "/dataset");
addDatasetSourceToDataVo(datasetVo);
// addDatasetSourceToDataVo(datasetVo);
YamlUtils.generateYamlFile(JsonUtils.objectToMap(datasetVo), localPath, "dataset");

// dvc init 初始化
dvcUtils.mkdir(datasetPath);
// dvcUtils.mkdir(datasetPath);
dvcUtils.dvcInit(localPath);
// 配置远程S3地址
dvcUtils.dvcRemoteAdd(localPath, s3Path);
@@ -192,7 +192,7 @@ public class NewDatasetServiceImpl implements NewDatasetService {

String s3Path1 = bucketName + "/mini-model-management-platform-files" + "/" + relatePath1;
//删掉已存在文件夹
dvcUtils.deleteDirectory(datasetPath1);
// dvcUtils.deleteDirectory(datasetPath1);
dvcUtils.moveFiles(sourcePath, datasetPath1);
// 拼接生产的元数据后写入yaml文件
datasetVo.setUpdateTime(DateUtils.getTime());
@@ -205,8 +205,8 @@ public class NewDatasetServiceImpl implements NewDatasetService {
datasetVo.setRelativePaths(relatePath1 + "/dataset");
YamlUtils.generateYamlFile(JsonUtils.objectToMap(datasetVo), localPath1, "dataset");

CompletableFuture.supplyAsync(() -> {
try {
// CompletableFuture.supplyAsync(() -> {
// try {
// 配置远程S3地址
dvcUtils.dvcRemoteAdd(localPath1, s3Path1);
dvcUtils.dvcConfigS3Credentials(localPath1, endpoint);
@@ -218,12 +218,12 @@ public class NewDatasetServiceImpl implements NewDatasetService {
dvcUtils.pushNewBranchToRemote(localPath1, gitLinkUsername, gitLinkPassword, branchName);
// dvc push 到远程S3
dvcUtils.dvcPush(localPath1);
} catch (Exception e) {
logger.error(e.getMessage(), e);
throw new RuntimeException(e.getMessage());
}
return null;
});
// } catch (Exception e) {
// logger.error(e.getMessage(), e);
// throw new RuntimeException(e.getMessage());
// }
// return null;
// });
return "新增数据集成功";
}

@@ -282,7 +282,7 @@ public class NewDatasetServiceImpl implements NewDatasetService {

// 准备数据
String s3Path = bucketName + "/mini-model-management-platform-files" + "/" + relatePath + "/" + branchName;
//干掉目标文件夹
//删掉已存在文件夹
dvcUtils.deleteDirectory(datasetPath);

if (Constant.Source_Hand_Export.equals(datasetVo.getDatasetSource())) {


Loading…
Cancel
Save