GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||
GeezerVison is showing github.com — feat: runed self-bootstrap with manifest-driven artifact install by couragehong · Pull Request #4 · CryptoLabInc/runed Conversation
|
|
Could you rebase the branch firstly please? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
internal/bootstrap downloads the llama-server tarball and embedding GGUF described by a manifest at first boot, so runed can run standalone without pre-installed dependencies or external setup scripts. - paths.go: Paths struct, EnsureDirs, model variant filenames - config.go: ~/.runed/config.json reader (model_variant), tolerant of spawn-package fields so both readers can share one file - manifest.go: schema + FetchManifest (30s timeout, 1MB body cap). DefaultManifestURL for ldflags injection. - download.go: streaming SHA-256 verify, partial+rename atomic commit, 2h absolute timeout per artifact - extract.go: tar.gz extract with path-traversal defense (symlinks/hardlinks/devices skipped) - lock.go: advisory flock with polling - install.go: EnsureAll holds install.lock, ensures llama_server via sidecar SHA marker, ensures model via per-file hash compare, emits throttled progress through *slog.Logger
cmd/runed/main.go calls selfBootstrap when RUNED_LLAMA_SERVER or RUNED_MODEL is unset, then proceeds to backend.Start. - anotherDaemonReachable probe before bootstrap: exit 0 if another daemon already serves the socket; clean up stale socket files - threads the daemon's *slog.Logger into bootstrap.EnsureAll for step-by-step INFO output (manifest fetch, ensure target, cache hit, downloading, extracting, install complete) - HTTP-not-HTTPS manifest URL warning
spawn config no longer requires the file or any field. LlamaServer / Model staying unset means "let the daemon self-bootstrap"; launchDaemon no longer forces those values into the child env. RunedBinary resolution chain: config > PATH > DefaultRunedBinary (ldflags) > os.Executable (basename=="runed") > error Makefile injects DEFAULT_MANIFEST_URL and DEFAULT_RUNED_BINARY via -ldflags. Both runed and rundemo receive the same flags so a client auto-spawning the daemon resolves the binary without env or config.
dev_standalone.sh runs an end-to-end self-bootstrap test against a local
HTTP server:
- copies scripts/manifest.dev.json into the docroot
- serves it via python3 -m http.server (background)
- builds runed + rundemo with DEFAULT_MANIFEST_URL pointing at the
local server and DEFAULT_RUNED_BINARY=$HOME/.runed/bin/runed
- symlinks ~/.runed/bin/runed -> ./bin/runed so client auto-spawn
resolves the freshly-built fork binary
- --clean wipes ~/.runed/{bin/llama-cpp,models,cache} for fresh-install
verification
manifest.dev.json carries the URL/sha256/size metadata so the runner
script holds no artifact specifics.
go fmt ./... normalized doc-comment indentation that drifted in the fork. No behaviour change.
Replace TBD sections with the actual flow: - Installation: rune install bakes DEFAULT_MANIFEST_URL into the binary; scripts/dev_standalone.sh for local testing - Usage: spawn-on-Connect via client.Connect, foreground launch for dev - Configuration: env var table, build-time ldflags, manifest format reference, config.json shared by spawn + bootstrap readers
52d1fe7 to
07b9b24
Compare
Finished rebase and resolved merge conflict with minor fix! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Build instructions belong with the rest of the developer setup in CONTRIBUTING.md. The README only keeps a one-line pointer for readers who notice the build-time ldflags default in the env table. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Decoder.Decode silently accepts garbage after the JSON document; for a channel where the body must be exactly one manifest, the stricter Unmarshal surfaces corruption / MITM as a parse error instead of swallowing it. Drops the now-unused bytes import and adds a regression test that pins the trailing-data rejection. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Compare resp.ContentLength against the manifest's expectedSize right after the HTTP status check, so a divergence aborts the request before ~470MB of model bytes hit the partial file. The post-stream size check stays as a safety net for chunked transfers (ContentLength == -1) and for servers that lie in their headers. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
The old strings.Contains(name, "..") prefilter over-rejected legitimate filenames containing literal dots (e.g. "libllama..1.2.dylib"), and the follow-up filepath.Rel block was redundant with it. filepath.IsLocal (Go 1.20+) judges path-traversal lexically — it accepts dotted names, rejects absolute paths and segments that would escape the destination, and handles Windows reserved forms in one call. Sufficient under the trusted-manifest + SHA-256-verified-archive threat model. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
… hold The 10m InstallLockTimeout was shorter than the leader's legitimate upper bound: ensureLlamaServer and ensureModel each run under downloadTimeout (2h), so a slow-but-healthy install can hold the lock for up to 4h. A trailer arriving during a 15-minute model download would surface a confusing "flock timeout" failure even though nothing was wedged. Align the wait with 2*downloadTimeout; the leader's own downloadTimeout still guards against truly stalled installs, so the longer wait doesn't reintroduce zombie risk. Also record the holder's PID into the lock file (best effort) so a timed-out trailer gets "another runed instance (pid N) is bootstrapping — retry shortly" instead of a bare flock error. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
A transient network blip during a multi-hundred-MB model download shouldn't fail the entire boot. downloadWithRetry wraps DownloadAndVerify with up to 3 attempts and 5s/15s exponential backoff; caller cancellation (ctx.Err) short-circuits the retry loop so shutdown isn't delayed. Applied to both ensureModel and ensureLlamaServer for consistency, since both download via the same code path and benefit from the same resilience. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
EnsureAll did both artifacts in one shot, so a caller who set only RUNED_LLAMA_SERVER or only RUNED_MODEL still paid for the other side's download — which the env override on the call site then discarded. A stricter side effect: ensureLlamaServer's first line is m.LlamaServerForCurrentPlatform(), so a user on a platform missing from the manifest couldn't escape via env override even when they explicitly pointed at their own llama-server build. EnsureAll demanded the platform check succeed regardless of which side the caller actually needed from the manifest. The normal path (both env vars unset) keeps using EnsureAll, so its single-lock fast path is preserved. New EnsureLlamaServer / EnsureModel are called by selfBootstrap when exactly one env var is set; each manages its own install.lock acquisition. EnsureModel notably does not consult LlamaServerForCurrentPlatform, which is what unblocks the platform-escape-hatch case — the platform check is now confined to EnsureLlamaServer, so a caller that only needs the model side never exercises it. Tests pin the two relevant boundaries: EnsureLlamaServer surfaces ErrNoArtifactForPlatform when the manifest has no entry for the current platform, and EnsureModel succeeds in the same setup as long as the target model is cached. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.