forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on mainFiltered to tests/unit/test_deployment.pyClear filter

2026-09-17

feat(service): 🧱 indeks önbelleği (#75) — vektörler volume'de kalırAhmet Kaan Gümüş · 36db106
feat(service): 🧱 indeks önbelleği (#75) — vektörler volume'de kalır

Konteyner yeniden yaratıldığında indeks bellekte olduğu için korpus her
seferinde yeniden gömülüyordu; servis bir süre "kaynak yok / hazırlanıyor"
diyordu (hab/2 ile aynı). Artık gömme ÇIKTISI (ids/vecs/sparse) bir volume'e
(`rag-index:/index`, Containerfile varsayılanı `/index`) yazılır ve AYNI korpus
için bir sonraki kurulum AĞI ATLAR. Anahtar içerik+model türevlidir
(doc_id + chunk metin özeti + gömme imzası) — PDF ya da model değişirse
kendiliğinden ıskar. Biçim `.npz` (pickle yok); bozuk dosya HATA değil ıska.

/ready artık sağlayıcı-hazır ile korpus-KURULU'yu ayırır: `korpus_hazir` ve
`hazir_tur` (tam|saglayici|yok). `MultiCorpusService.generator` da korpus
TANIMLI olduğu için değil KURULU olduğu için dolu döner (eskiden `object()`
fallback'i readiness'ı yeşil yakıp soruları `service_warming_up` döndürüyordu).

Gate: pytest tests/unit -q → 1377 passed, 34 skipped, 542 subtests.
feat(deploy): 🧱 küçük varsayılan imge + API sağlayıcı varsayılanı, yerel yığın volume'uAhmet Kaan Gümüş · 1d40da1
feat(deploy): 🧱 küçük varsayılan imge + API sağlayıcı varsayılanı, yerel yığın volume'u

- Dağıtım varsayılanı API: Containerfile ENV RAG_EMBED_PROVIDER=api /
  RAG_RERANK_PROVIDER=api; operatör şablonu deploy/hezarfen_rag.env.example.
  Yerel yol silinmedi — .env ile seçilir.
- Fail-closed açılış ön denetimi (src/service/preflight.py): eksik taban
  adresi/model/anahtar servisi ayağa kaldırmaz (SystemExit 2), eksiği adıyla
  ve çalıştırılacak komutla söyler; anahtar RAG_*_API_KEY ya da
  RAG_*_API_KEY_ENV ile verilebilir.
- Zarf tek kaynak: compose x-rag-envelope (mem_limit_mb 3072, disk_min_gb 8);
  ürün servisi mem_limit 3 GiB; CI kapasite kapısı bu değerleri compose'dan
  okur (eski 12 GB / 20 GB model çağından kalmaydı).
- Küçük imge: requirements üçe bölündü (servis / yerel yığın / eval); yerel
  yığın imaja girmez, eklenti volume'den gelir (deploy/provision_local_stack.sh,
  pip imge içinde, idempotent, PROVISIONED işareti). Geçiş: .env + restart.
- cuda_status torch'u yalnız kuruluysa import eder → API yolu torch'suz koşar.
- Korpus yolu kiracılık düzenine çekildi (okul segmenti zorunlu: compose/env
  varsayılanları açık hata veriyordu).
- Testler: tests/unit/test_providers_deploy.py (25 test) + test_deployment
  mount beklentisi; kapı 1323 geçti / 34 atlandı.

2026-09-15

chore: 🔧 compose stack, systemd unit and VPS deploy workflow - compose.yaml: env-file driven service (hezarfen_rag.env, operator-owned, from the repo's .env.example); the only environment: block left carries the host-specific corpus choice (BOOK_PATH/SINIF/DERS) as interpolations, so no secret or operator value can be shadowed - Containerfile: ENV block is the single source of the image defaults (HF_HOME/HOST/PORT); CMD now drives the uvicorn factory from $HOST/$PORT instead of hardcoding 0.0.0.0:8000 (a PORT in the env file was ignored) - gpu profile: YAML anchor instead of extends — podman-compose 1.6 crashed with KeyError: _deps whenever the base service was excluded by a profile (podman compose --profile gpu config died outright) - deploy/hezarfen_rag_compose.service: systemd user unit running podman compose --profile product with both --env-file arguments - CI: validate (compileall) ∥ build-and-test (pytest tests/unit, 1240 green in the image) then an SSH deploy gated on /health and /ready, with a capacity preflight (>= 12 GB free RAM, >= 20 GB disk) and rollback to previous_tag; deploy opens only on workflow_dispatch because the service needs ~4.5 GB of models and a GPU to meet the O-05 latency gate - tests/unit/test_deployment.py: two pins follow the new mechanism (operator env file instead of compose environment:; skip when the corpus is absent from the checkout) with the original intent keptAhmet Kaan Gümüş · 723c33f
chore: 🔧 compose stack, systemd unit and VPS deploy workflow
- compose.yaml: env-file driven service (hezarfen_rag.env, operator-owned, from
  the repo's .env.example); the only environment: block left carries the
  host-specific corpus choice (BOOK_PATH/SINIF/DERS) as interpolations, so no
  secret or operator value can be shadowed
- Containerfile: ENV block is the single source of the image defaults
  (HF_HOME/HOST/PORT); CMD now drives the uvicorn factory from $HOST/$PORT
  instead of hardcoding 0.0.0.0:8000 (a PORT in the env file was ignored)
- gpu profile: YAML anchor instead of extends — podman-compose 1.6 crashed with
  KeyError: _deps whenever the base service was excluded by a profile
  (podman compose --profile gpu config died outright)
- deploy/hezarfen_rag_compose.service: systemd user unit running
  podman compose --profile product with both --env-file arguments
- CI: validate (compileall) ∥ build-and-test (pytest tests/unit, 1240 green in
  the image) then an SSH deploy gated on /health and /ready, with a capacity
  preflight (>= 12 GB free RAM, >= 20 GB disk) and rollback to previous_tag;
  deploy opens only on workflow_dispatch because the service needs ~4.5 GB of
  models and a GPU to meet the O-05 latency gate
- tests/unit/test_deployment.py: two pins follow the new mechanism (operator
  env file instead of compose environment:; skip when the corpus is absent
  from the checkout) with the original intent kept

2026-09-12

fix(dagitim): konteyner servisi baslatmiyordu; giris noktasi + saglik yoklamasiKadir Yönak · 4ac3ab0
fix(dagitim): konteyner servisi baslatmiyordu; giris noktasi + saglik yoklamasi

#81 (EXP-010/OPS-03 + OPS-17). Onceki halin dogrulanmis sorunlari:
- CMD ["python","-c","import src; print('...hazir...')"] -> imge bir metin
  yazdirip CIKIYORDU; uvicorn hic calistirilmiyordu. `restart: unless-stopped`
  ile birlikte bu SONSUZ RESTART DONGUSU demekti.
- `RUN pip install torch>=2.6 --index-url ...` -> tirnaksiz `>=` KABUK
  YONLENDIRMESINE donusuyor: surum kisiti hic uygulanmiyor, /app/=2.6 cop
  dosyasi olusuyor, pip ciktisi build loglarinda gorunmuyordu.
- EXPOSE yok; compose'da ports ve healthcheck yok.
- .containerignore data/'yi disliyor ama BOOK_PATH varsayilani data/... ->
  PDF konteynerde HIC YOK. Ustelik varsayilan 12. sinif kitabi, o da depoda
  yok (#92) -> konteyner acilista patlardi.
- .env servis yolunda yuklenmiyordu.

YAPILANLAR
- `create_app_with_warmup()` fabrikasi: uvicorn girisi. FABRIKA olarak yazildi
  (modul seviyesinde `app = ...` DEGIL) cunku modulu ice aktarmanin yan etkisi
  olmamali -- yoksa her test ice aktarmasi bir isitma thread'i baslatir.
- Containerfile: gercek CMD (uvicorn --factory), EXPOSE 8000, tirnakli pip
  kisiti + yonlendirme copu olusmadigini DOGRULAYAN build adimi, curl
  (healthcheck imge icinden kosar), ayricaliksiz kullanici, tests/ uretim
  imajindan cikarildi.
- compose: ports (yalniz 127.0.0.1 -- disa acmak bilincli olmali), healthcheck
  /health uzerinden + start_period (boru hatti kurulurken kap SAGLIKSIZ
  sayilmamali), env_file, data read-only mount, model ve maliyet defteri icin
  kalici volume'lar, guvenlik anahtarlari.

GERCEKTEN KOSULARAK DOGRULANDI (yerel uvicorn, 10-biyoloji):
  /health   -> 1. SANIYEDE 200
  /ready    -> 503 (isinirken), 28. saniyede 200
  /rag/chat -> isinirken tipli cevap: reason="service_warming_up"
               hazir olunca: 2 atifli gercek cevap (s.102, s.123)

DURUST SINIR: bu makinede podman/docker YOK; IMGE KURULMADI. Yapilandirma
sozlesme testleriyle sabitlendi (tests/unit/test_deployment.py, 18 test) ve
CMD'nin cagirdigi giris noktasi gercekten kosuldu, ama issue'nun kabul
kriteri ("temiz makinede tek komutla ayaga kalkar") DOGRULANMADI.

Suit: 989 yesil.

Refs #81