Files
llmgw/internal/bundle/chown_unix.go
Ilker ManapandClaude Opus 5.5 bae16426a2 Offline sites and Kubernetes: llmgw bundle create, import and trust, offline.mirror, server init --bundle; a Helm chart for the control plane
A bundle carries what a cluster would download — llmgw's release with its
signed checksums, every llama.cpp build per architecture with GitHub's
checksums, model files pinned and checked against Hugging Face's — into a
directory or a tar whose manifest sha256 is carried apart. Import checks
everything, the release against the signing key, before anything is put in
the mirror. With offline.mirror set, nodes install llama.cpp from the
mirror against checksums the control plane holds and sends over the agent
stream; releases default to the mirror for node add, ctl upgrade and agent
upgrades. server init and the setup form install from a bundle.

The Helm chart runs one control plane with SQLite on a claim or an external
PostgreSQL, Secrets for the agent certificate and admin token, Services,
Ingress and ServiceMonitor; deploy/container/Dockerfile builds its image.
GPU nodes stay outside Kubernetes, as docs/kubernetes.md explains.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-05 00:13:39 +02:00

27 lines
481 B
Go

//go:build unix
package bundle
import (
"os"
"syscall"
)
// chownLike gives p the owner of root, when this runs as root: the mirror
// runs as its own user, and a version it cannot remove is one `mirror
// remove` and the admin page fail on.
func chownLike(root, p string) {
if os.Geteuid() != 0 {
return
}
info, err := os.Stat(root)
if err != nil {
return
}
st, ok := info.Sys().(*syscall.Stat_t)
if !ok {
return
}
_ = os.Lchown(p, int(st.Uid), int(st.Gid))
}