fix: install make in setup.sh; guard manage.sh against missing make
setup.sh now installs make (via apt/dnf/pacman/brew) before git and Docker so that manage.sh commands work out of the box on minimal server installs. manage.sh adds a preflight guard that catches a missing make early and redirects the user to ./manage.sh setup. Also fixes the post-setup next-steps hint to use ./manage.sh instead of bare make.
This commit is contained in:
parent
630b2cad41
commit
ab5750d5fc
2 changed files with 25 additions and 2 deletions
|
|
@ -66,6 +66,13 @@ done
|
|||
|
||||
SERVICE="${1:-app}" # used by `logs` command
|
||||
|
||||
# ── Dependency guard ──────────────────────────────────────────────────────────
|
||||
# Commands that delegate to make; others (status, logs, update, open, setup) run fine without it.
|
||||
_MAKE_CMDS="start stop restart preflight test prepare-training finetune clean"
|
||||
if [[ " $_MAKE_CMDS " == *" $CMD "* ]] && ! command -v make &>/dev/null; then
|
||||
error "'make' is not installed. Run: ./manage.sh setup then retry: ./manage.sh ${CMD}"
|
||||
fi
|
||||
|
||||
# ── Commands ─────────────────────────────────────────────────────────────────
|
||||
case "$CMD" in
|
||||
|
||||
|
|
|
|||
20
setup.sh
20
setup.sh
|
|
@ -49,6 +49,21 @@ SUDO="$(need_sudo)"
|
|||
|
||||
cmd_exists() { command -v "$1" &>/dev/null; }
|
||||
|
||||
# ── Build tools (make, etc.) ───────────────────────────────────────────────────
|
||||
install_build_tools() {
|
||||
if cmd_exists make; then success "make already installed: $(make --version | head -1)"; return; fi
|
||||
info "Installing build tools (make)…"
|
||||
case "$DISTRO_FAMILY" in
|
||||
debian) $SUDO apt-get update -q && $SUDO apt-get install -y make ;;
|
||||
fedora) $SUDO dnf install -y make ;;
|
||||
arch) $SUDO pacman -Sy --noconfirm make ;;
|
||||
macos)
|
||||
if cmd_exists brew; then brew install make
|
||||
else error "Homebrew not found. Install it from https://brew.sh then re-run this script."; fi ;;
|
||||
esac
|
||||
success "make installed."
|
||||
}
|
||||
|
||||
# ── Git ────────────────────────────────────────────────────────────────────────
|
||||
install_git() {
|
||||
if cmd_exists git; then success "git already installed: $(git --version)"; return; fi
|
||||
|
|
@ -300,6 +315,7 @@ main() {
|
|||
echo -e "${BLUE}╚══════════════════════════════════════════════════════╝${NC}"
|
||||
echo ""
|
||||
|
||||
install_build_tools
|
||||
install_git
|
||||
# Podman takes precedence if already installed; otherwise install Docker
|
||||
if ! check_podman; then
|
||||
|
|
@ -316,8 +332,8 @@ main() {
|
|||
echo ""
|
||||
echo -e " ${GREEN}Next steps:${NC}"
|
||||
echo -e " 1. Start Peregrine:"
|
||||
echo -e " ${YELLOW}make start${NC} # remote/API-only (no local GPU)"
|
||||
echo -e " ${YELLOW}make start PROFILE=cpu${NC} # local Ollama inference (CPU)"
|
||||
echo -e " ${YELLOW}./manage.sh start${NC} # remote/API-only (no local GPU)"
|
||||
echo -e " ${YELLOW}./manage.sh start --profile cpu${NC} # local Ollama inference (CPU)"
|
||||
echo -e " 2. Open ${YELLOW}http://localhost:8501${NC} — the setup wizard will guide you"
|
||||
echo -e " (Tip: edit ${YELLOW}.env${NC} any time to adjust ports or model paths)"
|
||||
echo ""
|
||||
|
|
|
|||
Loading…
Reference in a new issue