From 658ad688d333e809afc474ab9dfc1e1d569f2f93 Mon Sep 17 00:00:00 2001 From: chenzhihang <709011834@qq.com> Date: Thu, 19 Sep 2024 10:53:57 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=BC=82=E6=AD=A5?= =?UTF-8?q?=E6=89=A7=E8=A1=8C=E5=88=9B=E5=BB=BA=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ModelsServiceImpl.java | 24 +++++++++---------- .../service/impl/NewDatasetServiceImpl.java | 19 ++++++++------- .../com/ruoyi/platform/vo/GitProjectVo.java | 5 ++-- 3 files changed, 25 insertions(+), 23 deletions(-) diff --git a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ModelsServiceImpl.java b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ModelsServiceImpl.java index 81402805..6868bf0a 100644 --- a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ModelsServiceImpl.java +++ b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ModelsServiceImpl.java @@ -738,17 +738,18 @@ public class ModelsServiceImpl implements ModelsService { modelDependency.setMeta(meta); modelDependency1Dao.insert(modelDependency); + // 配置远程S3地址 + String s3Path = "management-platform-files/" + ci4sUsername + "/model/" + modelsVo.getId() + "/" + repositoryName + "/" + branchName; + dvcUtils.dvcRemoteAdd(rootPath, s3Path); + dvcUtils.dvcConfigS3Credentials(rootPath, endpoint); + dvcUtils.dvcConfigS3Credentials2(rootPath, accessKeyId); + dvcUtils.dvcConfigS3Credentials3(rootPath, secretAccessKey); + // dvc 跟踪 + dvcUtils.dvcAdd(rootPath, "model"); + dvcUtils.pushNewBranchToRemote(rootPath, gitLinkUsername, gitLinkPassword, branchName); + CompletableFuture.supplyAsync(() -> { try { - // 配置远程S3地址 - String s3Path = "management-platform-files/" + ci4sUsername + "/model/" + modelsVo.getId() + "/" + repositoryName + "/" + branchName; - dvcUtils.dvcRemoteAdd(rootPath, s3Path); - dvcUtils.dvcConfigS3Credentials(rootPath, endpoint); - dvcUtils.dvcConfigS3Credentials2(rootPath, accessKeyId); - dvcUtils.dvcConfigS3Credentials3(rootPath, secretAccessKey); - // dvc 跟踪 - dvcUtils.dvcAdd(rootPath, "model"); - dvcUtils.pushNewBranchToRemote(rootPath, gitLinkUsername, gitLinkPassword, branchName); //dvc push 到远程S3 dvcUtils.dvcPush(rootPath); } catch (Exception e) { @@ -756,9 +757,8 @@ public class ModelsServiceImpl implements ModelsService { } return null; }); - return "新增模型版本成功"; } - return null; + return "新增模型版本成功"; } @@ -871,7 +871,7 @@ public class ModelsServiceImpl implements ModelsService { String modelTagName = modelsVo.getModelTag(); String modelTypeName = modelsVo.getModelType(); - String url = gitendpoint + "/api/projects.json?user_id=" + userId + "&sort_by=praises_count"; + String url = gitendpoint + "/api/projects.json"; String name = modelsVo.getName(); if (StringUtils.isNotEmpty(name)) { 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 e4f6a943..2ce6cd0d 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 @@ -214,17 +214,18 @@ public class NewDatasetServiceImpl implements NewDatasetService { addDatasetSourceToDataVo(datasetVo); YamlUtils.generateYamlFile(JsonUtils.objectToMap(datasetVo), localPath, "dataset"); + //dvc数据跟踪 + // 配置远程S3地址 + dvcUtils.dvcRemoteAdd(localPath, s3Path); + dvcUtils.dvcConfigS3Credentials(localPath, endpoint); + dvcUtils.dvcConfigS3Credentials2(localPath, accessKeyId); + dvcUtils.dvcConfigS3Credentials3(localPath, secretAccessKey); + // dvc 跟踪 + dvcUtils.dvcAdd(localPath, "dataset"); + dvcUtils.pushNewBranchToRemote(localPath, gitLinkUsername, gitLinkPassword, branchName); + CompletableFuture.supplyAsync(() -> { try { - //dvc数据跟踪 - // 配置远程S3地址 - dvcUtils.dvcRemoteAdd(localPath, s3Path); - dvcUtils.dvcConfigS3Credentials(localPath, endpoint); - dvcUtils.dvcConfigS3Credentials2(localPath, accessKeyId); - dvcUtils.dvcConfigS3Credentials3(localPath, secretAccessKey); - // dvc 跟踪 - dvcUtils.dvcAdd(localPath, "dataset"); - dvcUtils.pushNewBranchToRemote(localPath, gitLinkUsername, gitLinkPassword, branchName); //dvc push 到远程S3 dvcUtils.dvcPush(localPath); } catch (Exception e) { diff --git a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/vo/GitProjectVo.java b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/vo/GitProjectVo.java index a31a7cd1..2f0ad0fb 100644 --- a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/vo/GitProjectVo.java +++ b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/vo/GitProjectVo.java @@ -25,8 +25,9 @@ public class GitProjectVo implements Serializable { @ApiModelProperty(value = "项目标识", required = true) private String repositoryName; -// @ApiModelProperty(value = "项目分类ID", required = false) -// private int projectCategoryId; + @ApiModelProperty(value = "项目分类ID", required = false) + private int projectCategoryId; + // // @ApiModelProperty(value = "项目语言ID", required = false) // private int projectLanguageId; From 469c5752502332ec8c7d257565547b57e53453e3 Mon Sep 17 00:00:00 2001 From: chenzhihang <709011834@qq.com> Date: Thu, 19 Sep 2024 10:57:19 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=BC=82=E6=AD=A5?= =?UTF-8?q?=E6=89=A7=E8=A1=8C=E5=88=9B=E5=BB=BA=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/ruoyi/platform/vo/GitProjectVo.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/vo/GitProjectVo.java b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/vo/GitProjectVo.java index 2f0ad0fb..9b858fcd 100644 --- a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/vo/GitProjectVo.java +++ b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/vo/GitProjectVo.java @@ -25,8 +25,8 @@ public class GitProjectVo implements Serializable { @ApiModelProperty(value = "项目标识", required = true) private String repositoryName; - @ApiModelProperty(value = "项目分类ID", required = false) - private int projectCategoryId; +// @ApiModelProperty(value = "项目分类ID", required = false) +// private int projectCategoryId; // // @ApiModelProperty(value = "项目语言ID", required = false)