Compare commits
2 Commits
6f44319d33
...
2508f59a72
| Author | SHA1 | Date | |
|---|---|---|---|
| 2508f59a72 | |||
| f2307ff0f4 |
@@ -446,13 +446,22 @@ public class InferenceResultService {
|
|||||||
*
|
*
|
||||||
* @param dto
|
* @param dto
|
||||||
*/
|
*/
|
||||||
|
// 같은함수가 왜 두개지
|
||||||
private Long ensureAccepted(InferenceSendDto dto) {
|
private Long ensureAccepted(InferenceSendDto dto) {
|
||||||
|
|
||||||
if (dto == null) {
|
if (dto == null) {
|
||||||
log.warn("not InferenceSendDto dto");
|
log.warn("not InferenceSendDto dto");
|
||||||
throw new CustomApiException("BAD_REQUEST", HttpStatus.BAD_REQUEST);
|
throw new CustomApiException("BAD_REQUEST", HttpStatus.BAD_REQUEST);
|
||||||
}
|
}
|
||||||
dto.changeValForProd();
|
|
||||||
|
// [중복]운영환경일때 경로수정 dean 260226
|
||||||
|
if (profile != null && profile.equals("prod")) {
|
||||||
|
log.info("========================================================");
|
||||||
|
log.info("[CHANGE INFERENCE] profile = {} Inforence req", profile);
|
||||||
|
log.info("========================================================");
|
||||||
|
log.info("");
|
||||||
|
dto.changeValForProd();
|
||||||
|
}
|
||||||
|
|
||||||
// 1) 요청 로그
|
// 1) 요청 로그
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ public class InferenceRunService {
|
|||||||
@Value("${inference.url}")
|
@Value("${inference.url}")
|
||||||
private String inferenceUrl;
|
private String inferenceUrl;
|
||||||
|
|
||||||
|
// TODO 이거 쓰는건가?
|
||||||
public void run(Integer compareYear, Integer targetYear, UUID modelUuid) {
|
public void run(Integer compareYear, Integer targetYear, UUID modelUuid) {
|
||||||
|
|
||||||
List<String> compareList = mapSheetMngCoreService.getMapSheetMngHst(compareYear);
|
List<String> compareList = mapSheetMngCoreService.getMapSheetMngHst(compareYear);
|
||||||
@@ -131,7 +132,7 @@ public class InferenceRunService {
|
|||||||
|
|
||||||
// 1) 요청 로그
|
// 1) 요청 로그
|
||||||
try {
|
try {
|
||||||
log.debug("Inference request dto={}", objectMapper.writeValueAsString(dto));
|
log.info("Inference request dto={}", objectMapper.writeValueAsString(dto));
|
||||||
} catch (JsonProcessingException e) {
|
} catch (JsonProcessingException e) {
|
||||||
log.warn("Failed to serialize inference dto", e);
|
log.warn("Failed to serialize inference dto", e);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -342,7 +342,7 @@ public class MapSheetInferenceJobService {
|
|||||||
predRequestsAreas.setInput2_scene_path(
|
predRequestsAreas.setInput2_scene_path(
|
||||||
progressDto.getPred_requests_areas().getInput2_scene_path());
|
progressDto.getPred_requests_areas().getInput2_scene_path());
|
||||||
|
|
||||||
InferenceSendDto m = new InferenceSendDto();
|
InferenceSendDto m = new InferenceSendDto();
|
||||||
m.setPred_requests_areas(predRequestsAreas);
|
m.setPred_requests_areas(predRequestsAreas);
|
||||||
m.setModel_version(progressDto.getModelVersion());
|
m.setModel_version(progressDto.getModelVersion());
|
||||||
m.setCd_model_path(
|
m.setCd_model_path(
|
||||||
@@ -375,12 +375,13 @@ public class MapSheetInferenceJobService {
|
|||||||
* @param dto
|
* @param dto
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
// 같은함수가 왜 두개지
|
||||||
private Long ensureAccepted(InferenceSendDto dto) {
|
private Long ensureAccepted(InferenceSendDto dto) {
|
||||||
if (dto == null) {
|
if (dto == null) {
|
||||||
log.warn("not InferenceSendDto dto");
|
log.warn("not InferenceSendDto dto");
|
||||||
throw new CustomApiException("BAD_REQUEST", HttpStatus.BAD_REQUEST);
|
throw new CustomApiException("BAD_REQUEST", HttpStatus.BAD_REQUEST);
|
||||||
}
|
}
|
||||||
// 운영환경일때 경로수정 dean 260226
|
// [중복운영환경일때 경로수정 dean 260226
|
||||||
if (profile != null && profile.equals("prod")) {
|
if (profile != null && profile.equals("prod")) {
|
||||||
log.info("========================================================");
|
log.info("========================================================");
|
||||||
log.info("[CHANGE INFERENCE] profile = {} Inforence req", profile);
|
log.info("[CHANGE INFERENCE] profile = {} Inforence req", profile);
|
||||||
@@ -390,11 +391,11 @@ public class MapSheetInferenceJobService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 1) 요청 로그
|
// 1) 요청 로그
|
||||||
log.info("========================================================");
|
log.info("");
|
||||||
log.info("========================================================");
|
log.info("========================================================");
|
||||||
log.info("[SEND INFERENCE] Inference request dto={}", dto);
|
log.info("[SEND INFERENCE] Inference request dto={}", dto);
|
||||||
log.info("========================================================");
|
log.info("========================================================");
|
||||||
|
log.info("");
|
||||||
// 2) local 환경 임시 처리
|
// 2) local 환경 임시 처리
|
||||||
if ("local".equals(profile)) {
|
if ("local".equals(profile)) {
|
||||||
if (dto.getPred_requests_areas() == null) {
|
if (dto.getPred_requests_areas() == null) {
|
||||||
@@ -409,6 +410,7 @@ public class MapSheetInferenceJobService {
|
|||||||
headers.setContentType(MediaType.APPLICATION_JSON);
|
headers.setContentType(MediaType.APPLICATION_JSON);
|
||||||
headers.setAccept(List.of(MediaType.APPLICATION_JSON));
|
headers.setAccept(List.of(MediaType.APPLICATION_JSON));
|
||||||
|
|
||||||
|
// TODO 어떤 URL로 어떤파리티러로 요청한 로딩해야지
|
||||||
ExternalCallResult<String> result =
|
ExternalCallResult<String> result =
|
||||||
externalHttpClient.call(inferenceUrl, HttpMethod.POST, dto, headers, String.class);
|
externalHttpClient.call(inferenceUrl, HttpMethod.POST, dto, headers, String.class);
|
||||||
|
|
||||||
@@ -423,6 +425,7 @@ public class MapSheetInferenceJobService {
|
|||||||
objectMapper.readValue(result.body(), new TypeReference<>() {});
|
objectMapper.readValue(result.body(), new TypeReference<>() {});
|
||||||
|
|
||||||
if (list.isEmpty()) {
|
if (list.isEmpty()) {
|
||||||
|
// 어떤 URL로 어떤파리티러로 요청한 정보를 봐야 재현을 할듯하지요
|
||||||
throw new IllegalStateException("Inference response is empty");
|
throw new IllegalStateException("Inference response is empty");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user