Merge remote-tracking branch 'origin/feat/infer_dev_260107' into feat/infer_dev_260107

This commit is contained in:
Moon
2026-01-12 21:09:11 +09:00
7 changed files with 97 additions and 96 deletions

View File

@@ -1,7 +1,6 @@
package com.kamco.cd.kamcoback.inference; package com.kamco.cd.kamcoback.inference;
import com.kamco.cd.kamcoback.config.api.ApiResponseDto; import com.kamco.cd.kamcoback.config.api.ApiResponseDto;
import com.kamco.cd.kamcoback.inference.dto.InferenceDetailDto;
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto; import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto;
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.InferenceServerStatusDto; import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.InferenceServerStatusDto;
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.InferenceStatusDetailDto; import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.InferenceStatusDetailDto;
@@ -241,28 +240,26 @@ public class InferenceResultApiController {
return ApiResponseDto.ok(inferenceResultService.getInferenceServerStatusList()); return ApiResponseDto.ok(inferenceResultService.getInferenceServerStatusList());
} }
@Operation(summary = "추론관리 진행현황 상세", description = "어드민 홈 > 추론관리 > 추론관리 > 진행현황 상세") @Operation(summary = "추론관리 진행현황 상세", description = "어드민 홈 > 추론관리 > 추론관리 > 진행현황 상세")
@ApiResponses( @ApiResponses(
value = { value = {
@ApiResponse( @ApiResponse(
responseCode = "200", responseCode = "200",
description = "검색 성공", description = "검색 성공",
content = content =
@Content( @Content(
mediaType = "application/json", mediaType = "application/json",
schema = @Schema(implementation = Page.class))), schema = @Schema(implementation = Page.class))),
@ApiResponse(responseCode = "400", description = "잘못된 검색 조건", content = @Content), @ApiResponse(responseCode = "400", description = "잘못된 검색 조건", content = @Content),
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content) @ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
}) })
@GetMapping("/status/{uuid}") @GetMapping("/status/{uuid}")
public ApiResponseDto<InferenceStatusDetailDto> getInferenceStatus( public ApiResponseDto<InferenceStatusDetailDto> getInferenceStatus(
@io.swagger.v3.oas.annotations.parameters.RequestBody( @io.swagger.v3.oas.annotations.parameters.RequestBody(
description = "모델 삭제 요청 정보", description = "모델 삭제 요청 정보",
required = true) required = true)
@PathVariable @PathVariable
UUID uuid) { UUID uuid) {
return ApiResponseDto.ok(inferenceResultService.getInferenceStatus(uuid)); return ApiResponseDto.ok(inferenceResultService.getInferenceStatus(uuid));
} }

View File

@@ -214,17 +214,17 @@ public class InferenceResultDto {
private String model3Ver; private String model3Ver;
public InferenceStatusDetailDto( public InferenceStatusDetailDto(
String title, String title,
Integer compareYyyy, Integer compareYyyy,
Integer targetYyyy, Integer targetYyyy,
String detectOption, String detectOption,
String mapSheetScope, String mapSheetScope,
ZonedDateTime inferStartDttm, ZonedDateTime inferStartDttm,
ZonedDateTime inferEndDttm, ZonedDateTime inferEndDttm,
Long detectingCnt, Long detectingCnt,
String model1Ver, String model1Ver,
String model2Ver, String model2Ver,
String model3Ver) { String model3Ver) {
this.title = title; this.title = title;
this.compareYyyy = compareYyyy; this.compareYyyy = compareYyyy;
this.targetYyyy = targetYyyy; this.targetYyyy = targetYyyy;
@@ -247,18 +247,15 @@ public class InferenceResultDto {
private String model3VerStatus = "PROCCESING"; private String model3VerStatus = "PROCCESING";
private String model4VerStatusName = "진행중"; private String model4VerStatusName = "진행중";
public String getDetectOptionName() public String getDetectOptionName() {
{ if (this.detectOption.equals("EXCL")) return "추론제외";
if( this.detectOption.equals("EXCL") )return "추론제외";
return "이전 년도 도엽 사용"; return "이전 년도 도엽 사용";
} }
public String getMapSheetScopeName() public String getMapSheetScopeName() {
{ if (this.detectOption.equals("ALL")) return "전체";
if( this.detectOption.equals("ALL") )return "전체";
return "부분"; return "부분";
} }
} }
@Getter @Getter

View File

@@ -405,12 +405,13 @@ public class InferenceResultService {
public InferenceStatusDetailDto getInferenceStatus(UUID uuid) { public InferenceStatusDetailDto getInferenceStatus(UUID uuid) {
List<InferenceServerStatusDto> servers = inferenceResultCoreService.getInferenceServerStatusList(); List<InferenceServerStatusDto> servers =
inferenceResultCoreService.getInferenceServerStatusList();
String serverNames = ""; String serverNames = "";
for (InferenceServerStatusDto server : servers) { for (InferenceServerStatusDto server : servers) {
if( serverNames.equals("") )serverNames = server.getServerName(); if (serverNames.equals("")) serverNames = server.getServerName();
else serverNames = serverNames+","+server.getServerName(); else serverNames = serverNames + "," + server.getServerName();
} }
InferenceStatusDetailDto dto = inferenceResultCoreService.getInferenceStatus(uuid); InferenceStatusDetailDto dto = inferenceResultCoreService.getInferenceStatus(uuid);
@@ -418,5 +419,4 @@ public class InferenceResultService {
return dto; return dto;
} }
} }

View File

@@ -134,7 +134,7 @@ public class ModelMngService {
} }
public ModelUploadResDto uploadChunkModelFile( public ModelUploadResDto uploadChunkModelFile(
UploadDto.UploadAddReq upAddReqDto, MultipartFile chunkFile) { UploadDto.UploadAddReq upAddReqDto, MultipartFile chunkFile) {
UploadDto.UploadRes upRes = uploadService.uploadChunk(upAddReqDto, chunkFile); UploadDto.UploadRes upRes = uploadService.uploadChunk(upAddReqDto, chunkFile);
ModelUploadResDto modelUploadResDto = new ModelUploadResDto(); ModelUploadResDto modelUploadResDto = new ModelUploadResDto();

View File

@@ -260,7 +260,7 @@ public class InferenceResultCoreService {
return inferenceBatchSheet; return inferenceBatchSheet;
} }
public InferenceStatusDetailDto getInferenceStatus(UUID uuid){ public InferenceStatusDetailDto getInferenceStatus(UUID uuid) {
return mapSheetLearnRepository.getInferenceStatus(uuid); return mapSheetLearnRepository.getInferenceStatus(uuid);
} }
} }

View File

@@ -1,13 +1,12 @@
package com.kamco.cd.kamcoback.postgres.repository.Inference; package com.kamco.cd.kamcoback.postgres.repository.Inference;
import com.kamco.cd.kamcoback.inference.dto.InferenceDetailDto;
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto; import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto;
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.InferenceServerStatusDto; import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.InferenceServerStatusDto;
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.InferenceStatusDetailDto; import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.InferenceStatusDetailDto;
import com.kamco.cd.kamcoback.postgres.entity.MapSheetLearnEntity; import com.kamco.cd.kamcoback.postgres.entity.MapSheetLearnEntity;
import java.util.List;
import java.util.Optional; import java.util.Optional;
import java.util.UUID; import java.util.UUID;
import java.util.List;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
public interface MapSheetLearnRepositoryCustom { public interface MapSheetLearnRepositoryCustom {

View File

@@ -2,11 +2,9 @@ package com.kamco.cd.kamcoback.postgres.repository.Inference;
import static com.kamco.cd.kamcoback.postgres.entity.QGpuMetricEntity.gpuMetricEntity; import static com.kamco.cd.kamcoback.postgres.entity.QGpuMetricEntity.gpuMetricEntity;
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetLearnEntity.mapSheetLearnEntity; import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetLearnEntity.mapSheetLearnEntity;
import static com.kamco.cd.kamcoback.postgres.entity.QModelMngEntity.modelMngEntity;
import static com.kamco.cd.kamcoback.postgres.entity.QSystemMetricEntity.systemMetricEntity; import static com.kamco.cd.kamcoback.postgres.entity.QSystemMetricEntity.systemMetricEntity;
import com.kamco.cd.kamcoback.common.utils.DateRange; import com.kamco.cd.kamcoback.common.utils.DateRange;
import com.kamco.cd.kamcoback.inference.dto.InferenceDetailDto;
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto; import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto;
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.InferenceServerStatusDto; import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.InferenceServerStatusDto;
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.InferenceStatusDetailDto; import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.InferenceStatusDetailDto;
@@ -100,35 +98,42 @@ public class MapSheetLearnRepositoryImpl implements MapSheetLearnRepositoryCusto
BooleanBuilder builder = new BooleanBuilder(); BooleanBuilder builder = new BooleanBuilder();
List<Integer> latestIds = queryFactory List<Integer> latestIds =
.select(systemMetricEntity.id1.max()) queryFactory
.from(systemMetricEntity) .select(systemMetricEntity.id1.max())
.groupBy(systemMetricEntity.serverName) .from(systemMetricEntity)
.fetch(); .groupBy(systemMetricEntity.serverName)
.fetch();
List<Integer> latestGpuIds = queryFactory List<Integer> latestGpuIds =
.select(gpuMetricEntity.id1.max()) queryFactory
.from(gpuMetricEntity) .select(gpuMetricEntity.id1.max())
.groupBy(gpuMetricEntity.serverName) .from(gpuMetricEntity)
.fetch(); .groupBy(gpuMetricEntity.serverName)
.fetch();
List<InferenceServerStatusDto> foundContent = queryFactory List<InferenceServerStatusDto> foundContent =
.select(Projections.constructor( queryFactory
InferenceServerStatusDto.class, .select(
systemMetricEntity.serverName, Projections.constructor(
systemMetricEntity.cpuUser, InferenceServerStatusDto.class,
systemMetricEntity.cpuSystem, systemMetricEntity.serverName,
systemMetricEntity.memused, systemMetricEntity.cpuUser,
systemMetricEntity.kbmemused, systemMetricEntity.cpuSystem,
gpuMetricEntity.gpuUtil systemMetricEntity.memused,
)) systemMetricEntity.kbmemused,
.from(systemMetricEntity) gpuMetricEntity.gpuUtil))
.leftJoin(gpuMetricEntity).on(gpuMetricEntity.id1.in(latestGpuIds) .from(systemMetricEntity)
.and(gpuMetricEntity.serverName.eq(systemMetricEntity.serverName))) .leftJoin(gpuMetricEntity)
.where(systemMetricEntity.id1.in(latestIds)) // In 절 사용 .on(
.orderBy(systemMetricEntity.serverName.asc()) gpuMetricEntity
.limit(4) .id1
.fetch(); .in(latestGpuIds)
.and(gpuMetricEntity.serverName.eq(systemMetricEntity.serverName)))
.where(systemMetricEntity.id1.in(latestIds)) // In 절 사용
.orderBy(systemMetricEntity.serverName.asc())
.limit(4)
.fetch();
return foundContent; return foundContent;
} }
@@ -142,29 +147,32 @@ public class MapSheetLearnRepositoryImpl implements MapSheetLearnRepositoryCusto
QModelMngEntity m2Model = new QModelMngEntity("m2Model"); QModelMngEntity m2Model = new QModelMngEntity("m2Model");
QModelMngEntity m3Model = new QModelMngEntity("m3Model"); QModelMngEntity m3Model = new QModelMngEntity("m3Model");
InferenceStatusDetailDto foundContent = queryFactory InferenceStatusDetailDto foundContent =
.select(Projections.constructor( queryFactory
InferenceStatusDetailDto.class, .select(
mapSheetLearnEntity.title, Projections.constructor(
mapSheetLearnEntity.compareYyyy, InferenceStatusDetailDto.class,
mapSheetLearnEntity.targetYyyy, mapSheetLearnEntity.title,
mapSheetLearnEntity.detectOption, mapSheetLearnEntity.compareYyyy,
mapSheetLearnEntity.mapSheetScope, mapSheetLearnEntity.targetYyyy,
mapSheetLearnEntity.inferStartDttm, mapSheetLearnEntity.detectOption,
mapSheetLearnEntity.inferEndDttm, mapSheetLearnEntity.mapSheetScope,
mapSheetLearnEntity.detectingCnt, mapSheetLearnEntity.inferStartDttm,
m1Model.modelVer.as("model1Ver"), mapSheetLearnEntity.inferEndDttm,
m2Model.modelVer.as("model2Ver"), mapSheetLearnEntity.detectingCnt,
m3Model.modelVer.as("model3Ver") m1Model.modelVer.as("model1Ver"),
)) m2Model.modelVer.as("model2Ver"),
.from(mapSheetLearnEntity) m3Model.modelVer.as("model3Ver")))
.leftJoin(m1Model).on(m1Model.uuid.eq(mapSheetLearnEntity.m1ModelUuid)) .from(mapSheetLearnEntity)
.leftJoin(m2Model).on(m2Model.uuid.eq(mapSheetLearnEntity.m2ModelUuid)) .leftJoin(m1Model)
.leftJoin(m3Model).on(m3Model.uuid.eq(mapSheetLearnEntity.m3ModelUuid)) .on(m1Model.uuid.eq(mapSheetLearnEntity.m1ModelUuid))
.where(mapSheetLearnEntity.uuid.eq(uuid)) .leftJoin(m2Model)
.fetchOne(); .on(m2Model.uuid.eq(mapSheetLearnEntity.m2ModelUuid))
.leftJoin(m3Model)
.on(m3Model.uuid.eq(mapSheetLearnEntity.m3ModelUuid))
.where(mapSheetLearnEntity.uuid.eq(uuid))
.fetchOne();
return foundContent; return foundContent;
} }
} }