|
@@ -11,6 +11,7 @@ import com.css.simulation.resource.scheduler.feign.CommonService;
|
|
|
import com.css.simulation.resource.scheduler.mapper.*;
|
|
|
import com.css.simulation.resource.scheduler.pojo.dto.*;
|
|
|
import com.css.simulation.resource.scheduler.pojo.po.*;
|
|
|
+import com.github.dockerjava.api.DockerClient;
|
|
|
import feign.Response;
|
|
|
import io.kubernetes.client.openapi.ApiClient;
|
|
|
import io.kubernetes.client.openapi.ApiException;
|
|
@@ -57,8 +58,11 @@ public class ManualProjectConsumer {
|
|
|
private ApiClient apiClient;
|
|
|
@Value("${spring.kafka.consumer.topic.manual-project}")
|
|
|
private String manualProjectTopic;
|
|
|
- @Value("${scheduler.manual-project.result-path}")
|
|
|
+ @Value("${scheduler.manual-project.result-path-minio}")
|
|
|
private String manualProjectResultPath;
|
|
|
+ @Value("${scheduler.temp-path-linux}")
|
|
|
+ private String tempPath;
|
|
|
+
|
|
|
|
|
|
@KafkaListener(groupId = "simulation-resource-scheduler", topics = "${spring.kafka.consumer.topic.manual-project}")
|
|
|
public void testConsumer(ConsumerRecord<String, String> projectRecord) {
|
|
@@ -187,15 +191,13 @@ public class ManualProjectConsumer {
|
|
|
|
|
|
|
|
|
String algorithmId = projectMessageDTO.getAlgorithmId();
|
|
|
- String localPath = "/opt/module/algorithm/";
|
|
|
|
|
|
String minioPath = algorithmMapper.selectMinioPathById(algorithmId);
|
|
|
+ String linuxPath = tempPath + minioPath.substring(1);
|
|
|
|
|
|
Response response = commonService.download(new MinioParameter(minioPath));
|
|
|
InputStream inputStream = response.body().asInputStream();
|
|
|
- FileUtil.writeInputStreamToLocalFile(inputStream, localPath);
|
|
|
-
|
|
|
- LinuxUtil.execute("docker load");
|
|
|
+
|
|
|
|
|
|
|
|
|
|