cf-node-bootstrap/cf-apps/kiwi.manifest
pyr0ball bc9d1e564f fix: stop double-executing git clone / setup hooks via run()
run() re-splits its argument as a bare string with no eval, so any
call like run "git clone \"$url\" \"$dir\"" corrupts the quoted
arguments (embedded escaped quotes survive as literal characters,
e.g. git sees the protocol as '"https). Each of the 4 affected call
sites papered over this by following run() with a second, correctly
quoted manual execution of the same command - meaning every real run
double-executed (git clone twice, pip install -e twice, conda env
create twice), with the first, corrupted attempt's failure masked by
the working second attempt.

Fixed by dropping run() at these sites entirely and gating on
$dry_run directly with a single, properly quoted real execution path
(matches the pattern already used in the new model-cache-redirect
extra):
- lib/cf-apps.functions: install-cf-app's clone, provision-orchard-node's clone
- cf-apps/circuitforge-core.manifest: pip install -e setup hook
- cf-apps/kiwi.manifest: conda env create setup hook

Verified on sif via a scratch-dir harness (install-cf-app
circuitforge-core): first run now clones cleanly with no mangled-URL
error, second run correctly skips the clone and re-runs the
idempotent pip install; state.conf stays single-entry across both.
2026-07-18 22:12:05 -07:00

35 lines
1.7 KiB
Text

app_name="kiwi"
app_desc="Pantry tracker + leftover recipe suggestions (beta)"
app_repo_url_github="https://github.com/CircuitForgeLLC/kiwi.git"
app_repo_url_forgejo="https://git.opensourcesolarpunk.com/Circuit-Forge/kiwi.git"
app_available_profiles=(oem collaborator)
app_install_types=(docker bare-metal)
app_conda_env="kiwi"
app_env_template=".env.example"
app_needs_core=true
# kiwi has a single Dockerfile (no compose), listening on 8512. No
# persistent-storage volume is assumed here since that isn't documented;
# follow up manually if kiwi needs one for your data to survive a restart.
app_setup_docker() {
local dir="$1"
boxline "Building and running ${app_name} (port 8512)..."
(cd "$dir" && docker build -t "${app_name}" .)
(cd "$dir" && docker run -d --name "${app_name}" --env-file .env -p 8512:8512 "${app_name}")
}
# kiwi's bare-metal path is documented (docs/getting-started/installation.md,
# llm-setup.md - BYOK: Ollama/vLLM/OpenAI/Anthropic) but not scripted end to
# end. This creates the conda env from environment.yml; point the user at
# the docs for the LLM backend choice rather than guessing one.
app_setup_bare_metal() {
local dir="$1"
if [[ $dry_run == true ]]; then
boxline "DryRun: conda env create -f ${dir}/environment.yml -n ${app_conda_env}"
else
# run() re-splits its argument as a bare string with no eval, which
# mangles the quoted paths - execute directly instead.
conda env create -f "${dir}/environment.yml" -n "${app_conda_env}"
fi
boxline "${app_name}: conda env '${app_conda_env}' created. See docs/getting-started/installation.md and llm-setup.md for the remaining BYOK LLM backend setup (Ollama/vLLM/OpenAI/Anthropic)."
}