Browse Source

Merge branch 'dev' of https://gitlink.org.cn/ci4s/ci4sManagement-cloud into dev

dev-active_learn
somunslotus 11 months ago
parent
commit
29a1eb593a
2 changed files with 7 additions and 4 deletions
  1. +3
    -2
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/NewDatasetServiceImpl.java
  2. +4
    -2
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/utils/K8sClientUtil.java

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

@@ -473,12 +473,13 @@ public class NewDatasetServiceImpl implements NewDatasetService {
public String newCreateVersionFromLabelStudio(LabelDatasetVersionVo labelDatasetVersionVo) throws Exception { public String newCreateVersionFromLabelStudio(LabelDatasetVersionVo labelDatasetVersionVo) throws Exception {
// 1. 下载数据集文件 // 1. 下载数据集文件
// 获取label-studio数据流 // 获取label-studio数据流
Map<String, String> headers = new HashMap<String, String>();
Map<String, String> headers = new HashMap<>();
headers.put("Authorization", "Token " + labelDatasetVersionVo.getToken()); headers.put("Authorization", "Token " + labelDatasetVersionVo.getToken());
InputStream inputStream = HttpUtils.getIntputStream(labelloaclUrl + "/api/projects/" + labelDatasetVersionVo.getProjectId() + "/export?exportType=" + labelDatasetVersionVo.getExportType(), headers); InputStream inputStream = HttpUtils.getIntputStream(labelloaclUrl + "/api/projects/" + labelDatasetVersionVo.getProjectId() + "/export?exportType=" + labelDatasetVersionVo.getExportType(), headers);


// 2. 打包成zip包 // 2. 打包成zip包
String zipFileName = labelDatasetVersionVo.getName()+"_"+labelDatasetVersionVo.getVersion() + ".zip";
// String zipFileName = labelDatasetVersionVo.getName() + "_" + labelDatasetVersionVo.getVersion() + ".zip";
String zipFileName = labelDatasetVersionVo.getName() + "_" + labelDatasetVersionVo.getVersion();
MultipartFile[] files = FileUtil.toMultipartFiles(inputStream, zipFileName); MultipartFile[] files = FileUtil.toMultipartFiles(inputStream, zipFileName);


// 3. 上传到minio // 3. 上传到minio


+ 4
- 2
ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/utils/K8sClientUtil.java View File

@@ -39,6 +39,8 @@ public class K8sClientUtil {


@Value("${jupyter.hostPath}") @Value("${jupyter.hostPath}")
private String hostPath; private String hostPath;
@Value("${dockerpush.proxyUrl}")
private String proxyUrl;


private String http; private String http;
private String token; private String token;
@@ -360,11 +362,11 @@ public class K8sClientUtil {
.withNewSecurityContext().withNewPrivileged(true).endSecurityContext() .withNewSecurityContext().withNewPrivileged(true).endSecurityContext()
.addNewEnv() .addNewEnv()
.withName("HTTP_PROXY") .withName("HTTP_PROXY")
.withValue("http://172.20.32.253:3128")
.withValue(proxyUrl)
.endEnv() .endEnv()
.addNewEnv() .addNewEnv()
.withName("HTTPS_PROXY") .withName("HTTPS_PROXY")
.withValue("http://172.20.32.253:3128")
.withValue(proxyUrl)
.endEnv() .endEnv()
.addNewEnv() .addNewEnv()
.withName("NO_PROXY") .withName("NO_PROXY")


Loading…
Cancel
Save