bootstrap: reuse the running checkout instead of re-cloning semif-agent

This commit is contained in:
Denton Social committed 2026-09-25 01:44:29 -05:00
1 parent 67027ecc20
commit 72af30f449
2 files changed
+24 -22

No files matched your search

+11 -7
View File
@@ -58,9 +58,10 @@ Integration tests run on the staging machine `jarvis` (see "### jarvis (staging)
- Canonical repo lives on Gitea: `git.manyworlds.fit`, **SSH on port 222** - Canonical repo lives on Gitea: `git.manyworlds.fit`, **SSH on port 222**
(`ssh://git@git.manyworlds.fit:222/gabby/semif-agent.git`). Key (`ssh://git@git.manyworlds.fit:222/gabby/semif-agent.git`). Key
`~/.ssh/id_ed25519` is registered there. The staging machine `jarvis` clones `~/.ssh/id_ed25519` is registered there. The staging machine `jarvis` runs
to `~/semif-agent` (via `scripts/bootstrap.sh`); the old box working copy is from a manual clone at `~/semif-agent` (`scripts/bootstrap.sh` provisions
at `~/repos/semif-agent` (its editable install still points at the moved everything else and never re-clones the agent repo); the old box working copy
is at `~/repos/semif-agent` (its editable install still points at the moved
`~/semif-agent`, so `import semif_agent` is broken there — moot, guppy runs `~/semif-agent`, so `import semif_agent` is broken there — moot, guppy runs
ollama only now); the dev machine at `~/Repos/semif-agent`. Push/pull from ollama only now); the dev machine at `~/Repos/semif-agent`. Push/pull from
Gitea — never rsync/tar the code. Gitea — never rsync/tar the code.
@@ -211,11 +212,14 @@ unit tests (24) + box integration tests (2).
### jarvis (staging) ### jarvis (staging)
- Provision a fresh Ubuntu machine into a running staging box: - Provision a fresh Ubuntu machine into a running staging box: clone
`semif-agent` to `~/semif-agent` first (register its SSH key on Gitea), then
`scripts/bootstrap.sh --peer-ollama http://192.168.8.181:11434`. `scripts/bootstrap.sh --peer-ollama http://192.168.8.181:11434`.
Idempotent and rerunnable; every stage no-ops on existing state, so it also The script must be run from a checkout — it reads pins from that checkout's
boots an unknown-state machine. It installs **no ollama** — llm + codegen `config.example.json` and never re-clones the agent repo (only the SemIf
both point at guppy. engine). Idempotent and rerunnable; every stage no-ops on existing state, so
it also boots an unknown-state machine. It installs **no ollama** — llm +
codegen both point at guppy.
- All pins are read from `config.example.json`'s `engine` block: `semif_repo` - All pins are read from `config.example.json`'s `engine` block: `semif_repo`
(public GitHub `TheoLeeCJ/SemIf`), `semif_ref` (pinned commit the box runs), (public GitHub `TheoLeeCJ/SemIf`), `semif_ref` (pinned commit the box runs),
`gguf_url`/`gguf_sha256` (verified after download), and the HF tokenizer `gguf_url`/`gguf_sha256` (verified after download), and the HF tokenizer
+13 -15
View File
@@ -5,6 +5,11 @@
# so it can also bootstrap a machine of unknown state. All LLM traffic points # so it can also bootstrap a machine of unknown state. All LLM traffic points
# at a peer ollama endpoint (default: guppy) — this script installs NO ollama. # at a peer ollama endpoint (default: guppy) — this script installs NO ollama.
# #
# Must be run from a semif-agent checkout (it reads pins from this checkout's
# config.example.json); the checkout is used as-is and never re-cloned — only
# the SemIf engine is fetched. Clone the agent repo to ~/semif-agent first
# (its SSH key must be registered on Gitea).
#
# Pins (SemIf git commit, GGUF url+sha256, python deps) are read from # Pins (SemIf git commit, GGUF url+sha256, python deps) are read from
# config.example.json's engine block, which is the single source of truth; # config.example.json's engine block, which is the single source of truth;
# bump those there and rerun to upgrade. # bump those there and rerun to upgrade.
@@ -102,23 +107,16 @@ if ! "$PY" -c 'import sys; raise SystemExit(0 if sys.version_info >= (3, 11) els
fi fi
echo "== python: $("$PY" --version)" echo "== python: $("$PY" --version)"
# --- stage 2: ssh key + clones ------------------------------------------------- # --- stage 2: ssh key + SemIf engine clone ------------------------------------
mkdir -p ~/.ssh mkdir -p ~/.ssh
if [[ ! -f ~/.ssh/id_ed25519 ]]; then if [[ ! -f ~/.ssh/id_ed25519 ]]; then
echo "== generating ~/.ssh/id_ed25519" echo "== generating ~/.ssh/id_ed25519 (register this key on Gitea for the agent repo)"
ssh-keygen -t ed25519 -N "" -f ~/.ssh/id_ed25519 ssh-keygen -t ed25519 -N "" -f ~/.ssh/id_ed25519
cat ~/.ssh/id_ed25519.pub
fi fi
if [[ ! -d ~/semif-agent/.git ]]; then AGENT_DIR="$REPO_ROOT"
echo "== cloning semif-agent from Gitea" git -C "$AGENT_DIR" pull --ff-only || true
if ! git clone ssh://git@git.manyworlds.fit:222/gabby/semif-agent.git ~/semif-agent; then
echo "clone failed — register this key on Gitea, then rerun:" >&2
cat ~/.ssh/id_ed25519.pub >&2
exit 1
fi
else
git -C ~/semif-agent pull --ff-only || true
fi
if [[ ! -d ~/semif/.git ]]; then if [[ ! -d ~/semif/.git ]]; then
echo "== cloning SemIf engine from $SEMIF_REPO" echo "== cloning SemIf engine from $SEMIF_REPO"
@@ -141,7 +139,7 @@ echo "== installing engine deps into venv"
"$PIP" install -e ~/semif --no-deps "$PIP" install -e ~/semif --no-deps
"$PIP" install numpy==2.3.5 transformers==5.17.0 tokenizers==0.23.2 huggingface-hub "$PIP" install numpy==2.3.5 transformers==5.17.0 tokenizers==0.23.2 huggingface-hub
CMAKE_BUILD_PARALLEL_LEVEL=6 MAKEFLAGS=-j6 "$PIP" install llama-cpp-python==0.3.35 CMAKE_BUILD_PARALLEL_LEVEL=6 MAKEFLAGS=-j6 "$PIP" install llama-cpp-python==0.3.35
"$PIP" install -e ~/semif-agent --no-deps "$PIP" install -e "$AGENT_DIR" --no-deps
"$PIP" install pytest "$PIP" install pytest
# --- stage 4: GGUF -------------------------------------------------------------- # --- stage 4: GGUF --------------------------------------------------------------
@@ -193,8 +191,8 @@ PY
# --- stage 7: optional data copy ----------------------------------------------------- # --- stage 7: optional data copy -----------------------------------------------------
if [[ -n "$COPY_DATA" ]]; then if [[ -n "$COPY_DATA" ]]; then
echo "== rsync data from $COPY_DATA" echo "== rsync data from $COPY_DATA"
mkdir -p ~/semif-agent/data mkdir -p "$AGENT_DIR/data"
rsync -a "$COPY_DATA/" ~/semif-agent/data/ rsync -a "$COPY_DATA/" "$AGENT_DIR/data/"
fi fi
# --- stage 8: verify -------------------------------------------------------------------- # --- stage 8: verify --------------------------------------------------------------------