Browse Source

优化dvc远程目录

dev-czh
chenzhihang 1 year ago
parent
commit
2d14a96e34
2 changed files with 6 additions and 4 deletions
  1. +2
    -2
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ModelsServiceImpl.java
  2. +4
    -2
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/NewDatasetServiceImpl.java

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

@@ -654,7 +654,7 @@ public class ModelsServiceImpl implements ModelsService {
try { try {
dvcUtils.dvcInit(rootPath); dvcUtils.dvcInit(rootPath);
// 配置远程S3地址 // 配置远程S3地址
String s3Path = "data/mini-model-management-platform-files/" + ci4sUsername + "/model/" + gitlinIid + "/" + repositoryName + "/" + branchName;
String s3Path = bucketName + "/mini-model-management-platform-files/" + ci4sUsername + "/model/" + gitlinIid + "/" + repositoryName + "/" + branchName;
dvcUtils.dvcRemoteAdd(rootPath, s3Path); dvcUtils.dvcRemoteAdd(rootPath, s3Path);
dvcUtils.dvcConfigS3Credentials(rootPath, endpoint); dvcUtils.dvcConfigS3Credentials(rootPath, endpoint);
dvcUtils.dvcConfigS3Credentials2(rootPath, accessKeyId); dvcUtils.dvcConfigS3Credentials2(rootPath, accessKeyId);
@@ -826,7 +826,7 @@ public class ModelsServiceImpl implements ModelsService {
} }


// 配置远程S3地址 // 配置远程S3地址
String s3Path = "data/mini-model-management-platform-files/" + ci4sUsername + "/model/" + modelsVo.getId() + "/" + repositoryName + "/" + branchName;
String s3Path = bucketName + "/mini-model-management-platform-files/" + ci4sUsername + "/model/" + modelsVo.getId() + "/" + repositoryName + "/" + branchName;
dvcUtils.dvcRemoteAdd(rootPath, s3Path); dvcUtils.dvcRemoteAdd(rootPath, s3Path);
dvcUtils.dvcConfigS3Credentials(rootPath, endpoint); dvcUtils.dvcConfigS3Credentials(rootPath, endpoint);
dvcUtils.dvcConfigS3Credentials2(rootPath, accessKeyId); dvcUtils.dvcConfigS3Credentials2(rootPath, accessKeyId);


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

@@ -63,6 +63,8 @@ public class NewDatasetServiceImpl implements NewDatasetService {
String endpoint; String endpoint;
@Value("${git.endpoint}") @Value("${git.endpoint}")
String gitendpoint; String gitendpoint;
@Value("${minio.dataReleaseBucketName}")
private String bucketName;
@Value("${git.localPath}") @Value("${git.localPath}")
String localPathlocal; String localPathlocal;
@Resource @Resource
@@ -123,7 +125,7 @@ public class NewDatasetServiceImpl implements NewDatasetService {


// 命令行操作 git clone 项目地址 // 命令行操作 git clone 项目地址
dvcUtils.gitClone(localPath, projectUrl, branchName, gitLinkUsername, gitLinkPassword); dvcUtils.gitClone(localPath, projectUrl, branchName, gitLinkUsername, gitLinkPassword);
String s3Path = "data/mini-model-management-platform-files" + "/" + relatePath + "/" + branchName;
String s3Path = bucketName + "/mini-model-management-platform-files" + "/" + relatePath + "/" + branchName;
//干掉目标文件夹 //干掉目标文件夹
dvcUtils.deleteDirectory(datasetPath); dvcUtils.deleteDirectory(datasetPath);
dvcUtils.moveFiles(sourcePath, datasetPath); dvcUtils.moveFiles(sourcePath, datasetPath);
@@ -216,7 +218,7 @@ public class NewDatasetServiceImpl implements NewDatasetService {
dvcUtils.dvcCheckout(localPath); dvcUtils.dvcCheckout(localPath);


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




Loading…
Cancel
Save