Browse Source

Merge remote-tracking branch 'origin/dev' into dev-czh

dev-DXTZYK
chenzhihang 1 year ago
parent
commit
a08754f863
3 changed files with 15 additions and 15 deletions
  1. +3
    -0
      k8s/template-yaml/k8s-7management.yaml
  2. +7
    -9
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ModelsServiceImpl.java
  3. +5
    -6
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/NewDatasetServiceImpl.java

+ 3
- 0
k8s/template-yaml/k8s-7management.yaml View File

@@ -16,6 +16,9 @@ spec:
containers:
- name: ci4s-management-platform
image: ${k8s-7management-image}
env:
- name: TZ
value: Asia/Shanghai
ports:
- containerPort: 9213
volumeMounts:


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

@@ -593,8 +593,7 @@ public class ModelsServiceImpl implements ModelsService {

String projectUrl = gitendpoint + "/" + owner + "/" + repositoryName + ".git";
String sourcePath = modelsVo.getModelVersionVos().get(0).getUrl();
String relatePath = ci4sUsername + "/model/" + gitlinIid + "/" + repositoryName;
String rootPath = localPath + relatePath;
String rootPath = localPath + ci4sUsername + "/model/" + gitlinIid + "/" + repositoryName;
String modelPath = rootPath + "/model";
String metaPath = rootPath + "/metadata";

@@ -617,7 +616,7 @@ public class ModelsServiceImpl implements ModelsService {
modelMetaVo.setIdentifier(repositoryName);
modelMetaVo.setOwner(owner);
modelMetaVo.setVersionDesc(modelMetaVo.getDescription());
modelMetaVo.setRelativePaths(relatePath);
modelMetaVo.setRelativePaths(modelPath);
File folder = new File(modelPath);
long folderSize = FileUtil.getFolderSize(folder);
modelMetaVo.setModelSize(FileUtil.formatFileSize(folderSize));
@@ -689,8 +688,7 @@ public class ModelsServiceImpl implements ModelsService {

String projectUrl = gitendpoint + "/" + owner + "/" + repositoryName + ".git";
String sourcePath = modelsVo.getModelVersionVos().get(0).getUrl();
String relatePath = ci4sUsername + "/model/" + modelsVo.getId() + "/" + repositoryName;
String rootPath = localPath + relatePath;
String rootPath = localPath + ci4sUsername + "/model/" + modelsVo.getId() + "/" + repositoryName;
String modelPath = rootPath + "/model";
String metaPath = rootPath + "/metadata";

@@ -721,7 +719,7 @@ public class ModelsServiceImpl implements ModelsService {
modelMetaVo.setDescription(oldModelVo.getDescription());
modelMetaVo.setModelTag(oldModelVo.getModelTag());
modelMetaVo.setModelType(oldModelVo.getModelType());
modelMetaVo.setRelativePaths(relatePath);
modelMetaVo.setRelativePaths(modelPath);
File folder = new File(modelPath);
long folderSize = FileUtil.getFolderSize(folder);
modelMetaVo.setModelSize(FileUtil.formatFileSize(folderSize));
@@ -995,9 +993,9 @@ public class ModelsServiceImpl implements ModelsService {

if (map != null) {
List<Map<String, Object>> topics = (List<Map<String, Object>>) map.get("topics");
if (topics != null && topics.size() > 0 && modelTopic.equals(topics.get(0).get("name"))) {
String modeltag = (String) topics.get(1).get("name");
String modeltype = (String) topics.get(2).get("name");
if (topics != null && topics.size() > 0 && modelTopic.equals(topics.get(1).get("name"))) {
String modeltag = (String) topics.get(2).get("name");
String modeltype = (String) topics.get(3).get("name");
modeltag = modeltag.substring("modeltag-".length());
modeltype = modeltype.substring("modeltype-".length());
if (StringUtils.isNotEmpty(modelTagName) && !modelTagName.toLowerCase().equals(modeltag)) {


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

@@ -132,7 +132,7 @@ public class NewDatasetServiceImpl implements NewDatasetService {
datasetVo.setIdentifier(repositoryName);
datasetVo.setId(gitlinIid);
datasetVo.setOwner((String) userInfo.get("login"));
datasetVo.setRelativePaths(relatePath);
datasetVo.setRelativePaths(relatePath+"/dataset");

addDatasetSourceToDataVo(datasetVo);

@@ -211,7 +211,7 @@ public class NewDatasetServiceImpl implements NewDatasetService {
datasetVo.setDescription(newDatasetVo.getDescription());
datasetVo.setDataTag(newDatasetVo.getDataTag());
datasetVo.setDataType(newDatasetVo.getDataType());
datasetVo.setRelativePaths(relatePath);
datasetVo.setRelativePaths(relatePath+"/dataset");

addDatasetSourceToDataVo(datasetVo);

@@ -308,7 +308,6 @@ public class NewDatasetServiceImpl implements NewDatasetService {
}
List<Map<String, Object>> fileDetailsAfterGitPull = dvcUtils.getFileDetailsAfterGitPull(localPathlocal + loginUser.getUsername() + "/datasets/" + id, repo, version, "dataset", gitLinkUsername, gitLinkPassword);
// 在localPathlocal+id+"/"+repositoryName目录下的dataset.yaml中取到元数据
System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!!!fileDetailsAfterGitPull:{}" + fileDetailsAfterGitPull);
Map<String, Object> stringObjectMap = YamlUtils.loadYamlFile(localPathlocal + loginUser.getUsername() + "/datasets/" + id + "/" + repo + "/" + "dataset.yaml");
NewDatasetVo newDatasetVo = ConvertUtil.convertMapToObject(stringObjectMap, NewDatasetVo.class);
List<VersionVo> versionVos = new ArrayList<VersionVo>();
@@ -448,9 +447,9 @@ public class NewDatasetServiceImpl implements NewDatasetService {

if (map != null) {
List<Map<String, Object>> topics = (List<Map<String, Object>>) map.get("topics");
if (topics != null && topics.size() > 0 && datasetTopic.equals(topics.get(0).get("name"))) {
String datasettag = (String) topics.get(1).get("name");
String datasetype = (String) topics.get(2).get("name");
if (topics != null && topics.size() > 0 && datasetTopic.equals(topics.get(1).get("name"))) {
String datasettag = (String) topics.get(2).get("name");
String datasetype = (String) topics.get(3).get("name");
datasettag = datasettag.substring("datatag-".length());
datasetype = datasetype.substring("datatype-".length());
if (StringUtils.isNotEmpty(datasetTagName) && !datasetTagName.toLowerCase().equals(datasettag)) {


Loading…
Cancel
Save