Merge remote-tracking branch 'origin/feat/infer_dev_260107' into feat/infer_dev_260107
# Conflicts: # src/main/java/com/kamco/cd/kamcoback/postgres/repository/Inference/MapSheetLearnRepositoryCustom.java # src/main/java/com/kamco/cd/kamcoback/postgres/repository/Inference/MapSheetLearnRepositoryImpl.java
This commit is contained in:
@@ -224,17 +224,17 @@ public class InferenceResultApiController {
|
||||
|
||||
@Operation(summary = "추론관리 추론진행 서버 현황", description = "추론관리 추론진행 서버 현황")
|
||||
@ApiResponses(
|
||||
value = {
|
||||
@ApiResponse(
|
||||
responseCode = "200",
|
||||
description = "검색 성공",
|
||||
content =
|
||||
@Content(
|
||||
mediaType = "application/json",
|
||||
schema = @Schema(implementation = Page.class))),
|
||||
@ApiResponse(responseCode = "400", description = "잘못된 검색 조건", content = @Content),
|
||||
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
||||
})
|
||||
value = {
|
||||
@ApiResponse(
|
||||
responseCode = "200",
|
||||
description = "검색 성공",
|
||||
content =
|
||||
@Content(
|
||||
mediaType = "application/json",
|
||||
schema = @Schema(implementation = Page.class))),
|
||||
@ApiResponse(responseCode = "400", description = "잘못된 검색 조건", content = @Content),
|
||||
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
||||
})
|
||||
@GetMapping("/serverStatus")
|
||||
public ApiResponseDto<List<InferenceServerStatusDto>> getInferenceServerStatusList() {
|
||||
|
||||
|
||||
@@ -391,4 +391,17 @@ public class InferenceDetailDto {
|
||||
return PageRequest.of(page, size);
|
||||
}
|
||||
}
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public static class InferenceBatchSheet {
|
||||
|
||||
private Long m1BatchId;
|
||||
private Long m2BatchId;
|
||||
private Long m3BatchId;
|
||||
private String status;
|
||||
private String runningModelType;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,10 +129,7 @@ public class InferenceResultDto {
|
||||
}
|
||||
|
||||
public static Status fromCode(String code) {
|
||||
return Arrays.stream(values())
|
||||
.filter(v -> v.name().equals(code))
|
||||
.findFirst()
|
||||
.orElseThrow(() -> new IllegalArgumentException("알 수 없는 상태 코드: " + code));
|
||||
return Arrays.stream(values()).filter(v -> v.name().equals(code)).findFirst().orElse(null);
|
||||
}
|
||||
|
||||
public static String getDescByCode(String code) {
|
||||
@@ -271,75 +268,81 @@ public class InferenceResultDto {
|
||||
public static class InferenceServerStatusDto {
|
||||
|
||||
private String serverName;
|
||||
@JsonIgnore
|
||||
private float cpu_user;
|
||||
@JsonIgnore private float cpu_user;
|
||||
@JsonIgnore private float cpu_system;
|
||||
@JsonIgnore private float memused;
|
||||
private Long kbmemused;
|
||||
private float gpuUtil;
|
||||
|
||||
public float getCpuUseRate()
|
||||
{
|
||||
return this.cpu_user+this.cpu_system;
|
||||
// private String cpuStatusName;
|
||||
// private String memStatusName;
|
||||
// private String gpuStatusName;
|
||||
// private float cpu_use_rate;
|
||||
// private float gpu_use_rate;
|
||||
// private float mem_use_rate;
|
||||
|
||||
public float getCpuUseRate() {
|
||||
return this.cpu_user + this.cpu_system;
|
||||
}
|
||||
|
||||
public String getServerStatus()
|
||||
{
|
||||
public String getServerStatus() {
|
||||
String enumId = "SAFETY";
|
||||
//if( this.cpu_user+this.cpu_system >= 80 )enumId = "CAUTION";
|
||||
// if( this.cpu_user+this.cpu_system >= 80 )enumId = "CAUTION";
|
||||
return enumId;
|
||||
}
|
||||
|
||||
public String getServerStatusName()
|
||||
{
|
||||
//String enumId = "SAFETY";
|
||||
//if( this.cpu_user+this.cpu_system >= 80 )enumId = "CAUTION";
|
||||
public String getServerStatusName() {
|
||||
// String enumId = "SAFETY";
|
||||
// if( this.cpu_user+this.cpu_system >= 80 )enumId = "CAUTION";
|
||||
return ServerStatus.SAFETY.getText();
|
||||
}
|
||||
|
||||
public String getCpuStatus()
|
||||
{
|
||||
public String getCpuStatus() {
|
||||
String enumId = "SAFETY";
|
||||
if( this.cpu_user+this.cpu_system >= 80 )enumId = "CAUTION";
|
||||
if (this.cpu_user + this.cpu_system >= 80) {
|
||||
enumId = "CAUTION";
|
||||
}
|
||||
return enumId;
|
||||
}
|
||||
|
||||
public String getGpuStatus()
|
||||
{
|
||||
public String getGpuStatus() {
|
||||
String enumId = "SAFETY";
|
||||
if( this.gpuUtil >= 80 )enumId = "CAUTION";
|
||||
if (this.gpuUtil >= 80) {
|
||||
enumId = "CAUTION";
|
||||
}
|
||||
return enumId;
|
||||
}
|
||||
|
||||
public String getMemStatus()
|
||||
{
|
||||
public String getMemStatus() {
|
||||
String enumId = "SAFETY";
|
||||
if( this.memused >= 80 )enumId = "CAUTION";
|
||||
if (this.memused >= 80) {
|
||||
enumId = "CAUTION";
|
||||
}
|
||||
return enumId;
|
||||
}
|
||||
|
||||
public String getCpuStatusName()
|
||||
{
|
||||
if( this.cpu_user+this.cpu_system >= 80 )return ServerStatus.CAUTION.getText();
|
||||
public String getCpuStatusName() {
|
||||
if (this.cpu_user + this.cpu_system >= 80) {
|
||||
return ServerStatus.CAUTION.getText();
|
||||
}
|
||||
return ServerStatus.SAFETY.getText();
|
||||
}
|
||||
|
||||
public String getGpuStatusName()
|
||||
{
|
||||
if( this.gpuUtil >= 80 )return ServerStatus.CAUTION.getText();
|
||||
public String getGpuStatusName() {
|
||||
if (this.gpuUtil >= 80) {
|
||||
return ServerStatus.CAUTION.getText();
|
||||
}
|
||||
return ServerStatus.SAFETY.getText();
|
||||
}
|
||||
|
||||
public String getMemStatusName()
|
||||
{
|
||||
if( this.memused >= 80 )return ServerStatus.CAUTION.getText();
|
||||
public String getMemStatusName() {
|
||||
if (this.memused >= 80) {
|
||||
return ServerStatus.CAUTION.getText();
|
||||
}
|
||||
return ServerStatus.SAFETY.getText();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum ServerStatus implements EnumType {
|
||||
@@ -360,4 +363,17 @@ public class InferenceResultDto {
|
||||
return desc;
|
||||
}
|
||||
}
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public static class SaveInferenceAiDto {
|
||||
|
||||
private UUID uuid;
|
||||
private Long batchId;
|
||||
private String status;
|
||||
private String type;
|
||||
private ZonedDateTime inferStartDttm;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,8 @@ import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.InferenceStatusDe
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.MapSheetNumDto;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.MapSheetScope;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.ResultList;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.SaveInferenceAiDto;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.Status;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceSendDto;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceSendDto.pred_requests_areas;
|
||||
import com.kamco.cd.kamcoback.mapsheet.dto.MapSheetMngDto.MngListCompareDto;
|
||||
@@ -25,6 +27,7 @@ import com.kamco.cd.kamcoback.postgres.core.InferenceResultCoreService;
|
||||
import com.kamco.cd.kamcoback.postgres.core.MapSheetMngCoreService;
|
||||
import com.kamco.cd.kamcoback.postgres.core.ModelMngCoreService;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -200,7 +203,14 @@ public class InferenceResultService {
|
||||
m3.setPred_requests_areas(predRequestsAreas);
|
||||
|
||||
Long batchId = this.ensureAccepted(m1);
|
||||
inferenceResultCoreService.update(uuid, batchId, "IN_PROGRESS");
|
||||
|
||||
SaveInferenceAiDto saveInferenceAiDto = new SaveInferenceAiDto();
|
||||
saveInferenceAiDto.setUuid(uuid);
|
||||
saveInferenceAiDto.setBatchId(batchId);
|
||||
saveInferenceAiDto.setStatus(Status.IN_PROGRESS.getId());
|
||||
saveInferenceAiDto.setType("M1");
|
||||
saveInferenceAiDto.setInferStartDttm(ZonedDateTime.now());
|
||||
inferenceResultCoreService.update(saveInferenceAiDto);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user