添加gfilter专用worker (#103)
Project CI / Repository checks (push) Successful in 1m3s
Project CI / Frontend tests (push) Successful in 2m0s
Project CI / Native shell tests (push) Successful in 2m26s
Project CI / Backend tests (push) Successful in 3m1s

Co-authored-by: kdletters <kdletters@qq.com>
Reviewed-on: https://git.genarrative.world/git/GenarrativeAI/Genarrative/pulls/103
Co-authored-by: Linghong <ink29535@proton.me>
Co-committed-by: Linghong <ink29535@proton.me>
This commit was merged in pull request #103.
This commit is contained in:
2026-07-23 18:06:29 +08:00
committed by 段舒康
parent 00da0dd1c8
commit a2ee879fc8
49 changed files with 10627 additions and 1107 deletions
@@ -0,0 +1,30 @@
[Unit]
Description=Genarrative BgFilter Worker
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=genarrative
Group=genarrative
WorkingDirectory=/opt/genarrative/current
EnvironmentFile=/etc/genarrative/api-server.env
EnvironmentFile=/etc/genarrative/bgfilter-worker.env
Environment="LD_LIBRARY_PATH=/opt/genarrative/openssl-3.2.0/lib64:/opt/genarrative/openssl-3.2.0/lib"
ExecStart=/usr/bin/env GENARRATIVE_PROCESS_ROLE=bgfilter-worker OTEL_SERVICE_NAME=genarrative-bgfilter-worker /opt/genarrative/current/api-server
Restart=always
RestartSec=5
KillSignal=SIGINT
# shutdown 会立即拒绝仍在排队的请求,只排空已取得 provider permit 的调用;默认 N=16、est=5000ms 时 callBudgetMs=321s,额外窗口用于响应发送和进程收口。
TimeoutStopSec=900
LimitNOFILE=65535
TasksMax=2048
# 固定 loopback 地址与非模板 unit 共同保证首版同机只运行一个 BgFilter worker。
NoNewPrivileges=true
PrivateTmp=true
ProtectSystem=full
ReadWritePaths=/opt/genarrative /var/lib/genarrative
[Install]
WantedBy=multi-user.target