Rename to gpu-turnstile; swap port roles

The proxy now listens on the standard service ports (Ollama :11434,
ComfyUI :8188) and the actual services move one port up (:11435, :8189).
Metric prefix is now gpu_turnstile_.
This commit is contained in:
mram
2026-09-20 18:10:22 +02:00
parent 065c294a96
commit db11da8307
10 changed files with 113 additions and 105 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
// Package proxy contains the HTTP handlers for both gpulock listeners:
// Package proxy contains the HTTP handlers for both gpu-turnstile listeners:
// reverse proxies to Ollama and ComfyUI with GPU lock arbitration in front
// of the endpoints that load models.
package proxy
@@ -43,7 +43,7 @@ type Config struct {
WarmModel string
}
// Server serves both gpulock listeners.
// Server serves both gpu-turnstile listeners.
type Server struct {
cfg Config
log *slog.Logger
+9 -9
View File
@@ -40,13 +40,13 @@ func (r *recorder) index(e string) int {
return -1
}
// fakes wires up fake Ollama and ComfyUI upstreams plus the gpulock server.
// fakes wires up fake Ollama and ComfyUI upstreams plus the gpu-turnstile server.
type fakes struct {
rec *recorder
ollama *httptest.Server
comfy *httptest.Server
server *httptest.Server // Ollama-facing gpulock listener
comfySrv *httptest.Server // ComfyUI-facing gpulock listener
server *httptest.Server // Ollama-facing gpu-turnstile listener
comfySrv *httptest.Server // ComfyUI-facing gpu-turnstile listener
freeCh chan struct{}
chatCh chan struct{}
historyMu sync.Mutex
@@ -279,7 +279,7 @@ func TestStreamingNotBuffered(t *testing.T) {
}
defer resp.Body.Close()
// If gpulock buffered the stream, this read would never complete while
// If gpu-turnstile buffered the stream, this read would never complete while
// the gate is closed.
line, err := bufio.NewReader(resp.Body).ReadString('\n')
if err != nil {
@@ -321,11 +321,11 @@ func TestHealthzAndMetrics(t *testing.T) {
resp.Body.Close()
text := string(body)
for _, want := range []string{
`gpulock_state{state="idle"} 1`,
"gpulock_llm_inflight 0",
"gpulock_image_jobs_total 0",
`gpulock_lock_wait_seconds_bucket{kind="llm",le="+Inf"} 0`,
"gpulock_unload_seconds_count{} 0",
`gpu_turnstile_state{state="idle"} 1`,
"gpu_turnstile_llm_inflight 0",
"gpu_turnstile_image_jobs_total 0",
`gpu_turnstile_lock_wait_seconds_bucket{kind="llm",le="+Inf"} 0`,
"gpu_turnstile_unload_seconds_count{} 0",
} {
if !strings.Contains(text, want) {
t.Fatalf("metrics missing %q", want)