From cc567ce45a55418961216a6b7c0dcb2a983c503d Mon Sep 17 00:00:00 2001 From: chenzhihang <709011834@qq.com> Date: Fri, 6 Jun 2025 09:42:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96dvc=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/NewDatasetServiceImpl.java | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/NewDatasetServiceImpl.java b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/NewDatasetServiceImpl.java index c9ceb2ca..b3feb15f 100644 --- a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/NewDatasetServiceImpl.java +++ b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/NewDatasetServiceImpl.java @@ -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())) {