gate Ollama install/start/pull/launch behind y/N prompts#7
Merged
Conversation
install.sh now detects missing Ollama, a stopped daemon, and a missing default model, and prompts y/N before each system-touching step. The default answer is "no" so pressing Enter never installs a binary. Accepted yes responses: y, Y, yes, Yes, YES. run.sh mirrors the prompt helper and offers to start "ollama serve" when it sees the binary but not the daemon. CI/unattended controls: TUTOR_NONINTERACTIVE=1 / PYTHON_TUTOR_NONINTERACTIVE=1 -> auto-no PYTHON_TUTOR_ASSUME_YES=1 -> auto-yes PYTHON_TUTOR_AUTOLAUNCH=1 -> exec run.sh After install, the script also asks "Launch the tutor now?" and execs ./run.sh on yes (ASSUME_YES/AUTOLAUNCH auto-accept). Adds scripts/smoke_prompts.sh covering the noninteractive path, auto-no marker, the PYTHON_TUTOR_NONINTERACTIVE alias, and the ASSUME_YES auto-launch via a stubbed run.sh. CI runs it after the existing install/run smoke jobs. Updates README quick start + troubleshooting and docs/install-runtime-workflow.md (new mermaid flow) to document the opt-in behaviour and env vars.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Make
./install.sh(and./run.sh) detect missing prerequisites and prompt the user y/N before doing anything that touches the host. The default answer is no, so a stray Enter never installs a system binary. This keeps the "minimal intervention" promise of the two-script flow while removing the prior hard requirement that the user install/start Ollama by hand.install.sh— adds aconfirm()helper and gates four actions behind y/N:brew install ollamaon macOS or the upstreamcurl ... | shon Linux),ollama servein the background (nohup, logged to/tmp/ollama-serve.log),ollama pull "$TUTOR_MODEL"(defaultgemma3:4b),exec ./run.shto launch the app immediately after setup.run.sh— mirrors the helper and offers to startollama servewhen the binary is present but the daemon is not. Bootstrapping a fresh venv viainstall.shis now done in noninteractive + skip-Ollama mode sorun.shnever installs system binaries silently.y,Y,yes,Yes,YES. All four prompts default to "no" otherwise.TUTOR_NONINTERACTIVE=1/PYTHON_TUTOR_NONINTERACTIVE=1→ auto-noPYTHON_TUTOR_ASSUME_YES=1→ auto-yes (suitable for pre-approved unattended setup)PYTHON_TUTOR_AUTOLAUNCH=1→exec ./run.shafter install without askingTUTOR_SKIP_OLLAMA=1/TUTOR_SKIP_MODEL_PULL=1continue to workdocs/install-runtime-workflow.mdgets a refreshed Decision section and a new mermaid flow diagram showing every y/N gate.scripts/smoke_prompts.shexercises the noninteractive path, thePYTHON_TUTOR_NONINTERACTIVEalias, and thePYTHON_TUTOR_ASSUME_YESauto-launch (via a temporarily symlinkedrun.shstub so CI doesn't actually start uvicorn). Wired into the existingscriptsCI job.Behavior
Default flow (interactive, no Ollama present on a Linux box):
Pressing Enter (no) prints the manual command and moves on. Typing
yrunscurl -fsSL https://ollama.com/install.sh | sh. The next prompts (Start ollama serve…,Pull gemma3:4b…,Launch the tutor now…) are gated identically.Testing
Local, on this branch:
bash -n install.sh run.sh scripts/smoke_prompts.sh— syntax check.TUTOR_SKIP_OLLAMA=1 TUTOR_NONINTERACTIVE=1 ./install.sh— completes, prints[auto-no]on the launch prompt, leavesbackend/.venvusable.PYTHON_TUTOR_NONINTERACTIVE=1 TUTOR_SKIP_OLLAMA=1 ./install.sh— alias works identically.PYTHON_TUTOR_ASSUME_YES=1 TUTOR_SKIP_OLLAMA=1 ./install.sh(withrun.shsymlinked to a stub) — prints[auto-yes], execs./run.sh../scripts/smoke_prompts.sh— all three runs green../scripts/smoke_run.sh— server boots,/api/healthreturns degraded (no Ollama),/serves the SPA.backend/.venv/bin/pytest -q—89 passed in 3.06s.CI runs
scripts/smoke_prompts.shalongside the existing install + run smoke jobs.🤖 Generated by Computer