Studio: switch hardware profile from the UI, not from four env vars #36
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
cmoriarty/trog#36
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Switching the rig between
trogdor-qualityandtrogdor-speed(#35) currently means editing four env vars in the Portainer stack and redeploying. That is the wrong surface for something a human should be able to decide mid-session — "generate this one fast and rough" vs "generate this one properly" is a judgement call about the work in front of you, not a deployment change.What exists to build on
GET /orch/healthandGET /orch/configalready carry ahardwareblock: resolved profile name, description,brain_resident,brain_gpus, roster, and the seat→card map.GET /orch/profileslists every shipped profile with the same shape, so the picker has its options without the studio learning the YAML.brain_pinning).trog profile <name>is the interim CLI path (deliberate: the UI was deferred, not skipped).What the studio needs
A picker — most likely beside the brain selector, since it answers the same class of question — that shows the current profile and switches to another. Switching must be honest about its cost: it is a stack redeploy, the brain reloads its roster, and in-flight work has to be finished or refused first.
The hard part, stated up front
The orchestrator does not create the brain container; compose does. So a switch is not a runtime toggle — it edits the deployment's env (
TROG_PROFILE,BRAIN_ROSTER,BRAIN_GPUS,BRAIN_CPUSET, which must move together) and redeploys the stack. Two candidate shapes:POST /profilethat patches the stack env and redeploys. Cost: the orchestrator learns about Portainer, which nothing server-side currently knows, and it needs a Portainer token — a real widening of what a compromised orchestrator can do.CUDA_VISIBLE_DEVICES/cpuset and reload its own profile. Cost: the container then differs from what compose declares, so the next unrelated redeploy silently reverts the profile — and the deployment rule is that Portainer stack config is truth.Neither is obviously right. Worth deciding before building the picker, because the answer decides whether this is a studio feature or a deployment feature wearing a studio hat.
Done when
brain_pinningstays null.Related: #35 (the two profiles and the resident brain), #7 (studio), #27 (hardware profiles).