From 65a2e51af8877e91de410f3f6d1e5e65a89ab089 Mon Sep 17 00:00:00 2001 From: pewdiepie-archdaemon Date: Sun, 14 Jun 2026 08:45:43 +0900 Subject: [PATCH] Cookbook deps: convert manual install snippets to Run buttons MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was just a copy-paste reference. Each row now has a Run button that launches the command as a tmux task on the currently-selected deps server (same path Reinstall already uses) — Odysseus does the work, the user watches progress in the Active tab. Dropped the plain pip option since the existing per-package Install button already covers it; kept uv (recommended) and Docker pull as the two alternatives. --- static/js/cookbook.js | 57 +++++++++++++++++++++++++++++++------------ 1 file changed, 41 insertions(+), 16 deletions(-) diff --git a/static/js/cookbook.js b/static/js/cookbook.js index ebdc3c5ed..b1610c50c 100644 --- a/static/js/cookbook.js +++ b/static/js/cookbook.js @@ -915,6 +915,30 @@ async function _fetchDependencies() { }); }); + // Wire the alternative-install "Run" buttons in the Manual block. + // Each action launches the underlying command as a tmux task on the + // currently selected deps server, same as Reinstall does. + document.querySelectorAll('.cookbook-deps-run-btn').forEach(btn => { + if (btn._wired) return; + btn._wired = true; + btn.addEventListener('click', (e) => { + e.stopPropagation(); + const action = btn.dataset.depsAction; + const sel = document.getElementById('hwfit-deps-server'); + if (sel) _applyServerSelection(sel.value); + const host = _envState.remoteHost || ''; + const where = host || 'this server'; + const cmds = { + 'vllm-uv': 'uv venv && . .venv/bin/activate && uv pip install -U vllm --torch-backend auto', + 'vllm-docker': 'docker pull vllm/vllm-openai:latest', + }; + const cmd = cmds[action]; + if (!cmd) return; + if (!confirm(`Run on ${where}?\n\n${cmd}\n\nLaunches as a tmux task — watch progress in the Active tab.`)) return; + _launchServeTask(`deps-${action}`, 'deps-install', cmd); + }); + }); + // Wire the ⋮ menu on installed packages — currently just "Update". function _showDepMenu(anchor) { document.querySelectorAll('.cookbook-dep-menu').forEach(d => d.remove()); @@ -2063,28 +2087,29 @@ function _renderRecipes() { html += ''; html += ''; html += '

Optional packages that extend Odysseus capabilities.

'; - // Manual install hints (collapsed). Useful when the in-app Install button - // can't run (offline server, custom torch backend, etc.) — three vetted - // recipes the user can copy verbatim into a terminal on the target box. + // Alternative install methods — Odysseus runs each in a tmux task on + // the selected server (watch in the Running tab). Wired to event + // delegation below; no need for per-button click handlers. html += '
'; - html += 'Manual install (vLLM): uv venv · pip/uv · Docker'; + html += 'Install vLLM (alternatives): uv venv · Docker'; html += '
'; - const _depCmdBlock = (label, body) => - `
` - + `
${label}
` - + `
${body}
` + const _depRunBlock = (label, body, action) => + `
` + + `
` + + `
${label}
` + + `` + + `
` + + `
${esc(body)}
` + `
`; - html += _depCmdBlock( + html += _depRunBlock( 'uv (recommended — fast, isolated venv)', - 'uv venv\nsource .venv/bin/activate\nuv pip install -U vllm --torch-backend auto' + 'uv venv && source .venv/bin/activate && uv pip install -U vllm --torch-backend auto', + 'vllm-uv' ); - html += _depCmdBlock( - 'pip', - 'python -m venv .venv\nsource .venv/bin/activate\npip install -U vllm' - ); - html += _depCmdBlock( + html += _depRunBlock( 'Docker', - 'docker pull vllm/vllm-openai:latest' + 'docker pull vllm/vllm-openai:latest', + 'vllm-docker' ); html += '
'; html += '
';