Yalnız ürün köprüsünü çalıştır
Browse files at this commit7103c5cc0e9cf1bb317848b63e820582c952584eParent: c8dbd22- fix
- yalnız ürün köprüsünü çalıştır
4 changed files +11 -39
- ReadMe.md +2 -2
- compose.yaml +5 -32
- deploy/PODMAN-WSL-SETUP.md +3 -3
- deploy/run-stack.ps1 +1 -2
ReadMe.mdmodified+2 -2
| @@ -117,8 +117,8 @@ python -m src.main --evaluate # benchmark üzerinde tam metrik raporu | |||
| 117 | python -m src.main --chat # etkileşimli terminal asistanı | 117 | python -m src.main --chat # etkileşimli terminal asistanı |
| 118 | python -m src.web # geliştirici web arayüzü (http://127.0.0.1:8000) | 118 | python -m src.web # geliştirici web arayüzü (http://127.0.0.1:8000) |
| 119 | 119 | ||
| 120 | -# Podman (motor podman; sadece bu chatbot, tek başına) | 120 | +# Podman ürün köprüsü (önce backend compose ayakta olmalı) |
| 121 | -podman compose up -d --build # izole geliştirici sohbet UI -> http://localhost:8000 | 121 | +podman compose up -d --build # yalnız hezarfen-chatbot-bridge |
| 122 | ``` | 122 | ``` |
| 123 | 123 | ||
| 124 | **Tüm yığın (backend + frontend + chatbot) — PROJE-BAZLI (all-in-one compose yok):** | 124 | **Tüm yığın (backend + frontend + chatbot) — PROJE-BAZLI (all-in-one compose yok):** |
compose.yamlmodified+5 -32
| @@ -1,38 +1,10 @@ | |||
| 1 | -# Çelebi kural-tabanlı chatbot — proje-bazlı çalıştırma (kök compose GEREKMEZ). | 1 | +# Çelebi ürün köprüsü — bu compose yalnızca TEK chatbot container'ı oluşturur. |
| 2 | +# Önce backend compose ayakta olmalı; backend ağına bağlanıp QUIC/UDP ile | ||
| 3 | +# hezarfen-backend:8090 adresine dial-in eder. Host portu veya demo web UI açmaz. | ||
| 2 | # | 4 | # |
| 3 | -# 1) TEK BAŞINA (backend olmadan) — geliştirici sohbet arayüzü: | 5 | +# podman compose up -d --build |
| 4 | -# podman compose up -d --build -> http://localhost:8000 | ||
| 5 | -# Bu her makinede (Linux/WSL) sorunsuz çalışır; hiçbir dış servise bağlı değildir. | ||
| 6 | -# | ||
| 7 | -# 2) ÜRÜN modu (backend'e bağlı köprü) — önce backend ayakta olmalı: | ||
| 8 | -# cd ../hezarfen_backend && podman compose up -d | ||
| 9 | -# cd ../Hezarfen-Rule-Based-Chatbot && podman compose --profile product up -d | ||
| 10 | -# 'bridge' servisi backend'in ağına (hezarfen_backend_default) dial-in eder. | ||
| 11 | -# | ||
| 12 | -# Not: 'web' profilsizdir -> 'up' her zaman onu başlatır ve TEK BAŞINA yeter. | ||
| 13 | -# 'bridge' yalnız '--profile product' ile gelir (backend ağı gerektiği için). | ||
| 14 | services: | 6 | services: |
| 15 | - web: | ||
| 16 | - build: | ||
| 17 | - context: . | ||
| 18 | - dockerfile: Containerfile | ||
| 19 | - image: localhost/rule-based-chatbot:local | ||
| 20 | - container_name: hezarfen-chatbot-web | ||
| 21 | - init: true | ||
| 22 | - command: ["python", "-m", "src.web", "--host", "0.0.0.0", "--port", "8000"] | ||
| 23 | - ports: | ||
| 24 | - - "8000:8000" | ||
| 25 | - restart: unless-stopped | ||
| 26 | - healthcheck: | ||
| 27 | - test: ["CMD", "python", "-c", | ||
| 28 | - "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/')"] | ||
| 29 | - interval: 30s | ||
| 30 | - timeout: 5s | ||
| 31 | - retries: 3 | ||
| 32 | - start_period: 5s | ||
| 33 | - | ||
| 34 | bridge: | 7 | bridge: |
| 35 | - profiles: ["product"] | ||
| 36 | build: | 8 | build: |
| 37 | context: . | 9 | context: . |
| 38 | dockerfile: Containerfile | 10 | dockerfile: Containerfile |
| @@ -42,6 +14,7 @@ services: | |||
| 42 | command: ["python", "-m", "src.bridge"] | 14 | command: ["python", "-m", "src.bridge"] |
| 43 | environment: | 15 | environment: |
| 44 | AI_BRIDGE_HOST: hezarfen-backend # backend container'ının adı | 16 | AI_BRIDGE_HOST: hezarfen-backend # backend container'ının adı |
| 17 | + # aioquic bu hedefe UDP ile bağlanır; burada TCP port yayını yoktur. | ||
| 45 | AI_BRIDGE_PORT: "8090" | 18 | AI_BRIDGE_PORT: "8090" |
| 46 | AI_BACKEND_URL: http://hezarfen-backend:8080 | 19 | AI_BACKEND_URL: http://hezarfen-backend:8080 |
| 47 | AI_SHARED_TOKEN: change-me # backend ile AYNI olmalı | 20 | AI_SHARED_TOKEN: change-me # backend ile AYNI olmalı |
deploy/PODMAN-WSL-SETUP.mdmodified+3 -3
| @@ -84,9 +84,9 @@ Ya da elle (her repo kendi compose'uyla; sıra önemli — backend ağı yaratı | |||
| 84 | ```powershell | 84 | ```powershell |
| 85 | cd ..\hezarfen_backend ; & $P compose up -d --build # surrealdb + backend (:8080,:8090) | 85 | cd ..\hezarfen_backend ; & $P compose up -d --build # surrealdb + backend (:8080,:8090) |
| 86 | cd ..\hezarfen_frontend ; & $P compose up -d --build # frontend (:5173) | 86 | cd ..\hezarfen_frontend ; & $P compose up -d --build # frontend (:5173) |
| 87 | -cd ..\Hezarfen-Rule-Based-Chatbot ; & $P compose --profile product up -d --build bridge # chatbot köprüsü | 87 | +cd ..\Hezarfen-Rule-Based-Chatbot ; & $P compose up -d --build # yalnız chatbot köprüsü |
| 88 | ``` | 88 | ``` |
| 89 | -> Chatbot'u backend'siz **tek başına** denemek için: `cd Hezarfen-Rule-Based-Chatbot; & $P compose up -d` → `http://localhost:8000` (izole dev sohbet UI). | 89 | +> Chatbot compose yalnız ürün köprüsünü çalıştırır; demo web container'ı ve host port yayını yoktur. |
| 90 | > **Linux/macOS:** kernel/machine adımları gerekmez; sadece bu bölümü çalıştır. Portlar zaten host'a iletilir. | 90 | > **Linux/macOS:** kernel/machine adımları gerekmez; sadece bu bölümü çalıştır. Portlar zaten host'a iletilir. |
| 91 | 91 | ||
| 92 | --- | 92 | --- |
| @@ -103,7 +103,7 @@ cd ..\Hezarfen-Rule-Based-Chatbot ; & $P compose --profile product up -d --build | |||
| 103 | 103 | ||
| 104 | ## Durdurma / temizlik (her repo kendi dizininde) | 104 | ## Durdurma / temizlik (her repo kendi dizininde) |
| 105 | ```powershell | 105 | ```powershell |
| 106 | -cd ..\Hezarfen-Rule-Based-Chatbot ; & $P compose --profile product down | 106 | +cd ..\Hezarfen-Rule-Based-Chatbot ; & $P compose down |
| 107 | cd ..\hezarfen_frontend ; & $P compose down | 107 | cd ..\hezarfen_frontend ; & $P compose down |
| 108 | cd ..\hezarfen_backend ; & $P compose down # volume kalır | 108 | cd ..\hezarfen_backend ; & $P compose down # volume kalır |
| 109 | cd ..\hezarfen_backend ; & $P compose down -v # volume'ları da sil | 109 | cd ..\hezarfen_backend ; & $P compose down -v # volume'ları da sil |
deploy/run-stack.ps1modified+1 -2
| @@ -47,8 +47,7 @@ function Compose-Up([string]$dir, [string[]]$extra) { | |||
| 47 | } | 47 | } |
| 48 | Compose-Up $backend @() # ağı (hezarfen_backend_default) yaratır | 48 | Compose-Up $backend @() # ağı (hezarfen_backend_default) yaratır |
| 49 | Compose-Up $frontend @() # backend ağına bağlanır | 49 | Compose-Up $frontend @() # backend ağına bağlanır |
| 50 | -Compose-Up $chatbot @("--profile", "product") # bridge; backend ağına dial-in eder | 50 | +Compose-Up $chatbot @() # yalnız bridge; backend ağına dial-in eder |
| 51 | -# (Not: chatbot'u backend'siz TEK BAŞINA denemek için: cd $chatbot; podman compose up -d -> :8000) | ||
| 52 | 51 | ||
| 53 | Write-Host "`n[3/3] Doğrulama..." | 52 | Write-Host "`n[3/3] Doğrulama..." |
| 54 | Start-Sleep -Seconds 6 | 53 | Start-Sleep -Seconds 6 |