트랜젝션처리 임시폴더 uid업데이트 #95
@@ -8,9 +8,11 @@ import java.util.Map;
|
|||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.log4j.Log4j2;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
@Log4j2
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@Transactional(readOnly = true)
|
@Transactional(readOnly = true)
|
||||||
@@ -92,6 +94,8 @@ public class ModelTrainJobCoreService {
|
|||||||
job.setExitCode(exitCode);
|
job.setExitCode(exitCode);
|
||||||
job.setErrorMessage(errorMessage);
|
job.setErrorMessage(errorMessage);
|
||||||
job.setFinishedDttm(ZonedDateTime.now());
|
job.setFinishedDttm(ZonedDateTime.now());
|
||||||
|
|
||||||
|
log.info("[TRAIN JOB FAIL] jobId={}, modelId={}", jobId, errorMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 취소 처리 */
|
/** 취소 처리 */
|
||||||
|
|||||||
@@ -380,7 +380,6 @@ public class DockerTrainService {
|
|||||||
synchronized (log) {
|
synchronized (log) {
|
||||||
logs = log.toString();
|
logs = log.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
return new TrainRunResult(null, containerName, -1, "TIMEOUT", logs);
|
return new TrainRunResult(null, containerName, -1, "TIMEOUT", logs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,12 +17,14 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.log4j.Log4j2;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.context.ApplicationEventPublisher;
|
import org.springframework.context.ApplicationEventPublisher;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
|
@Log4j2
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@Transactional(readOnly = true)
|
@Transactional(readOnly = true)
|
||||||
public class TrainJobService {
|
public class TrainJobService {
|
||||||
@@ -237,7 +239,24 @@ public class TrainJobService {
|
|||||||
// 학습모델을 수정한다.
|
// 학습모델을 수정한다.
|
||||||
modelTrainMngCoreService.updateModelMaster(modelId, updateReq);
|
modelTrainMngCoreService.updateModelMaster(modelId, updateReq);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new RuntimeException(e);
|
log.error(
|
||||||
|
"createTmpFile failed. modelUuid={}, modelId={}, tmpRaw={}, datasetIdsSize={}, uidsSize={}",
|
||||||
|
modelUuid,
|
||||||
|
modelId,
|
||||||
|
raw,
|
||||||
|
(datasetIds == null ? null : datasetIds.size()),
|
||||||
|
(uids == null ? null : uids.size()),
|
||||||
|
e);
|
||||||
|
|
||||||
|
// 런타임 예외로 래핑하되, 메시지에 핵심 정보 포함
|
||||||
|
throw new IllegalStateException(
|
||||||
|
"tmp dataset build failed: modelUuid="
|
||||||
|
+ modelUuid
|
||||||
|
+ ", modelId="
|
||||||
|
+ modelId
|
||||||
|
+ ", tmpRaw="
|
||||||
|
+ raw,
|
||||||
|
e);
|
||||||
}
|
}
|
||||||
return modelUuid;
|
return modelUuid;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,11 +11,13 @@ import com.kamco.cd.training.train.dto.TrainRunRequest;
|
|||||||
import com.kamco.cd.training.train.dto.TrainRunResult;
|
import com.kamco.cd.training.train.dto.TrainRunResult;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.log4j.Log4j2;
|
||||||
import org.springframework.scheduling.annotation.Async;
|
import org.springframework.scheduling.annotation.Async;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.transaction.event.TransactionPhase;
|
import org.springframework.transaction.event.TransactionPhase;
|
||||||
import org.springframework.transaction.event.TransactionalEventListener;
|
import org.springframework.transaction.event.TransactionalEventListener;
|
||||||
|
|
||||||
|
@Log4j2
|
||||||
@Component
|
@Component
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class TrainJobWorker {
|
public class TrainJobWorker {
|
||||||
@@ -118,7 +120,7 @@ public class TrainJobWorker {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
modelTrainJobCoreService.markFailed(jobId, null, e.toString());
|
modelTrainJobCoreService.markFailed(jobId, null, e.getMessage());
|
||||||
|
|
||||||
if ("EVAL".equals(params.get("jobType"))) {
|
if ("EVAL".equals(params.get("jobType"))) {
|
||||||
modelTrainMngCoreService.markStep2Error(modelId, e.getMessage());
|
modelTrainMngCoreService.markStep2Error(modelId, e.getMessage());
|
||||||
|
|||||||
Reference in New Issue
Block a user