status-update jar 로직 추가
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
spring:
|
||||
config:
|
||||
activate:
|
||||
on-profile: dev
|
||||
|
||||
jpa:
|
||||
show-sql: false
|
||||
hibernate:
|
||||
ddl-auto: validate
|
||||
properties:
|
||||
hibernate:
|
||||
default_batch_fetch_size: 100 # ✅ 성능 - N+1 쿼리 방지
|
||||
order_updates: true # ✅ 성능 - 업데이트 순서 정렬로 데드락 방지
|
||||
order_inserts: true
|
||||
use_sql_comments: true # ⚠️ 선택 - SQL에 주석 추가 (디버깅용)
|
||||
format_sql: true # ⚠️ 선택 - SQL 포맷팅 (가독성)
|
||||
jdbc:
|
||||
batch_size: 1000 # ✅ 추가 (JDBC batch)
|
||||
open-in-view: false
|
||||
mvc:
|
||||
async:
|
||||
request-timeout: 300s # 5분 (예: 30s, 120s, 10m 등도 가능)
|
||||
|
||||
datasource:
|
||||
url: jdbc:postgresql://192.168.2.127:15432/kamco_cds
|
||||
#url: jdbc:postgresql://localhost:15432/kamco_cds
|
||||
username: kamco_cds
|
||||
password: kamco_cds_Q!W@E#R$
|
||||
hikari:
|
||||
minimum-idle: 10
|
||||
maximum-pool-size: 20
|
||||
connection-timeout: 60000 # 60초 연결 타임아웃
|
||||
idle-timeout: 300000 # 5분 유휴 타임아웃
|
||||
max-lifetime: 1800000 # 30분 최대 수명
|
||||
leak-detection-threshold: 60000 # 연결 누수 감지
|
||||
|
||||
transaction:
|
||||
default-timeout: 300 # 5분 트랜잭션 타임아웃
|
||||
|
||||
data:
|
||||
redis:
|
||||
host: 192.168.2.109
|
||||
port: 6379
|
||||
password: kamco
|
||||
|
||||
logging:
|
||||
level:
|
||||
root: INFO
|
||||
org.springframework.web: DEBUG
|
||||
org.springframework.security: DEBUG
|
||||
|
||||
# 헬스체크 노이즈 핵심만 다운
|
||||
org.springframework.security.web.FilterChainProxy: INFO
|
||||
org.springframework.security.web.authentication.AnonymousAuthenticationFilter: INFO
|
||||
org.springframework.security.web.authentication.Http403ForbiddenEntryPoint: INFO
|
||||
org.springframework.web.servlet.DispatcherServlet: INFO
|
||||
|
||||
gukyuin:
|
||||
url: http://192.168.2.129:5301
|
||||
cdi: ${gukyuin.url}/api/kcd/cdi
|
||||
114
gukyuin/status-update/build/resources/main/application-local.yml
Normal file
114
gukyuin/status-update/build/resources/main/application-local.yml
Normal file
@@ -0,0 +1,114 @@
|
||||
spring:
|
||||
config:
|
||||
activate:
|
||||
on-profile: local
|
||||
|
||||
jpa:
|
||||
show-sql: false
|
||||
hibernate:
|
||||
ddl-auto: validate # 로컬만 완화(시킬려면 update으로 변경)
|
||||
properties:
|
||||
hibernate:
|
||||
default_batch_fetch_size: 100 # ✅ 성능 - N+1 쿼리 방지
|
||||
order_updates: true # ✅ 성능 - 업데이트 순서 정렬로 데드락 방지
|
||||
use_sql_comments: true # ⚠️ 선택 - SQL에 주석 추가 (디버깅용)
|
||||
format_sql: true # ⚠️ 선택 - SQL 포맷팅 (가독성)
|
||||
|
||||
datasource:
|
||||
url: jdbc:postgresql://192.168.2.127:15432/kamco_cds
|
||||
# url: jdbc:postgresql://localhost:5432/local_0128
|
||||
username: kamco_cds
|
||||
password: kamco_cds_Q!W@E#R$
|
||||
# username: postgres
|
||||
# password: 1234
|
||||
hikari:
|
||||
minimum-idle: 1
|
||||
maximum-pool-size: 5
|
||||
|
||||
data:
|
||||
redis:
|
||||
host: 192.168.2.109
|
||||
port: 6379
|
||||
password: kamco
|
||||
|
||||
servlet:
|
||||
multipart:
|
||||
enabled: true
|
||||
max-file-size: 4GB
|
||||
max-request-size: 4GB
|
||||
file-size-threshold: 10MB
|
||||
|
||||
server:
|
||||
tomcat:
|
||||
max-swallow-size: 4GB
|
||||
max-http-form-post-size: 4GB
|
||||
|
||||
jwt:
|
||||
secret: "kamco_token_9b71e778-19a3-4c1d-97bf-2d687de17d5b"
|
||||
access-token-validity-in-ms: 86400000 # 1일
|
||||
refresh-token-validity-in-ms: 604800000 # 7일
|
||||
|
||||
token:
|
||||
refresh-cookie-name: kamco-local # 개발용 쿠키 이름
|
||||
refresh-cookie-secure: false # 로컬 http 테스트면 false
|
||||
|
||||
springdoc:
|
||||
swagger-ui:
|
||||
persist-authorization: true # 스웨거 새로고침해도 토큰 유지, 로컬스토리지에 저장
|
||||
|
||||
logging:
|
||||
level:
|
||||
org.hibernate.SQL: debug
|
||||
org.hibernate.orm.jdbc.bind: trace
|
||||
|
||||
mapsheet:
|
||||
upload:
|
||||
skipGdalValidation: true
|
||||
shp:
|
||||
baseurl: /Users/bokmin/detect/result
|
||||
|
||||
|
||||
|
||||
file:
|
||||
sync-root-dir: C:/Users/gypark/kamco-nfs/images/
|
||||
#sync-root-dir: /kamco-nfs/images/
|
||||
sync-tmp-dir: ${file.sync-root-dir}/tmp/
|
||||
sync-file-extention: tfw,tif
|
||||
sync-auto-exception-start-year: 2025
|
||||
sync-auto-exception-before-year-cnt: 3
|
||||
|
||||
dataset-dir: C:/Users/gypark/kamco-nfs/dataset/
|
||||
#dataset-dir: /kamco-nfs/dataset/export/
|
||||
dataset-tmp-dir: ${file.dataset-dir}tmp/
|
||||
|
||||
model-dir: C:/Users/gypark/kamco-nfs/ckpt/model/
|
||||
#model-dir: /kamco-nfs/ckpt/model/
|
||||
model-tmp-dir: ${file.model-dir}tmp/
|
||||
model-file-extention: pth,json,py
|
||||
|
||||
pt-path: /kamco-nfs/ckpt/classification/
|
||||
pt-FileName: v5-best.pt
|
||||
|
||||
dataset-response: /kamco-nfs/dataset/response/
|
||||
|
||||
inference:
|
||||
url: http://10.100.0.11:8000/jobs
|
||||
batch-url: http://10.100.0.11:8000/batches
|
||||
geojson-dir: /kamco-nfs/requests/
|
||||
jar-path: jar/makeshp-1.0.0.jar
|
||||
inference-server-name: server1,server2,server3,server4
|
||||
|
||||
gukyuin:
|
||||
#url: http://localhost:8080
|
||||
url: http://192.168.2.129:5301
|
||||
cdi: ${gukyuin.url}/api/kcd/cdi
|
||||
|
||||
training-data:
|
||||
geojson-dir: /kamco-nfs/model_output/labeling/
|
||||
|
||||
layer:
|
||||
geoserver-url: https://kamco.geo-dev.gs.dabeeo.com
|
||||
wms-path: geoserver/cd
|
||||
wmts-path: geoserver/cd/gwc/service
|
||||
workspace: cd
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
spring:
|
||||
config:
|
||||
activate:
|
||||
on-profile: prod
|
||||
|
||||
jpa:
|
||||
show-sql: true
|
||||
hibernate:
|
||||
ddl-auto: validate
|
||||
properties:
|
||||
hibernate:
|
||||
default_batch_fetch_size: 100 # ✅ 성능 - N+1 쿼리 방지
|
||||
order_updates: true # ✅ 성능 - 업데이트 순서 정렬로 데드락 방지
|
||||
order_inserts: true
|
||||
use_sql_comments: true # ⚠️ 선택 - SQL에 주석 추가 (디버깅용)
|
||||
format_sql: true # ⚠️ 선택 - SQL 포맷팅 (가독성)
|
||||
jdbc:
|
||||
batch_size: 1000 # ✅ 추가 (JDBC batch)
|
||||
open-in-view: false
|
||||
mvc:
|
||||
async:
|
||||
request-timeout: 300s # 5분 (예: 30s, 120s, 10m 등도 가능)
|
||||
|
||||
datasource:
|
||||
url: jdbc:postgresql://kamco-cd-postgis:5432/kamco_cds
|
||||
username: kamco_cds
|
||||
password: kamco_cds_Q!W@E#R$
|
||||
hikari:
|
||||
minimum-idle: 10
|
||||
maximum-pool-size: 20
|
||||
connection-timeout: 60000 # 60초 연결 타임아웃
|
||||
idle-timeout: 300000 # 5분 유휴 타임아웃
|
||||
max-lifetime: 1800000 # 30분 최대 수명
|
||||
leak-detection-threshold: 60000 # 연결 누수 감지
|
||||
|
||||
transaction:
|
||||
default-timeout: 300 # 5분 트랜잭션 타임아웃
|
||||
|
||||
logging:
|
||||
level:
|
||||
root: INFO
|
||||
org.springframework.web: DEBUG
|
||||
org.springframework.security: DEBUG
|
||||
|
||||
gukyuin:
|
||||
url: http://172.16.4.56:15432
|
||||
cdi: ${gukyuin.url}/api/kcd/cdi
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
server:
|
||||
port: 8080
|
||||
|
||||
spring:
|
||||
application:
|
||||
name: kamco-gukyuin-label
|
||||
profiles:
|
||||
active: prod # 사용할 프로파일 지정 (ex. dev, prod, test)
|
||||
@@ -0,0 +1,137 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="ko">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Chunk Upload Test</title>
|
||||
</head>
|
||||
<body>
|
||||
<h2>대용량 파일 청크 업로드 테스트</h2>
|
||||
|
||||
* Chunk 테스트 사이즈 10M (10 * 1024 * 1024) - 성능에 따라 변경가능<br><br>
|
||||
|
||||
* 업로드 API선택</br></br>
|
||||
<select name="apiUrl" id="apiUrl" style="width:600px;height:40px;">
|
||||
<option value="/api/model/file-chunk-upload">모델파일Chunk업로드 ( /api/model/file-chunk-upload )</option>
|
||||
<option value="/api/upload/file-chunk-upload">파일Chunk업로드(공통) ( /api/upload/file-chunk-upload )</option>
|
||||
</select>
|
||||
<br><br>
|
||||
* 파일첨부<br><br>
|
||||
<input type="file" id="chunkFile" style="height:40px;"><br><br>
|
||||
<button onclick="startUpload()" style="height:40px;">업로드 시작</button>
|
||||
<br><br><br><br>
|
||||
* 업로드시 업로드 이력을 추적하기 위해 UUID생성해서 전달(파일병합시 사용)(script 예제참고)</br></br>
|
||||
UUID : <input id="uuid" name="uuid" value="" style="width:300px;height:30px;" readonly><br><br>
|
||||
|
||||
* API 호출시 파일정보 추출해서 자동 할당해야 함.(script 예제참고)</br></br>
|
||||
chunkIndex : <input style="height:30px;" id="chunkIndex" placeholder="chunkIndex" readonly><br><br>
|
||||
chunkTotalIndex : <input style="height:30px;" id="chunkTotalIndex" placeholder="chunkTotalIndex" readonly ><br><br>
|
||||
|
||||
* API 호출시 파일정보 추출해서 자동 할당해야 함.(script 예제참고)</br></br>
|
||||
fileSize : <input style="height:30px;" id="fileSize" placeholder="fileSize" readonly><br><br>
|
||||
<!--
|
||||
fileHash : <input id="fileHash" placeholder="fileHash"><br><br> -->
|
||||
|
||||
|
||||
<br><br>
|
||||
* 진행율(%)</br></br>
|
||||
<div style="width:500px;height:30px;border:1px solid #cccccc;"><div id="prgssbar" style="width:100%;height:30px;background:#eeeeee;"></div></div>
|
||||
<br><br>
|
||||
* 결과메세지</br></br>
|
||||
<div id="status" style="padding:20px;width:1200px;height:600px;border:1px solid #000000;"></div>
|
||||
|
||||
<script>
|
||||
async function startUpload() {
|
||||
|
||||
const apiUrl = document.getElementById('apiUrl').value;
|
||||
const file = document.getElementById('chunkFile').files[0];
|
||||
const fileName = file.name;
|
||||
//const datasetUid = Number(document.getElementById('datasetUid').value);
|
||||
//const chunkIndex = document.getElementById('chunkIndex').value;
|
||||
if (!file) return alert("파일을 선택하세요.");
|
||||
|
||||
const CHUNK_SIZE = 10 * 1024 * 1024; // 5MB
|
||||
const fileSize = file.size;
|
||||
var totalChunks = Math.ceil(fileSize / CHUNK_SIZE);
|
||||
const chunkTotalIndex = totalChunks - 1;
|
||||
const uuid = crypto.randomUUID(); // 고유 ID 생성
|
||||
|
||||
//var uuid = "";
|
||||
|
||||
|
||||
document.getElementById('uuid').value = uuid;
|
||||
document.getElementById('fileSize').value = file.size;
|
||||
document.getElementById('chunkTotalIndex').value = chunkTotalIndex;
|
||||
|
||||
|
||||
for (let i = 0; i < totalChunks; i++) {
|
||||
//for (let i = 0; i < 1; i++) {
|
||||
const start = i * CHUNK_SIZE;
|
||||
const end = Math.min(start + CHUNK_SIZE, file.size);
|
||||
const chunk = file.slice(start, end);
|
||||
|
||||
document.getElementById('chunkIndex').value = i;
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append("uuid", uuid);
|
||||
formData.append("fileSize", fileSize);
|
||||
formData.append("fileName", fileName);
|
||||
formData.append("chunkIndex", i);
|
||||
formData.append("chunkTotalIndex", chunkTotalIndex);
|
||||
formData.append("chunkFile", chunk);
|
||||
|
||||
try {
|
||||
const response = await fetch(apiUrl, { method: 'POST', body: formData });
|
||||
|
||||
// 2. 응답 상태 확인 (200 OK 등)
|
||||
if (!response.ok) {
|
||||
throw new Error(`서버 에러: ${response.status}`);
|
||||
}
|
||||
|
||||
// 3. 서버가 보낸 데이터 읽기 (JSON 형태라고 가정)
|
||||
const result = await response.json();
|
||||
document.getElementById('status').innerText = JSON.stringify(result, null, 2);
|
||||
if( result.data.res != "success")
|
||||
{
|
||||
//오류 경고창 띄우는 것으로 처리하시면 됩니다.
|
||||
break;
|
||||
}
|
||||
|
||||
document.getElementById('prgssbar').style.width = result.data.uploadRate+"%";
|
||||
|
||||
} catch (error) {
|
||||
console.error(`${i}번째 청크 업로드 실패:`, error);
|
||||
break; // 오류 발생 시 중단
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// 모든 청크 전송 후 최종 완료 요청
|
||||
//var mergeResult = await completeUpload(uuid);
|
||||
//document.getElementById('status').innerText = JSON.stringify(mergeResult, null, 2);
|
||||
|
||||
}
|
||||
|
||||
|
||||
async function completeUpload(uuid) {
|
||||
try {
|
||||
const response = await fetch(`/api/upload/chunk-upload-complete/${uuid}`, {
|
||||
method: 'PUT',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(`서ver 응답 에러: ${response.status}`);
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
return result;
|
||||
|
||||
} catch (error) {
|
||||
console.error("완료 요청 중 오류 발생:", error);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user