Deploy: GitHub submodule sync 2026-07-27 22:08:13
This commit is contained in:
Submodule chatbotApp-chatbot2.0-agent updated: 25356df503...8cd153d7cc
Submodule exAiChatBot-chatbot2.0-agent updated: 7d7c9125fc...e67c39b716
+19
-3
@@ -8,7 +8,8 @@
|
|||||||
# ./git_fetch_all.sh --no-commit # fetch/merge만 (commit·push 생략)
|
# ./git_fetch_all.sh --no-commit # fetch/merge만 (commit·push 생략)
|
||||||
#
|
#
|
||||||
# commit 시 운영 WAS/RAG 기본 주소(172.16.180.130)를 복원합니다.
|
# commit 시 운영 WAS/RAG 기본 주소(172.16.180.130)를 복원합니다.
|
||||||
# exdev 로컬 주소(127.0.0.1 / host.docker.internal)는 .env·start 스크립트로만 사용합니다.
|
# exdev 런타임 주소(127.0.0.1 / host.docker.internal)는 .env·start 스크립트·EXDEV_LOCAL 로만 사용하며
|
||||||
|
# GitHub 에는 커밋하지 않습니다.
|
||||||
#
|
#
|
||||||
# 대상 (.gitmodules) — 모두 branch=chatbot2.0-agent (main 사용 안 함):
|
# 대상 (.gitmodules) — 모두 branch=chatbot2.0-agent (main 사용 안 함):
|
||||||
# chatbotApi-chatbot2.0-agent
|
# chatbotApi-chatbot2.0-agent
|
||||||
@@ -111,6 +112,8 @@ restore_monorepo_overlays() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# GitHub push 전: 로컬(exdev) WAS 주소를 커밋하지 않고 운영 기본값(172.16.180.130) 유지
|
# GitHub push 전: 로컬(exdev) WAS 주소를 커밋하지 않고 운영 기본값(172.16.180.130) 유지
|
||||||
|
# - 런타임(exdev): start-all-server.sh / .env / EXDEV_LOCAL=true → 127.0.0.1·host.docker.internal
|
||||||
|
# - 커밋/push: 아래 복원으로 application.yml·env.template·chatbot_tool_client.py 기본값을 운영 IP로 고정
|
||||||
PROD_WAS_API="http://172.16.180.130:8086/api"
|
PROD_WAS_API="http://172.16.180.130:8086/api"
|
||||||
PROD_RAG_CHAT="http://172.16.180.130:28012/agent/chat"
|
PROD_RAG_CHAT="http://172.16.180.130:28012/agent/chat"
|
||||||
|
|
||||||
@@ -127,19 +130,32 @@ restore_production_endpoints_before_commit() {
|
|||||||
perl -i -pe "s|RAG_AGENT_CHAT_URL:[^}]+}|RAG_AGENT_CHAT_URL:${PROD_RAG_CHAT}}|g" "${yml}"
|
perl -i -pe "s|RAG_AGENT_CHAT_URL:[^}]+}|RAG_AGENT_CHAT_URL:${PROD_RAG_CHAT}}|g" "${yml}"
|
||||||
# trailing slash normalize for api default
|
# trailing slash normalize for api default
|
||||||
perl -i -pe "s|CHATBOT_API_BASE_URL:http://172\.16\.180\.130:8086/api/\}|CHATBOT_API_BASE_URL:http://172.16.180.130:8086/api/}|g" "${yml}"
|
perl -i -pe "s|CHATBOT_API_BASE_URL:http://172\.16\.180\.130:8086/api/\}|CHATBOT_API_BASE_URL:http://172.16.180.130:8086/api/}|g" "${yml}"
|
||||||
|
if grep -qE '127\.0\.0\.1:8086|host\.docker\.internal:8086|127\.0\.0\.1:28012' "${yml}"; then
|
||||||
|
warn "${path}: application.yml 에 로컬 주소가 남아 있을 수 있음 — 확인 필요"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
exAiChatBot-chatbot2.0-agent)
|
exAiChatBot-chatbot2.0-agent)
|
||||||
if [[ -f "${dir}/env.template" ]]; then
|
if [[ -f "${dir}/env.template" ]]; then
|
||||||
perl -i -pe "s|^CHATBOT_API_BASE_URL=.*|CHATBOT_API_BASE_URL=${PROD_WAS_API}|" "${dir}/env.template"
|
perl -i -pe "s|^CHATBOT_API_BASE_URL=.*|CHATBOT_API_BASE_URL=${PROD_WAS_API}|" "${dir}/env.template"
|
||||||
|
# EXDEV_LOCAL 은 커밋 템플릿에 넣지 않음 (server-dev 전용)
|
||||||
|
perl -i -ne 'print unless /^EXDEV_LOCAL=/' "${dir}/env.template"
|
||||||
fi
|
fi
|
||||||
if [[ -f "${dir}/env.example" ]]; then
|
if [[ -f "${dir}/env.example" ]]; then
|
||||||
perl -i -pe "s|^CHATBOT_API_BASE_URL=.*|CHATBOT_API_BASE_URL=${PROD_WAS_API}|" "${dir}/env.example" 2>/dev/null || true
|
perl -i -pe "s|^CHATBOT_API_BASE_URL=.*|CHATBOT_API_BASE_URL=${PROD_WAS_API}|" "${dir}/env.example" 2>/dev/null || true
|
||||||
|
perl -i -ne 'print unless /^EXDEV_LOCAL=/' "${dir}/env.example" 2>/dev/null || true
|
||||||
fi
|
fi
|
||||||
if [[ -f "${dir}/scripts/agent/chatbot_tool_client.py" ]]; then
|
if [[ -f "${dir}/scripts/agent/chatbot_tool_client.py" ]]; then
|
||||||
perl -i -pe 's|"http://127\.0\.0\.1:8086/api"|"http://172.16.180.130:8086/api"|g' \
|
# 운영 기본값(_PROD_WAS_API / legacy getenv default)만 복원.
|
||||||
|
# _EXDEV_WAS_API(host.docker.internal) 는 exdev 차단용이라 건드리지 않는다.
|
||||||
|
perl -i -pe 's|_PROD_WAS_API = "http://[^"]+"|_PROD_WAS_API = "http://172.16.180.130:8086/api"|g' \
|
||||||
"${dir}/scripts/agent/chatbot_tool_client.py"
|
"${dir}/scripts/agent/chatbot_tool_client.py"
|
||||||
perl -i -pe 's|"http://host\.docker\.internal:8086/api"|"http://172.16.180.130:8086/api"|g' \
|
perl -i -pe 's|os\.getenv\("TOOL_API_BASE_URL", "http://127\.0\.0\.1:8086/api"\)|os.getenv("TOOL_API_BASE_URL", "http://172.16.180.130:8086/api")|g' \
|
||||||
|
"${dir}/scripts/agent/chatbot_tool_client.py"
|
||||||
|
perl -i -pe 's|os\.getenv\("TOOL_API_BASE_URL", "http://host\.docker\.internal:8086/api"\)|os.getenv("TOOL_API_BASE_URL", "http://172.16.180.130:8086/api")|g' \
|
||||||
|
"${dir}/scripts/agent/chatbot_tool_client.py"
|
||||||
|
# 구형 한 줄 기본값 형태도 운영 IP로 고정
|
||||||
|
perl -i -pe 's|os\.getenv\("TOOL_API_BASE_URL", "http://[^"]+"\)|os.getenv("TOOL_API_BASE_URL", "http://172.16.180.130:8086/api")|g' \
|
||||||
"${dir}/scripts/agent/chatbot_tool_client.py"
|
"${dir}/scripts/agent/chatbot_tool_client.py"
|
||||||
fi
|
fi
|
||||||
# monorepo overlay compose 는 push 대상에서 제외 (로컬 exdev 전용)
|
# monorepo overlay compose 는 push 대상에서 제외 (로컬 exdev 전용)
|
||||||
|
|||||||
@@ -164,6 +164,7 @@ ensure_rag_env() {
|
|||||||
patch_env "TEI_RERANK_URL" "http://host.docker.internal:${RERANK_PORT}"
|
patch_env "TEI_RERANK_URL" "http://host.docker.internal:${RERANK_PORT}"
|
||||||
patch_env "EMBED_API_STYLE" "tei"
|
patch_env "EMBED_API_STYLE" "tei"
|
||||||
patch_env "RERANK_API_STYLE" "legacy"
|
patch_env "RERANK_API_STYLE" "legacy"
|
||||||
|
patch_env "EXDEV_LOCAL" "true"
|
||||||
patch_env "CHATBOT_API_BASE_URL" "http://host.docker.internal:${WAS_PORT}/api"
|
patch_env "CHATBOT_API_BASE_URL" "http://host.docker.internal:${WAS_PORT}/api"
|
||||||
patch_env "INTERNAL_TOOL_API_KEY" "${INTERNAL_TOOL_API_KEY}"
|
patch_env "INTERNAL_TOOL_API_KEY" "${INTERNAL_TOOL_API_KEY}"
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,8 @@ services:
|
|||||||
LLM_BASE_URL: http://host.docker.internal:16000
|
LLM_BASE_URL: http://host.docker.internal:16000
|
||||||
TEI_EMBED_URL: http://host.docker.internal:16001
|
TEI_EMBED_URL: http://host.docker.internal:16001
|
||||||
TEI_RERANK_URL: http://host.docker.internal:16002
|
TEI_RERANK_URL: http://host.docker.internal:16002
|
||||||
# exdev: 호스트에서 기동한 chatbotApi(WAS). 운영 기본값(172.16.180.130)은 git push 대상 코드에만 유지.
|
# exdev: 호스트 chatbotApi. 운영 IP(172.16.180.130)는 git_fetch_all 커밋 기본값에만 유지.
|
||||||
|
EXDEV_LOCAL: ${EXDEV_LOCAL:-true}
|
||||||
CHATBOT_API_BASE_URL: ${CHATBOT_API_BASE_URL:-http://host.docker.internal:8086/api}
|
CHATBOT_API_BASE_URL: ${CHATBOT_API_BASE_URL:-http://host.docker.internal:8086/api}
|
||||||
INTERNAL_TOOL_API_KEY: ${INTERNAL_TOOL_API_KEY:-exdev-agent-tool-key}
|
INTERNAL_TOOL_API_KEY: ${INTERNAL_TOOL_API_KEY:-exdev-agent-tool-key}
|
||||||
CHATBOT_TOOL_TIMEOUT: ${CHATBOT_TOOL_TIMEOUT:-60}
|
CHATBOT_TOOL_TIMEOUT: ${CHATBOT_TOOL_TIMEOUT:-60}
|
||||||
|
|||||||
@@ -32,8 +32,11 @@ QDRANT_PORT=6333
|
|||||||
QDRANT_COLLECTION=qa_vectors_v2
|
QDRANT_COLLECTION=qa_vectors_v2
|
||||||
|
|
||||||
# ── Agent / WAS (Docker → 호스트 chatbotApi) ──
|
# ── Agent / WAS (Docker → 호스트 chatbotApi) ──
|
||||||
|
# EXDEV_LOCAL=true 이면 운영 WAS(172.16.180.130) 호출을 차단한다.
|
||||||
|
# (GitHub push 시 git_fetch_all.sh 가 커밋 파일의 운영 기본 주소를 복원한다.)
|
||||||
AGENT_MODE=agent
|
AGENT_MODE=agent
|
||||||
AGENT_MAX_ROUNDS=6
|
AGENT_MAX_ROUNDS=6
|
||||||
|
EXDEV_LOCAL=true
|
||||||
CHATBOT_API_BASE_URL=http://host.docker.internal:8086/api
|
CHATBOT_API_BASE_URL=http://host.docker.internal:8086/api
|
||||||
INTERNAL_TOOL_API_KEY=exdev-agent-tool-key
|
INTERNAL_TOOL_API_KEY=exdev-agent-tool-key
|
||||||
CHATBOT_TOOL_TIMEOUT=60
|
CHATBOT_TOOL_TIMEOUT=60
|
||||||
|
|||||||
@@ -358,10 +358,15 @@ ensure_rag_env() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# RAG(Docker) → 호스트 chatbotApi (exdev 로컬 WAS). 운영 IP(172.16.180.130) 사용 금지.
|
# RAG(Docker) → 호스트 chatbotApi (exdev 로컬 WAS). 운영 IP(172.16.180.130) 사용 금지.
|
||||||
|
# GitHub 커밋 기본값은 운영 IP 유지 — git_fetch_all.sh 가 push 전 복원.
|
||||||
|
patch_env "EXDEV_LOCAL" "true"
|
||||||
patch_env "CHATBOT_API_BASE_URL" "http://host.docker.internal:${WAS_PORT}/api"
|
patch_env "CHATBOT_API_BASE_URL" "http://host.docker.internal:${WAS_PORT}/api"
|
||||||
patch_env "INTERNAL_TOOL_API_KEY" "${INTERNAL_TOOL_API_KEY}"
|
patch_env "INTERNAL_TOOL_API_KEY" "${INTERNAL_TOOL_API_KEY}"
|
||||||
patch_env "CHATBOT_TOOL_TIMEOUT" "60"
|
patch_env "CHATBOT_TOOL_TIMEOUT" "60"
|
||||||
log "RAG .env WAS: host.docker.internal:${WAS_PORT} (로컬 chatbotApi)"
|
if grep -qE 'CHATBOT_API_BASE_URL=.*172\.16\.180\.130' "${RAG_ENV}" 2>/dev/null; then
|
||||||
|
fail "exdev RAG .env 에 운영 WAS(172.16.180.130) 가 남아 있습니다"
|
||||||
|
fi
|
||||||
|
log "RAG .env WAS: host.docker.internal:${WAS_PORT} (로컬 chatbotApi, EXDEV_LOCAL=true)"
|
||||||
}
|
}
|
||||||
|
|
||||||
ensure_mongo() {
|
ensure_mongo() {
|
||||||
@@ -412,6 +417,7 @@ start_rag() {
|
|||||||
ensure_rag_compose
|
ensure_rag_compose
|
||||||
[[ -f "${COMPOSE_SERVER}" ]] || fail "docker-compose.server.yml 없음"
|
[[ -f "${COMPOSE_SERVER}" ]] || fail "docker-compose.server.yml 없음"
|
||||||
# compose environment 보간 + 컨테이너 env (로컬 WAS)
|
# compose environment 보간 + 컨테이너 env (로컬 WAS)
|
||||||
|
export EXDEV_LOCAL=true
|
||||||
export CHATBOT_API_BASE_URL="http://host.docker.internal:${WAS_PORT}/api"
|
export CHATBOT_API_BASE_URL="http://host.docker.internal:${WAS_PORT}/api"
|
||||||
export INTERNAL_TOOL_API_KEY="${INTERNAL_TOOL_API_KEY}"
|
export INTERNAL_TOOL_API_KEY="${INTERNAL_TOOL_API_KEY}"
|
||||||
export CHATBOT_TOOL_TIMEOUT="${CHATBOT_TOOL_TIMEOUT:-60}"
|
export CHATBOT_TOOL_TIMEOUT="${CHATBOT_TOOL_TIMEOUT:-60}"
|
||||||
@@ -420,7 +426,7 @@ start_rag() {
|
|||||||
local -a up_flags=(-d)
|
local -a up_flags=(-d)
|
||||||
if $NO_BUILD; then up_flags+=(--no-build); else up_flags+=(--build); fi
|
if $NO_BUILD; then up_flags+=(--no-build); else up_flags+=(--build); fi
|
||||||
log "RAG 스택 기동 (docker-compose.server.yml)..."
|
log "RAG 스택 기동 (docker-compose.server.yml)..."
|
||||||
log " CHATBOT_API_BASE_URL=${CHATBOT_API_BASE_URL}"
|
log " EXDEV_LOCAL=${EXDEV_LOCAL} CHATBOT_API_BASE_URL=${CHATBOT_API_BASE_URL}"
|
||||||
docker compose -f "${COMPOSE_SERVER}" up "${up_flags[@]}"
|
docker compose -f "${COMPOSE_SERVER}" up "${up_flags[@]}"
|
||||||
wait_http "http://127.0.0.1:6333/collections" "Qdrant" 30 || true
|
wait_http "http://127.0.0.1:6333/collections" "Qdrant" 30 || true
|
||||||
bootstrap_qdrant_if_empty
|
bootstrap_qdrant_if_empty
|
||||||
@@ -522,6 +528,13 @@ verify_stack() {
|
|||||||
wait_port "${WAS_PORT}" "chatbotApi" 5 || ok=false
|
wait_port "${WAS_PORT}" "chatbotApi" 5 || ok=false
|
||||||
wait_port "${SKILL_PORT}" "kakaoChatbotSkill" 5 || ok=false
|
wait_port "${SKILL_PORT}" "kakaoChatbotSkill" 5 || ok=false
|
||||||
curl -sf "http://127.0.0.1:${APP_PORT}/chatbot/ai/" | grep -q 'data-chatbot-app="ai-mode"' || { log "❌ chatbotApp UI"; ok=false; }
|
curl -sf "http://127.0.0.1:${APP_PORT}/chatbot/ai/" | grep -q 'data-chatbot-app="ai-mode"' || { log "❌ chatbotApp UI"; ok=false; }
|
||||||
|
# exdev 는 운영 WAS IP 를 절대 참조하지 않아야 한다
|
||||||
|
local rag_was
|
||||||
|
rag_was="$(docker exec exaichatbot-agent-api-1 printenv CHATBOT_API_BASE_URL 2>/dev/null || true)"
|
||||||
|
if [[ "${rag_was}" == *172.16.180.130* ]]; then
|
||||||
|
log "❌ RAG 가 운영 WAS(172.16.180.130) 를 참조 중: ${rag_was}"
|
||||||
|
ok=false
|
||||||
|
fi
|
||||||
if $ok; then log "✅ 전체 스택 정상"; return 0; fi
|
if $ok; then log "✅ 전체 스택 정상"; return 0; fi
|
||||||
log "⚠️ 일부 서비스 미응답 — ${LOG_DIR}/ 확인"
|
log "⚠️ 일부 서비스 미응답 — ${LOG_DIR}/ 확인"
|
||||||
return 1
|
return 1
|
||||||
@@ -564,6 +577,7 @@ if ! $SKIP_JAVA; then
|
|||||||
|
|
||||||
start_java_service "kakaoChatbotSkill" "${SKILL_DIR}" \
|
start_java_service "kakaoChatbotSkill" "${SKILL_DIR}" \
|
||||||
"${RUN_DIR}/kakao-skill.pid" "${LOG_DIR}/kakao-skill.log" \
|
"${RUN_DIR}/kakao-skill.pid" "${LOG_DIR}/kakao-skill.log" \
|
||||||
|
"EXDEV_LOCAL=true" \
|
||||||
"AGENT_MODE=agent" \
|
"AGENT_MODE=agent" \
|
||||||
"RAG_AGENT_CHAT_URL=http://127.0.0.1:${RAG_PORT}/agent/chat" \
|
"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/" \
|
"CHATBOT_API_BASE_URL=http://127.0.0.1:${WAS_PORT}/api/" \
|
||||||
|
|||||||
Reference in New Issue
Block a user