Repository navigation
Conversation
|
Thanks @djmaze - I'd like to take the Docker build. One change first: |
|
Env flag is now there. |
…t only downloads the model docker build has no GPU, so the CUDA architectures are fixed by an ARG (80;86;89;120) instead of read from nvidia-smi; the engine is a fat binary with a cubin per arch. BUILD.json is written with source=local and the source hash, so setup reuses it instead of recompiling. The entry point keeps the install config on the volume and selects it by family and model, so switching between models already set up needs no setup pass. REINSTALL stays for settings recorded inside a config. HEALTHCHECK hits /health, which is answered before the API key gate, with a start period covering the model load. Co-Authored-By: DeepSeek Harness (Qwen3.8-Flash-Next) <noreply@deepseek.com>
PID 1 in a PID namespace ignores a signal whose disposition is the default, and Python installs a handler only for SIGINT, so docker stop's SIGTERM was dropped and the container was killed after the grace period (exit 137). The cleanup path ran only on Ctrl-C, and setup.py spawned the server as a child, so the signal never reached the process that owns the engine's stdin. server.py now handles SIGTERM the way it handles Ctrl-C, and setup.py replaces itself with the server on POSIX, so the server is PID 1 in the container. The engine still ends by its QUIT line, which only the server can write, so stop with a longer grace: engine.close() waits 10s for the reply, hub.close() 2s more, and the engine reads QUIT between requests. Co-Authored-By: DeepSeek Harness (Qwen3.8-Flash-Next) <noreply@deepseek.com>
os.execv changed every Linux start, not only the container's. setup.start now replaces itself with the server only when STRATA_EXECV is set, and the Dockerfile sets it: normal Linux starts keep spawning the server as a child, the container still gets the server at PID 1 so docker stop's SIGTERM reaches the process that can answer the engine with QUIT. Co-Authored-By: DeepSeek Harness (Qwen3.8-Flash-Next) <noreply@deepseek.com>
|
I realize that some features have been added since, which are now missing from the docker setup. Those would necessitate new Would you like me to update the branch and add these? With a rebase or merge? Or should we get this in first so I can create a follow-up PR? |
The setup options added since 0.1.20 had no way through the container: - KV: --kv int8|q4_0|k8v4 (k8v4 came with 0.1.25). - GPUS / GPU / LAYER_SPLIT: the layer split from 0.1.21. Passed at the start too, where they pin the cards for this model; without them a config that names one card is offered once to a pair when the host has two that can share it (setup.offer_together), and that answer is written to the volume. - LOW_RAM: --low-ram on|off|auto. setup.py reads the RAM from /proc/meminfo, which in a container is the host's total, so a memory-capped container has to ask for the low-RAM mode itself. - VISION now also takes cpu, which setup.py already accepted.
|
I just rebased and added the missing features. |
|
Thanks. #153 (merged for 0.1.28) changes the same Ctrl+C block in |
|
Released in 0.1.30: hand-merged onto the current tree: the engine compiled in |
…TA_EXECV so the server is PID 1, SIGTERM stops it cleanly, KV/GPUS/LOW_RAM as env vars Merged by hand onto 0.1.29: SIGTERM takes Niko1221#153's Ctrl+C path (the timed sleep loop and the second-Ctrl+C kill stay); SIGINT keeps Python's handler; the image builds RTX 20 (75) too. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0154bwiad8gY7wRehCXy27pN
|
Btw, thanks for this amazing piece of software! |
…TA_EXECV so the server is PID 1, SIGTERM stops it cleanly, KV/GPUS/LOW_RAM as env vars Merged by hand onto 0.1.29: SIGTERM takes Niko1221#153's Ctrl+C path (the timed sleep loop and the second-Ctrl+C kill stay); SIGINT keeps Python's handler; the image builds RTX 20 (75) too.
…TA_EXECV so the server is PID 1, SIGTERM stops it cleanly, KV/GPUS/LOW_RAM as env vars Merged by hand onto 0.1.29: SIGTERM takes Niko1221#153's Ctrl+C path (the timed sleep loop and the second-Ctrl+C kill stay); SIGINT keeps Python's handler; the image builds RTX 20 (75) too.
…TA_EXECV so the server is PID 1, SIGTERM stops it cleanly, KV/GPUS/LOW_RAM as env vars Merged by hand onto 0.1.29: SIGTERM takes Niko1221#153's Ctrl+C path (the timed sleep loop and the second-Ctrl+C kill stay); SIGINT keeps Python's handler; the image builds RTX 20 (75) too. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0154bwiad8gY7wRehCXy27pN
main() installed its stop handler only for a SIGTERM that was not ignored from the start, as for nohup's SIGHUP. A launcher that ignores SIGTERM (a supervisor, a script with trap '' TERM) passes that on, and the server then did nothing on kill, docker stop or systemctl stop until the final SIGKILL, which loses the engine's expert profile - the server before these changes handled SIGTERM always (Niko1221#96). SIGTERM now always takes the stop path; an ignored SIGINT or SIGHUP stays ignored. The new test starts the server through a launcher that ignores SIGTERM and sends it one: the engine gets QUIT (it timed out before, and passed on the code before these changes). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019zfufgbZ8KfWVmJivGBFLe
The engine is compiled during docker build, so the first start only downloads the model.
docker build has no GPU, so the CUDA architectures are fixed by an ARG (80;86;89;120) instead of read from nvidia-smi; the engine is a fat binary with a cubin per arch. BUILD.json is written with source=local and the source hash, so setup reuses it instead of recompiling.
The entry point keeps the install config on the volume and selects it by family and model, so switching between models already set up needs no setup pass. REINSTALL stays for settings recorded inside a config.