forge
Explore
Log in

Don't you dare go Hollow

🔧 name the stack after the repo and fix the backend host

Browse files at this commit

2ddc9e87a2e2085eb42133b13e0d978da24701a7Ahmet Kaan GümüşParent: e013725
  • refactor
    • 🔧 name the stack after the repo and fix the backend host
Show full message
refactor: 🔧 name the stack after the repo and fix the backend host
- every runtime name follows the repo: image hezarfen_rule_based_chatbot,
  container_name, the systemd unit hezarfen_rule_based_chatbot_compose, the
  operator file hezarfen_rule_based_chatbot.env, the deploy dir and the
  release artifact
- AI_BRIDGE_HOST/AI_BACKEND_URL now use hezarfen_backend: the hyphenated
  name does not resolve on the shared podman network (proved inside the
  container: getaddrinfo("hezarfen-backend") fails, hezarfen_backend and
  backend both point at 10.89.0.4)
- AI_BACKEND_URL points at the backend's real port 7656 instead of 8080
.github/workflows/main.ymlmodified+27 -27
@@ -27,7 +27,7 @@
2727 # frontend deploy'unun kullandığı üç isim;
2828 # * sunucuda `loginctl enable-linger <user>` (kullanıcı unit'leri için);
2929 # * sunucuda podman + bir compose sağlayıcı (deploy ikisini de kontrol eder);
30-# * operatörün ~/hezarfen_chatbot/hezarfen_chatbot.env (0600) dosyası;
30+# * operatörün ~/hezarfen_rule_based_chatbot/hezarfen_rule_based_chatbot.env (0600) dosyası;
3131 # * BACKEND tarafı açık olmalı: hezarfen_backend.env içinde
3232 # AI_QUIC_ADDR=0.0.0.0:8090 ve AI_SHARED_TOKEN bu köprününkiyle AYNI.
3333 # (127.0.0.1 yazılıysa backend yalnız kendi loopback'ine bağlanır ve köprü
@@ -46,13 +46,13 @@ on:
4646 # VPS değişimine dokunmadan bayat Validate/Build'i iptal edebilmeli.
4747
4848 env:
49- # systemd kullanıcı unit'i. Bkz. deploy/hezarfen_chatbot_compose.service.
50- SERVICE: hezarfen_chatbot_compose
49+ # systemd kullanıcı unit'i. Bkz. deploy/hezarfen_rule_based_chatbot_compose.service.
50+ SERVICE: hezarfen_rule_based_chatbot_compose
5151 # Deploy, SSH kullanıcısının home'u altındaki bu alt dizinde yaşar ($HOME
5252 # sunucuda çözülür, yani kullanıcı değişince yol da onunla gelir).
53- DEPLOY_SUBDIR: hezarfen_chatbot
53+ DEPLOY_SUBDIR: hezarfen_rule_based_chatbot
5454 # Köprünün ayar dosyası; deploy yalnız varlığını kontrol eder, yazmaz.
55- ENV_FILE_NAME: hezarfen_chatbot.env
55+ ENV_FILE_NAME: hezarfen_rule_based_chatbot.env
5656 # Sağlık kapısı: backend'in verdiği kayıt onayı logda bu satırdır.
5757 READY_MARKER: "kayıt başarılı"
5858 # Köprünün backend sertifikasını çektiği yol (HTTP, backend konteynerinin portu).
@@ -111,20 +111,20 @@ jobs:
111111 - name: Build the image
112112 run: |
113113 set -euo pipefail
114- docker build -f Containerfile -t localhost/hezarfen_chatbot:$GITHUB_SHA .
114+ docker build -f Containerfile -t localhost/hezarfen_rule_based_chatbot:$GITHUB_SHA .
115115
116116 - name: Stage the release bundle
117117 run: |
118118 set -euo pipefail
119119 mkdir -p stage
120- docker save localhost/hezarfen_chatbot:$GITHUB_SHA | gzip > stage/hezarfen_chatbot.tar.gz
121- cp compose.yaml deploy/hezarfen_chatbot_compose.service stage/
120+ docker save localhost/hezarfen_rule_based_chatbot:$GITHUB_SHA | gzip > stage/hezarfen_rule_based_chatbot.tar.gz
121+ cp compose.yaml deploy/hezarfen_rule_based_chatbot_compose.service stage/
122122 echo -n "$GITHUB_SHA" > stage/tag
123123 # Sunucuda kurulacak her şey burada olmalı; eksik parça burada,
124124 # sunucuda değil, patlar.
125- test -f stage/hezarfen_chatbot.tar.gz
125+ test -f stage/hezarfen_rule_based_chatbot.tar.gz
126126 test -f stage/compose.yaml
127- test -f stage/hezarfen_chatbot_compose.service
127+ test -f stage/hezarfen_rule_based_chatbot_compose.service
128128 test -f stage/tag
129129 ls -l stage
130130
@@ -199,9 +199,9 @@ jobs:
199199 - name: Check the release is complete
200200 run: |
201201 set -euo pipefail
202- test -f stage/hezarfen_chatbot.tar.gz
202+ test -f stage/hezarfen_rule_based_chatbot.tar.gz
203203 test -f stage/compose.yaml
204- test -f stage/hezarfen_chatbot_compose.service
204+ test -f stage/hezarfen_rule_based_chatbot_compose.service
205205 test -f stage/tag
206206
207207 - name: Install SSH keys
@@ -227,14 +227,14 @@ jobs:
227227 ;;
228228 esac
229229 deploy_path=$HOME/$1
230- # Bu dizin operatörün hezarfen_chatbot.env dosyasını, compose
230+ # Bu dizin operatörün hezarfen_rule_based_chatbot.env dosyasını, compose
231231 # dosyalarını ve tag dosyalarını tutar; hiçbiri toptan silinmez.
232232 mkdir -p -- "$deploy_path"
233233 REMOTE
234234 # stdin paketi taşıyor, betik taşıyamaz; çıkarma yine bash -c ile
235235 # çünkü login shell bash değil ve $HOME'u genişletmez. Sunucuya
236236 # yalnız dört deploy dosyası kurulur.
237- tar -C stage -czf - hezarfen_chatbot.tar.gz compose.yaml hezarfen_chatbot_compose.service tag | ssh "$ssh_target" "bash -c 'exec tar -xzf - -C \"\$HOME/\$1\"' -- '$DEPLOY_SUBDIR'"
237+ tar -C stage -czf - hezarfen_rule_based_chatbot.tar.gz compose.yaml hezarfen_rule_based_chatbot_compose.service tag | ssh "$ssh_target" "bash -c 'exec tar -xzf - -C \"\$HOME/\$1\"' -- '$DEPLOY_SUBDIR'"
238238
239239 - name: Load the image and restart the bridge
240240 run: |
@@ -258,10 +258,10 @@ jobs:
258258
259259 # Hiçbir şey oynamadan önce oku: ayar dosyası operatörün, sunucuda,
260260 # elle bir kez yazılır (anahtarlar için bkz.
261- # deploy/hezarfen_chatbot.env.example). Deploy onu asla oluşturmaz,
261+ # deploy/hezarfen_rule_based_chatbot.env.example). Deploy onu asla oluşturmaz,
262262 # ezmez.
263263 if [ ! -f "$env_file" ]; then
264- echo "missing $env_file — create it (0600) from deploy/hezarfen_chatbot.env.example" >&2
264+ echo "missing $env_file — create it (0600) from deploy/hezarfen_rule_based_chatbot.env.example" >&2
265265 exit 1
266266 fi
267267 chmod 0600 -- "$env_file"
@@ -290,7 +290,7 @@ jobs:
290290
291291 # BU build'in imajını yükle ve build'in damgaladığı tag'i oku
292292 # (build zamanı ile deploy zamanı neyin gittiğinde anlaşmalı).
293- gunzip -c "$deploy_path/hezarfen_chatbot.tar.gz" | podman load
293+ gunzip -c "$deploy_path/hezarfen_rule_based_chatbot.tar.gz" | podman load
294294 tag=$(cat -- "$deploy_path/tag")
295295
296296 # Tag rotasyonu: previous_tag geri dönüş hedefidir (ilk deploy'da
@@ -305,9 +305,9 @@ jobs:
305305 # kazanan yapar.
306306 printf 'HEZARFEN_TAG=%s\n' "$tag" > "$deploy_path/stack.env"
307307
308- chmod 0644 -- "$deploy_path/compose.yaml" "$deploy_path/hezarfen_chatbot_compose.service"
308+ chmod 0644 -- "$deploy_path/compose.yaml" "$deploy_path/hezarfen_rule_based_chatbot_compose.service"
309309 # İmaj tarball'ı yalnız taşıyıcıydı; imaj artık podman deposunda.
310- rm -f -- "$deploy_path/hezarfen_chatbot.tar.gz"
310+ rm -f -- "$deploy_path/hezarfen_rule_based_chatbot.tar.gz"
311311
312312 compose_up() {
313313 podman compose --env-file "$env_file" --env-file "$deploy_path/stack.env" up -d --no-build
@@ -330,7 +330,7 @@ jobs:
330330 # Unit sürümle birlikte gelir: yeni kurulmuş bir kutuda ilk deploy'a
331331 # kadar unit yoktur ve değişen unit onu gerektiren compose ile iner.
332332 mkdir -p -- "$HOME/.config/systemd/user"
333- install -m 0644 -- "$deploy_path/hezarfen_chatbot_compose.service" "$HOME/.config/systemd/user/$service.service"
333+ install -m 0644 -- "$deploy_path/hezarfen_rule_based_chatbot_compose.service" "$HOME/.config/systemd/user/$service.service"
334334 systemctl --user daemon-reload
335335
336336 # Unit RemainAfterExit'li bir oneshot: aktif (exited) unit'te `start`
@@ -346,7 +346,7 @@ jobs:
346346 # yeniden bağlanma aralıkları zaman alır.
347347 ready_ok=0
348348 for _ in $(seq 1 60); do
349- if podman logs --tail 200 hezarfen_chatbot 2>&1 | grep -q "$ready_marker"; then
349+ if podman logs --tail 200 hezarfen_rule_based_chatbot 2>&1 | grep -q "$ready_marker"; then
350350 ready_ok=1
351351 break
352352 fi
@@ -354,14 +354,14 @@ jobs:
354354 done
355355 if [ "$ready_ok" -ne 1 ]; then
356356 echo "the bridge never registered with the backend ('$ready_marker' missing); rolling back" >&2
357- podman logs --tail 30 hezarfen_chatbot 2>&1 >&2 || true
357+ podman logs --tail 30 hezarfen_rule_based_chatbot 2>&1 >&2 || true
358358 rollback
359359 exit 1
360360 fi
361361
362362 # Eski bir stack de cevap verebilir; çalışan konteyner BU build'in
363363 # imajı olmalı, yoksa geri dönülür.
364- image=$(podman inspect -f '{{.Config.Image}}' hezarfen_chatbot)
364+ image=$(podman inspect -f '{{.Config.Image}}' hezarfen_rule_based_chatbot)
365365 case "$image" in
366366 *"$tag"*) ;;
367367 *)
@@ -370,7 +370,7 @@ jobs:
370370 exit 1
371371 ;;
372372 esac
373- echo 'hezarfen_chatbot_compose is up'
373+ echo 'hezarfen_rule_based_chatbot_compose is up'
374374 REMOTE
375375
376376 # Bağımsız son kontrol: cevap veren konteyner hâlâ güncel tag'in olmalı ve
@@ -386,7 +386,7 @@ jobs:
386386 export XDG_RUNTIME_DIR=/run/user/$(id -u)
387387 cd -- "$deploy_path"
388388 tag=$(cat -- "$deploy_path/current_tag")
389- image=$(podman inspect -f '{{.Config.Image}}' hezarfen_chatbot)
389+ image=$(podman inspect -f '{{.Config.Image}}' hezarfen_rule_based_chatbot)
390390 case "$image" in
391391 *"$tag"*) ;;
392392 *)
@@ -394,9 +394,9 @@ jobs:
394394 exit 1
395395 ;;
396396 esac
397- status=$(podman inspect -f '{{.State.Status}}' hezarfen_chatbot)
397+ status=$(podman inspect -f '{{.State.Status}}' hezarfen_rule_based_chatbot)
398398 [ "$status" = "running" ] || { echo "container status is '$status', not running" >&2; exit 1; }
399- podman logs --tail 200 hezarfen_chatbot 2>&1 | grep -q "$ready_marker" || {
399+ podman logs --tail 200 hezarfen_rule_based_chatbot 2>&1 | grep -q "$ready_marker" || {
400400 echo "the bridge is not registered with the backend" >&2
401401 exit 1
402402 }
.gitignoremodified+3 -3
@@ -23,10 +23,10 @@ data/stress_benchmark_results.jsonl
2323 # Okunabilir Markdown raporu repoda tutulur; ham JSON tutulmaz.
2424 data/benchmark_results.json
2525
26-# Compose/sistem ortam dosyaları: operatörün ayarları (hezarfen_chatbot.env) ve
26+# Compose/sistem ortam dosyaları: operatörün ayarları (hezarfen_rule_based_chatbot.env) ve
2727 # deploy sahipli tag taşıyıcısı (stack.env) makineye özeldir, git'e girmez.
28-# Şablon: deploy/hezarfen_chatbot.env.example
29-hezarfen_chatbot.env
28+# Şablon: deploy/hezarfen_rule_based_chatbot.env.example
29+hezarfen_rule_based_chatbot.env
3030 stack.env
3131
3232 # CI deploy paketi (imaj tarball'ı + compose dosyaları + tag).
Containerfilemodified+3 -3
@@ -20,15 +20,15 @@ RUN useradd --create-home --uid 10001 chatbot \
2020 USER chatbot
2121
2222 # Dağıtım varsayılanları — TEK yazıldıkları yer. Sunucu bunları
23-# hezarfen_chatbot.env (env_file) ile ezer; compose dosyası hiçbir anahtar
23+# hezarfen_rule_based_chatbot.env (env_file) ile ezer; compose dosyası hiçbir anahtar
2424 # listelemez, böylece operatörün dosyası gölgelenemez.
2525 #
2626 # AI_BACKEND_URL köprünün sertifikayı çektiği HTTP kökü: backend konteynerinin
2727 # kendi portu (compose'da PORT=7656). Sertifika her (yeniden) bağlanmada
2828 # tazelenir.
29-ENV AI_BRIDGE_HOST=hezarfen-backend \
29+ENV AI_BRIDGE_HOST=hezarfen_backend \
3030 AI_BRIDGE_PORT=8090 \
31- AI_BACKEND_URL=http://hezarfen-backend:7656 \
31+ AI_BACKEND_URL=http://hezarfen_backend:7656 \
3232 AI_SHARED_TOKEN=change-me \
3333 AI_TLS_SERVER_NAME=localhost \
3434 AI_SERVICE_NAME=celebi \
ReadMe.mdmodified+1 -1
@@ -135,7 +135,7 @@ podman compose up -d --build # yalnız hezarfen-chatbot-bridge
135135 ```
136136
137137 Ürün compose'u demo HTTP sunucusunu çalıştırmaz ve hostta `8000/8001` portu
138-açmaz. Chatbot container'ı backend ağı içinde `hezarfen-backend:8090` hedefine
138+açmaz. Chatbot container'ı backend ağı içinde `hezarfen_backend:8090` hedefine
139139 **QUIC/UDP** ile bağlanır; `8090` için TCP bağlantısı veya host port yayını yoktur.
140140 `src.web` yalnız yerel geliştirici aracıdır ve ürün yığınının parçası değildir.
141141
compose.yamlmodified+5 -5
@@ -1,11 +1,11 @@
11 # Çelebi QUIC köprüsü — bu compose yalnızca TEK chatbot container'ı oluşturur.
22 # Backend compose ayakta olmalı; bu servis backend'in ağına katılır ve oradan
3-# QUIC/UDP ile `hezarfen-backend:8090` adresine dial-in eder. Host portu veya
3+# QUIC/UDP ile `hezarfen_backend:8090` adresine dial-in eder. Host portu veya
44 # demo web arayüzü AÇMAZ (web.py yalnız geliştirici aracıdır).
55 #
66 # Varsayılanların TEK kaynağı Containerfile'ın ENV bloğudur; bu dosya hiçbir
77 # `environment:` girdisi taşımaz, böylece hiçbir şey operatörün dosyasını
8-# gölgeleyemez. Sunucuda ~/hezarfen_chatbot/hezarfen_chatbot.env ile ezilir.
8+# gölgeleyemez. Sunucuda ~/hezarfen_rule_based_chatbot/hezarfen_rule_based_chatbot.env ile ezilir.
99 #
1010 # podman compose up -d --build
1111 #
@@ -19,12 +19,12 @@ services:
1919 context: .
2020 dockerfile: Containerfile
2121 # HEZARFEN_TAG deploy tarafından yazılan stack.env'den gelir (--env-file).
22- image: localhost/hezarfen_chatbot:${HEZARFEN_TAG:-latest}
23- container_name: hezarfen_chatbot
22+ image: localhost/hezarfen_rule_based_chatbot:${HEZARFEN_TAG:-latest}
23+ container_name: hezarfen_rule_based_chatbot
2424 init: true
2525 env_file:
2626 # Sunucuda elle yazılır (0600); laptopta yoktur.
27- - path: hezarfen_chatbot.env
27+ - path: hezarfen_rule_based_chatbot.env
2828 required: false
2929 restart: unless-stopped
3030 networks:
deploy/hezarfen_chatbot.env.example → deploy/hezarfen_rule_based_chatbot.env.examplerenamed+7 -7
@@ -1,10 +1,10 @@
1-# hezarfen_chatbot.env — Çelebi köprüsünün sunucu ayarları.
1+# hezarfen_rule_based_chatbot.env — Çelebi köprüsünün sunucu ayarları.
22 #
33 # Sunucuda TEK SEFERLİK, elle:
4-# mkdir -p ~/hezarfen_chatbot
5-# cp hezarfen_chatbot.env.example ~/hezarfen_chatbot/hezarfen_chatbot.env
4+# mkdir -p ~/hezarfen_rule_based_chatbot
5+# cp hezarfen_rule_based_chatbot.env.example ~/hezarfen_rule_based_chatbot/hezarfen_rule_based_chatbot.env
66 # <değerleri doldur>
7-# chmod 0600 ~/hezarfen_chatbot/hezarfen_chatbot.env
7+# chmod 0600 ~/hezarfen_rule_based_chatbot/hezarfen_rule_based_chatbot.env
88 #
99 # Hiçbir otomasyon bu dosyayı oluşturmaz, ezmez, yüklemez — operatörün malıdır;
1010 # compose yalnız okur (`env_file`). Satırlar düz KEY=value: tırnak yok, `export`
@@ -12,7 +12,7 @@
1212 #
1313 # Buradaki her anahtar Containerfile ENV bloğundaki varsayılanı EZER. Değerler
1414 # konteyner BAŞLARKEN okunur: değişiklikten sonra yeniden oluştur
15-# (`podman compose up -d` ya da `systemctl --user restart hezarfen_chatbot_compose`).
15+# (`podman compose up -d` ya da `systemctl --user restart hezarfen_rule_based_chatbot_compose`).
1616
1717 # ── Backend tarafı (ZORUNLU: ikisi backend ile aynı olmalı) ───────────────────
1818 # Backend'in QUIC köprüsü dinleyicisi. hezarfen_backend.env içinde
@@ -20,11 +20,11 @@
2020 # konteyner loopback'ine bağlanır ve HİÇBİR servis dial-in edemez (Çelebi 503
2121 # "no AI service is connected" verir). Değiştirdikten sonra:
2222 # systemctl --user restart hezarfen_backend_compose
23-AI_BRIDGE_HOST=hezarfen-backend
23+AI_BRIDGE_HOST=hezarfen_backend
2424 AI_BRIDGE_PORT=8090
2525
2626 # Sertifikanın çekildiği HTTP kökü — backend konteynerinin kendi portu.
27-AI_BACKEND_URL=http://hezarfen-backend:7656
27+AI_BACKEND_URL=http://hezarfen_backend:7656
2828
2929 # Paylaşılan sır: backend'in AI_SHARED_TOKEN'ı ile BİREBİR aynı olmalı.
3030 # 'change-me' yalnız geliştirme değeridir; prod'da iki tarafı birlikte değiştir.
deploy/hezarfen_chatbot_compose.service → deploy/hezarfen_rule_based_chatbot_compose.servicerenamed+6 -6
@@ -1,7 +1,7 @@
11 # systemd KULLANICI unit'i: Çelebi köprüsünü podman compose ile çalıştırır.
2-# %h/hezarfen_chatbot içinde beklenen dosyalar:
2+# %h/hezarfen_rule_based_chatbot içinde beklenen dosyalar:
33 # compose.yaml bu repodan (ya da deploy artefaktından)
4-# hezarfen_chatbot.env 0600, deploy/hezarfen_chatbot.env.example'dan
4+# hezarfen_rule_based_chatbot.env 0600, deploy/hezarfen_rule_based_chatbot.env.example'dan
55 # ELLE yazılır — otomasyon oluşturmaz/ezmez
66 # stack.env deploy sahipli; HEZARFEN_TAG taşır
77 #
@@ -9,7 +9,7 @@
99 # podman compose build # burada derle
1010 # podman load -i image.tar # ya da hazır imajı yükle
1111 #
12-# hezarfen_chatbot.env içindeki anahtarlar (tam belge: deploy/hezarfen_chatbot.env.example).
12+# hezarfen_rule_based_chatbot.env içindeki anahtarlar (tam belge: deploy/hezarfen_rule_based_chatbot.env.example).
1313 # Hepsinin varsayılanı imajın ENV bloğundadır (Containerfile) — bu dosya ezer:
1414 # AI_BRIDGE_HOST / AI_BRIDGE_PORT backend'in QUIC dinleyicisi (ağ içi ad)
1515 # AI_BACKEND_URL sertifikanın çekildiği HTTP kökü
@@ -18,7 +18,7 @@
1818 #
1919 # Sadece ortam değişkeni değiştiğinde yeniden başlatma (ExecStart'ı yeniden
2020 # koşar, ortamı değişen konteynerı yeniden oluşturur):
21-# systemctl --user restart hezarfen_chatbot_compose
21+# systemctl --user restart hezarfen_rule_based_chatbot_compose
2222
2323 [Unit]
2424 Description=Hezarfen Celebi QUIC bridge (rule-based chatbot)
@@ -28,10 +28,10 @@ Wants=network-online.target
2828 [Service]
2929 Type=oneshot
3030 RemainAfterExit=yes
31-WorkingDirectory=%h/hezarfen_chatbot
31+WorkingDirectory=%h/hezarfen_rule_based_chatbot
3232 # Sonraki --env-file çakışan anahtarda kazanır: önce operatörün ayar dosyası,
3333 # sonra deploy sahipli stack.env (HEZARFEN_TAG).
34-ExecStart=/usr/bin/podman compose --env-file %h/hezarfen_chatbot/hezarfen_chatbot.env --env-file %h/hezarfen_chatbot/stack.env up -d --no-build
34+ExecStart=/usr/bin/podman compose --env-file %h/hezarfen_rule_based_chatbot/hezarfen_rule_based_chatbot.env --env-file %h/hezarfen_rule_based_chatbot/stack.env up -d --no-build
3535 # -v yok: isimli volume'lar stop'ta yaşamalı (köprü durumsuzdur ama şekil aynı).
3636 ExecStop=/usr/bin/podman compose down
3737 TimeoutStartSec=180