|
@@ -149,19 +149,19 @@ public class ProjectApplicationService {
|
|
|
projectStartMessageEntity.setTaskCompleted(0);
|
|
|
//去重,之后发送消息的时候会补全指标,如果不去重的话会出现多个场景重复关联多个指标
|
|
|
Set<SceneEntity> sceneEntitySet = new HashSet<>(sceneEntityList);
|
|
|
- log.info("项目 " + projectId + " 场景包括:" + sceneEntitySet);
|
|
|
+ log.info("项目 {} 场景包括:{}", projectId, sceneEntitySet);
|
|
|
// -------------------------------- 2 算法导入 --------------------------------
|
|
|
- log.info("项目 " + projectId + " 开始算法导入。");
|
|
|
+ log.info("项目 {} 开始算法导入。", projectId);
|
|
|
String algorithmDockerImage = handleAlgorithm(projectId, algorithmId);
|
|
|
- log.info("项目 " + projectId + " 算法已导入:" + algorithmDockerImage);
|
|
|
+ log.info("项目 {} 算法已导入:{}", projectId, algorithmDockerImage);
|
|
|
customRedisClient.set("project:" + projectId + ":docker-image", algorithmDockerImage);
|
|
|
// -------------------------------- 3 查询模型 --------------------------------
|
|
|
- log.info("项目 " + projectId + " 开始查询模型。");
|
|
|
+ log.info("项目 {} 开始查询模型。", projectId);
|
|
|
//1 根据车辆配置id vehicleConfigId, 获取 模型信息和传感器信息
|
|
|
com.css.simulation.resource.scheduler.infra.entity.VehicleEntity vehicleEntity = vehicleMapper.selectByVehicleConfigId(vehicleConfigId); // 车辆
|
|
|
List<CameraEntity> cameraEntityList = sensorCameraMapper.selectCameraByVehicleConfigId(vehicleConfigId); // 摄像头
|
|
|
List<OgtEntity> ogtEntityList = sensorOgtMapper.selectOgtByVehicleId(vehicleConfigId); // 完美传感器
|
|
|
- log.info("项目 " + projectId + " 开始保存任务消息。");
|
|
|
+ log.info("项目 {} 开始保存任务消息。", projectId);
|
|
|
if (DictConstants.MODEL_TYPE_VTD.equals(modelType)) {
|
|
|
// -------------------------------- 4 保存任务消息 --------------------------------
|
|
|
List<TaskEntity> taskList = new ArrayList<>();
|
|
@@ -700,7 +700,7 @@ public class ProjectApplicationService {
|
|
|
String algorithmDirectoryLinuxTempPath;
|
|
|
String algorithmTarLinuxTempPath = null;
|
|
|
if (algorithmEntity != null) {
|
|
|
- log.info("项目" + projectId + "使用仿真平台自己的算法 " + algorithmEntity);
|
|
|
+ log.info("项目{}使用仿真平台自己的算法 {}", projectId, algorithmEntity);
|
|
|
String algorithmCode = algorithmEntity.getAlgorithmCode();
|
|
|
String dockerImport = algorithmEntity.getDockerImport();
|
|
|
dockerImage = dockerConfiguration.getRegistry() + "/algorithm_" + algorithmCode + ":latest";
|
|
@@ -711,14 +711,14 @@ public class ProjectApplicationService {
|
|
|
if (DictConstants.ALGORITHM_UPLOAD_MODE_FILE.equals(uploadMode)) {
|
|
|
algorithmTarLinuxTempPath = linuxTempPath + "algorithm-file/" + algorithmCode + "/" + algorithmCode + ".tar";
|
|
|
String minioPath = algorithmEntity.getMinioPath();
|
|
|
- log.info("下载 minio 算法文件 " + minioPath + " 到本地 " + algorithmTarLinuxTempPath);
|
|
|
+ log.info("下载 minio 算法文件 {} 到本地 {}", minioPath, algorithmTarLinuxTempPath);
|
|
|
MinioUtil.downloadToFile(minioClient, bucketName, minioPath, algorithmTarLinuxTempPath);
|
|
|
} else if (DictConstants.ALGORITHM_UPLOAD_MODE_GIT.equals(uploadMode)) {
|
|
|
algorithmDirectoryLinuxTempPath = linuxTempPath + "algorithm-git/" + algorithmCode + "/";
|
|
|
String gitUrl = algorithmEntity.getGitUrl().replace(gitConfiguration.getName(), gitConfiguration.getUrl());
|
|
|
String gitUserName = algorithmEntity.getGitUserName();
|
|
|
String gitPassword = algorithmEntity.getGitPassword();
|
|
|
- log.info("下载 git 算法文件 " + gitUrl + " 到本地 " + algorithmDirectoryLinuxTempPath);
|
|
|
+ log.info("下载 git 算法文件 {} 到本地 {}", gitUrl, algorithmDirectoryLinuxTempPath);
|
|
|
GitUtil.clone(gitUrl, gitUserName, gitPassword, algorithmDirectoryLinuxTempPath, true);
|
|
|
for (String filename : Objects.requireNonNull(new File(algorithmDirectoryLinuxTempPath).list())) {
|
|
|
if (filename.endsWith(".tar")) {
|
|
@@ -735,7 +735,7 @@ public class ProjectApplicationService {
|
|
|
OsUtil.exec("docker import " + algorithmTarLinuxTempPath + " " + dockerImage);
|
|
|
OsUtil.exec("docker push " + dockerImage);
|
|
|
FileUtil.rm(algorithmTarLinuxTempPath);
|
|
|
- log.info("已删除算法临时文件:" + algorithmTarLinuxTempPath);
|
|
|
+ log.info("已删除算法临时文件:{}", algorithmTarLinuxTempPath);
|
|
|
} else {
|
|
|
throw new RuntimeException("算法 " + algorithmId + " 的 mysql 数据有误!");
|
|
|
}
|