[PR #2598] [CLOSED] Docker: IDLE_UNLOAD_S unloads the model after that many idle seconds, for a config setup rewrites too (#1952) #4153

Closed
opened 2026-11-07 15:33:38 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/2598
Author: @qiuzan2001
Created: 10/15/2026
Status: ❌ Closed

Base: main ← Head: chief-serve/docker-idle-unload


📝 Commits (1)

  • 31e7e44 Docker: IDLE_UNLOAD_S unloads the model after that many idle seconds, for a config setup rewrites too (#1952)

📊 Changes

7 files changed (+54 additions, -4 deletions)

View changed files

📝 Dockerfile (+2 -1)
📝 docker-entrypoint.sh (+3 -0)
📝 docs/DETAILS.md (+1 -1)
📝 docs/INSTALL.md (+3 -0)
📝 serve/server.py (+17 -1)
📝 serve/test_lifecycle.py (+20 -0)
📝 tools/test_docker_entrypoint.py (+8 -1)

📄 Description

Fixes #1952 (opt-in: nothing changes unless the variable is set).

What it changes. The server's idle unload ("idle_unload_s" in the run config, --idle-unload) was reachable
in the container only by editing the generated config on the volume, and REINSTALL=1 rewrote that config without
it.

  • docker-entrypoint.sh reads IDLE_UNLOAD_S and exports it as STRATA_IDLE_UNLOAD_S before it starts setup.
    setup starts the server with the inherited environment.
  • serve/server.py: a new idle_unload_seconds(arg, cfg, env) takes --idle-unload, else the config's
    "idle_unload_s", else STRATA_IDLE_UNLOAD_S. A value that is not a number is said once, and the model stays
    loaded.
  • docs/INSTALL.md (Docker), the DETAILS.md settings row and the Dockerfile's list of env vars say so.

What it leaves alone. Without the variable, every config gives the same value as before: a missing key, null
and "" give 0; 0, a number and a numeric string are read as before. A config's own "idle_unload_s" (a 0
included) still wins over the variable, and --idle-unload wins over both. The idle unload itself is unchanged.

How it was checked.

  • tools/test_docker_entrypoint.py test_idle_unload_s_reaches_the_server_1952: the server's environment gets
    STRATA_IDLE_UNLOAD_S=120 on a plain start and with REINSTALL=1, and nothing when the variable is empty. (The
    stub server prints the variable.)
  • serve/test_lifecycle.py IdleUnloadSetting: the order of the three sources, a config's 0, no variable, a
    variable that is not a number, and a negative one.
  • Both fail on main. python3 tools/test_docker_entrypoint.py: 10 OK. With the venv's Python, serve.test_lifecycle,
    serve.test_runconfig and serve.test_server: OK.
  • Python 3.14, Ubuntu (Linux 7.0). Not run in the Docker image.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/2598 **Author:** [@qiuzan2001](https://github.com/qiuzan2001) **Created:** 10/15/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `chief-serve/docker-idle-unload` --- ### 📝 Commits (1) - [`31e7e44`](https://github.com/Niko1221/Strata/commit/31e7e443b51183ed3972755a0fead3c5f2c97d19) Docker: IDLE_UNLOAD_S unloads the model after that many idle seconds, for a config setup rewrites too (#1952) ### 📊 Changes **7 files changed** (+54 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `Dockerfile` (+2 -1) 📝 `docker-entrypoint.sh` (+3 -0) 📝 `docs/DETAILS.md` (+1 -1) 📝 `docs/INSTALL.md` (+3 -0) 📝 `serve/server.py` (+17 -1) 📝 `serve/test_lifecycle.py` (+20 -0) 📝 `tools/test_docker_entrypoint.py` (+8 -1) </details> ### 📄 Description Fixes #1952 (opt-in: nothing changes unless the variable is set). **What it changes.** The server's idle unload (`"idle_unload_s"` in the run config, `--idle-unload`) was reachable in the container only by editing the generated config on the volume, and `REINSTALL=1` rewrote that config without it. - `docker-entrypoint.sh` reads `IDLE_UNLOAD_S` and exports it as `STRATA_IDLE_UNLOAD_S` before it starts setup. setup starts the server with the inherited environment. - `serve/server.py`: a new `idle_unload_seconds(arg, cfg, env)` takes `--idle-unload`, else the config's `"idle_unload_s"`, else `STRATA_IDLE_UNLOAD_S`. A value that is not a number is said once, and the model stays loaded. - docs/INSTALL.md (Docker), the DETAILS.md settings row and the Dockerfile's list of env vars say so. **What it leaves alone.** Without the variable, every config gives the same value as before: a missing key, `null` and `""` give 0; `0`, a number and a numeric string are read as before. A config's own `"idle_unload_s"` (a `0` included) still wins over the variable, and `--idle-unload` wins over both. The idle unload itself is unchanged. **How it was checked.** - `tools/test_docker_entrypoint.py` `test_idle_unload_s_reaches_the_server_1952`: the server's environment gets `STRATA_IDLE_UNLOAD_S=120` on a plain start and with `REINSTALL=1`, and nothing when the variable is empty. (The stub server prints the variable.) - `serve/test_lifecycle.py` `IdleUnloadSetting`: the order of the three sources, a config's `0`, no variable, a variable that is not a number, and a negative one. - Both fail on `main`. `python3 tools/test_docker_entrypoint.py`: 10 OK. With the venv's Python, `serve.test_lifecycle`, `serve.test_runconfig` and `serve.test_server`: OK. - Python 3.14, Ubuntu (Linux 7.0). Not run in the Docker image. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:33:38 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#4153
No description provided.