Skip to content

scripts: bootstrap-buildhost.sh — turn a checkout into a build host - #11

Merged
daniel-rossier merged 1 commit into
mainfrom
bootstrap-buildhost
Nov 14, 2026
Merged

daniel-rossier merged 1 commit into
mainfrom
bootstrap-buildhost

Conversation

@daniel-rossier

Copy link
Copy Markdown
Contributor

Why

spear-image build reuses the staging scripts, which run python3 from the PATH to read the corpus index. A fresh checkout therefore cannot build an image until it has three machine-local things the repo deliberately does not carry: a client venv, a corpus registry (client/projects.json) and a prebuilt index (client/chromadb). Setting those up by hand is fiddly and easy to get subtly wrong (which python, which chromadb version, where the index goes).

This makes "fresh clone → build host" a documented, idempotent one-liner — so a colleague can stand up their own build host on their own machine.

What it does

  • venv: default installs only chromadb (pinned from requirements.txt) — the single dependency the staging scripts import, enough to build from an existing index. --full installs deploy/requirements.txt (for building an index or native spear-chat); torch stays manual (CUDA-specific, per the note in requirements.txt).
  • registry: --projects FILE copies one into client/projects.json; otherwise reports it missing (spear-corpus add writes it).
  • index: --index-from DIR copies an existing chromadb; the index is never built here (hours of GPU embedding) — spear-corpus add --autoindex / /reindex do that, offloading via SPEAR_EMBED_REMOTE.
  • Idempotent (keeps an existing venv/index unless --force), ends by importing chromadb from the venv and reporting whether a build would find everything.

Notes

  • Staging scripts import only chromadb + stdlib — verified — which is why the build-only venv is correct and light.
  • Does not edit local.conf; points the operator at spear-configure and local.conf.example for PATH/SPEAR_ENTITY/SPEAR_COMMONS/registry.

spear-image build reuses the staging scripts, which run python3 from the PATH
to read the corpus index; so a checkout cannot build an image until it has
three machine-local things the repo does not carry: a client venv, a corpus
registry (client/projects.json) and a prebuilt index (client/chromadb).

This sets them up idempotently. The default venv installs only chromadb -- the
one dependency the staging scripts import, enough to build from an existing
index; --full installs requirements.txt (for indexing or native spear-chat),
though torch stays manual (CUDA-specific). --index-from copies an index,
--projects copies a registry; the index is never built here (hours of GPU
embedding) -- spear-corpus / reindex do that, or a copy. Ends by importing
chromadb from the venv and saying whether a build would find everything.
@daniel-rossier
daniel-rossier merged commit 142a76d into main Nov 14, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant