diff --git a/agent/fc_agent/app.py b/agent/fc_agent/app.py index 05a6e2e..c6cb747 100644 --- a/agent/fc_agent/app.py +++ b/agent/fc_agent/app.py @@ -6,6 +6,8 @@ bandwidth for throughput), and watch GPU load + buffer occupancy + progress + the server-side queue. Config is env-seeded; the downloader count is adjustable here on the fly (GPU consumers autoscale between 1 and 2 on their own). """ +import logging + from fastapi import FastAPI, Request from fastapi.responses import HTMLResponse, JSONResponse @@ -14,10 +16,12 @@ from .config import Config from .gpu import read_gpu from .worker import Worker +log = logging.getLogger("fc_agent.app") + # Bump on every agent change. The page embeds this and /status reports it; the UI # warns to reload when they differ — so a stale browser-cached page can't be # mistaken for "the new image didn't deploy". (Belt-and-braces with no-store.) -VERSION = "2026-07-01.6 · stream videos via ffmpeg-from-URL (no full download)" +VERSION = "2026-07-01.8 · real start/stop state machine (no more stuck 'stopping')" logbuf.install() cfg = Config.from_env() @@ -53,12 +57,14 @@ def index() -> str: @app.post("/start") def start(): + log.info("UI: Start button pressed") # the press; worker logs the transition worker.start() return JSONResponse(worker.status()) @app.post("/stop") def stop(): + log.info("UI: Stop button pressed") worker.stop() return JSONResponse(worker.status()) @@ -218,11 +224,11 @@ _PAGE = """
Status
state
-
0
downloaders
-
buffer
-
0
on GPU
+
jobs / min
+
downloads / min
0
processed
0
errors
+
0
waited out
GPU util
@@ -232,7 +238,7 @@ _PAGE = """
buffer occupancy
-
consumers — · waited out 0
+
downloaders — · consumers — · on GPU 0
queue —
@@ -246,6 +252,11 @@ _PAGE = """