From 5e0471988ea8b5a8c85d614cb0bc2ac40c5598ed Mon Sep 17 00:00:00 2001 From: Macbook Date: Mon, 27 Jul 2026 23:12:25 +0900 Subject: [PATCH] Deploy: GitHub submodule sync 2026-07-27 23:12:25 --- chatbotApi-chatbot2.0-agent | 2 +- chatbotApp-chatbot2.0-agent | 2 +- server-dev/start-all-server.sh | 66 +++++++++++++++++++++++++++------- 3 files changed, 56 insertions(+), 14 deletions(-) diff --git a/chatbotApi-chatbot2.0-agent b/chatbotApi-chatbot2.0-agent index 88ae725..541c88c 160000 --- a/chatbotApi-chatbot2.0-agent +++ b/chatbotApi-chatbot2.0-agent @@ -1 +1 @@ -Subproject commit 88ae7259a93a92c4cbbac1f4574b05d2a3c52c84 +Subproject commit 541c88c09b4ca7687ba130ad12d26feca3bd1a1e diff --git a/chatbotApp-chatbot2.0-agent b/chatbotApp-chatbot2.0-agent index d5b4f14..52d09a8 160000 --- a/chatbotApp-chatbot2.0-agent +++ b/chatbotApp-chatbot2.0-agent @@ -1 +1 @@ -Subproject commit d5b4f14694059540dc6082b2a4896baa5d45515b +Subproject commit 52d09a8273f649c276a7928748a5ad6454ce2bab diff --git a/server-dev/start-all-server.sh b/server-dev/start-all-server.sh index 10d1893..63ece1f 100755 --- a/server-dev/start-all-server.sh +++ b/server-dev/start-all-server.sh @@ -454,16 +454,39 @@ ensure_java() { start_java_service() { local name="$1" dir="$2" pid_file="$3" log_file="$4" shift 4 + local port="" + case "${name}" in + chatbotApi) port="${WAS_PORT}" ;; + kakaoChatbotSkill) port="${SKILL_PORT}" ;; + esac + if [[ -f "${pid_file}" ]]; then local old_pid old_pid="$(cat "${pid_file}")" if kill -0 "$old_pid" 2>/dev/null; then - log "${name} 이미 실행 중 (PID ${old_pid})" - return 0 + if [[ -n "${port}" ]] && lsof -iTCP:"${port}" -sTCP:LISTEN >/dev/null 2>&1; then + log "${name} 이미 실행 중 (PID ${old_pid}, :${port})" + return 0 + fi + # pid 는 있으나 포트 미개방 → 좀비/실패 프로세스 정리 + kill "$old_pid" 2>/dev/null || true fi rm -f "${pid_file}" fi + + [[ -n "${JAVA_HOME}" ]] || ensure_java chmod +x "${dir}/gradlew" + + # release=8 프로젝트는 Java 8 API만 허용. 기동 전 컴파일로 실패를 즉시 드러낸다. + log "${name} 컴파일 확인 (Java ${JAVA_HOME})..." + if ! ( + cd "${dir}" + export JAVA_HOME + ./gradlew -Dorg.gradle.java.home="${JAVA_HOME}" compileJava --quiet + ); then + fail "${name} 컴파일 실패 — ${dir} 소스/JDK 확인 (Java 8 API만 사용, isBlank/List.of 금지)" + fi + log "${name} 기동 중..." : > "${log_file}" ( @@ -474,6 +497,15 @@ start_java_service() { echo $! > "${pid_file}" ) log "${name} PID $(cat "${pid_file}") → ${log_file}" + + if [[ -n "${port}" ]]; then + if ! wait_port "${port}" "${name}" 240; then + warn "${name} :${port} 미개방 — 최근 로그:" + tail -40 "${log_file}" 2>/dev/null | sed 's/^/ /' || true + return 1 + fi + fi + return 0 } build_chatbot_app() { @@ -535,6 +567,16 @@ verify_stack() { log "❌ RAG 가 운영 WAS(172.16.180.130) 를 참조 중: ${rag_was}" ok=false fi + # 로컬 WAS tool 정의 로드 (음식메뉴 등 WEB tool 전제) + local tools_json + tools_json="$(curl -sf -m 8 -H "X-Internal-Tool-Key: ${INTERNAL_TOOL_API_KEY}" \ + "http://127.0.0.1:${WAS_PORT}/api/v1/tools/definitions" 2>/dev/null || true)" + if ! echo "${tools_json}" | grep -q 'REST_AREA_FOOD_LIST'; then + log "❌ chatbotApi tool 정의에 REST_AREA_FOOD_LIST 없음 (WAS 미기동/연동 실패)" + ok=false + else + log "✅ chatbotApi domain tools OK" + fi if $ok; then log "✅ 전체 스택 정상"; return 0; fi log "⚠️ 일부 서비스 미응답 — ${LOG_DIR}/ 확인" return 1 @@ -568,13 +610,7 @@ start_rag if ! $SKIP_JAVA; then ensure_java - start_java_service "chatbotApi" "${API_DIR}" \ - "${RUN_DIR}/chatbot-api.pid" "${LOG_DIR}/chatbot-api.log" \ - "INTERNAL_TOOL_API_KEY=${INTERNAL_TOOL_API_KEY}" \ - "SKILL_INTERNAL_BASE_URL=http://127.0.0.1:${SKILL_PORT}" \ - "RAG_SERVER_HOST=127.0.0.1" \ - "RAG_SERVER_PORT=${RAG_PORT}" - + # Skill 먼저 (WAS WEB tool 이 Skill data-portal 을 역호출) start_java_service "kakaoChatbotSkill" "${SKILL_DIR}" \ "${RUN_DIR}/kakao-skill.pid" "${LOG_DIR}/kakao-skill.log" \ "EXDEV_LOCAL=true" \ @@ -582,10 +618,16 @@ if ! $SKIP_JAVA; then "RAG_AGENT_CHAT_URL=http://127.0.0.1:${RAG_PORT}/agent/chat" \ "CHATBOT_API_BASE_URL=http://127.0.0.1:${WAS_PORT}/api/" \ "INTERNAL_TOOL_API_KEY=${INTERNAL_TOOL_API_KEY}" \ - "CHATBOT_APP_URL=${PUBLIC_BASE_URL}/chatbot/ai/" + "CHATBOT_APP_URL=${PUBLIC_BASE_URL}/chatbot/ai/" \ + || warn "kakaoChatbotSkill 기동 실패" - wait_port "${WAS_PORT}" "chatbotApi" 240 || true - wait_port "${SKILL_PORT}" "kakaoChatbotSkill" 240 || true + start_java_service "chatbotApi" "${API_DIR}" \ + "${RUN_DIR}/chatbot-api.pid" "${LOG_DIR}/chatbot-api.log" \ + "INTERNAL_TOOL_API_KEY=${INTERNAL_TOOL_API_KEY}" \ + "SKILL_INTERNAL_BASE_URL=http://127.0.0.1:${SKILL_PORT}" \ + "RAG_SERVER_HOST=127.0.0.1" \ + "RAG_SERVER_PORT=${RAG_PORT}" \ + || warn "chatbotApi 기동 실패" fi start_chatbot_app