Remove runtime-bundle image dependencies
Hard-cut banger away from source-checkout runtime bundles as an implicit source of\nimage and host defaults. Managed images now own their full boot set,\nimage build starts from an existing registered image, and daemon startup\nno longer synthesizes a default image from host paths.\n\nResolve Firecracker from PATH or firecracker_bin, make SSH keys config-owned\nwith an auto-managed XDG default, replace the external name generator and\npackage manifests with Go code, and keep the vsock helper as a companion\nbinary instead of a user-managed runtime asset.\n\nUpdate the manual scripts, web/CLI forms, config surface, and docs around\nthe new build/manual flow and explicit image registration semantics.\n\nValidation: GOCACHE=/tmp/banger-gocache go test ./..., bash -n scripts/*.sh,\nand make build.
This commit is contained in:
parent
01c7cb5e65
commit
572bf32424
44 changed files with 1194 additions and 3456 deletions
77
Makefile
77
Makefile
|
|
@ -6,50 +6,40 @@ INSTALL ?= install
|
|||
PREFIX ?= $(HOME)/.local
|
||||
BINDIR ?= $(PREFIX)/bin
|
||||
LIBDIR ?= $(PREFIX)/lib
|
||||
RUNTIMEDIR ?= $(LIBDIR)/banger
|
||||
DESTDIR ?=
|
||||
BUILD_DIR ?= build
|
||||
BUILD_BIN_DIR ?= $(BUILD_DIR)/bin
|
||||
RUNTIME_MANIFEST ?= config/runtime-bundle.toml
|
||||
RUNTIME_SOURCE_DIR ?= $(BUILD_DIR)/runtime
|
||||
RUNTIME_ARCHIVE ?= $(BUILD_DIR)/dist/banger-runtime.tar.gz
|
||||
BUILD_MANUAL_DIR ?= $(BUILD_DIR)/manual
|
||||
BANGER_BIN ?= $(BUILD_BIN_DIR)/banger
|
||||
BANGERD_BIN ?= $(BUILD_BIN_DIR)/bangerd
|
||||
BINARIES := $(BANGER_BIN) $(BANGERD_BIN)
|
||||
RUNTIME_HELPERS := $(RUNTIME_SOURCE_DIR)/banger-vsock-agent
|
||||
VSOCK_AGENT_BIN ?= $(BUILD_BIN_DIR)/banger-vsock-agent
|
||||
BINARIES := $(BANGER_BIN) $(BANGERD_BIN) $(VSOCK_AGENT_BIN)
|
||||
GO_SOURCES := $(shell find cmd internal -type f -name '*.go' | sort)
|
||||
RUNTIME_EXECUTABLES := firecracker customize.sh packages.sh namegen banger-vsock-agent
|
||||
RUNTIME_DATA_FILES := packages.apt id_ed25519 rootfs-docker.ext4
|
||||
RUNTIME_OPTIONAL_DATA_FILES := rootfs.ext4 rootfs-docker.work-seed.ext4 bundle.json
|
||||
RUNTIME_BOOT_FILES := wtf/root/boot/vmlinux-6.8.0-94-generic wtf/root/boot/initrd.img-6.8.0-94-generic
|
||||
RUNTIME_MODULES_DIR := wtf/root/lib/modules/6.8.0-94-generic
|
||||
VOID_IMAGE_NAME ?= void-exp
|
||||
VOID_VM_NAME ?= void-dev
|
||||
|
||||
.DEFAULT_GOAL := help
|
||||
|
||||
.PHONY: help build banger bangerd test fmt tidy clean rootfs rootfs-void void-kernel void-register void-vm verify-void install runtime-bundle runtime-package check-runtime bench-create
|
||||
.PHONY: help build banger bangerd test fmt tidy clean rootfs rootfs-void void-kernel void-register void-vm verify-void install bench-create
|
||||
|
||||
help:
|
||||
@printf '%s\n' \
|
||||
'Targets:' \
|
||||
' make build Build ./build/bin/banger and ./build/bin/bangerd' \
|
||||
' make runtime-bundle Fetch and unpack ./build/runtime from the archive referenced by $(RUNTIME_MANIFEST)' \
|
||||
' make runtime-package Package $(RUNTIME_SOURCE_DIR) into $(RUNTIME_ARCHIVE) and print its SHA256' \
|
||||
' make build Build ./build/bin/banger, ./build/bin/bangerd, and ./build/bin/banger-vsock-agent' \
|
||||
' make bench-create Benchmark vm create and SSH readiness with scripts/bench-create.sh' \
|
||||
' make install Build and install binaries plus the runtime bundle into $(DESTDIR)$(BINDIR) and $(DESTDIR)$(RUNTIMEDIR)' \
|
||||
' make install Build and install banger, bangerd, and the companion vsock helper' \
|
||||
' make test Run go test ./...' \
|
||||
' make fmt Format Go sources under cmd/ and internal/' \
|
||||
' make tidy Run go mod tidy' \
|
||||
' make clean Remove built Go binaries' \
|
||||
' make rootfs Rebuild the source-checkout default Debian rootfs image in ./build/runtime' \
|
||||
' make void-kernel Download and stage a Void kernel, initramfs, and modules under ./build/runtime/void-kernel' \
|
||||
' make rootfs-void Build an experimental Void Linux rootfs and work-seed in ./build/runtime' \
|
||||
' make rootfs Rebuild the manual Debian rootfs image in ./build/manual' \
|
||||
' make void-kernel Download and stage a Void kernel, initramfs, and modules under ./build/manual/void-kernel' \
|
||||
' make rootfs-void Build an experimental Void Linux rootfs and work-seed in ./build/manual' \
|
||||
' make void-register Register or update the experimental Void image as $(VOID_IMAGE_NAME)' \
|
||||
' make void-vm Register the experimental Void image and create a VM named $(VOID_VM_NAME)' \
|
||||
' make verify-void Register the experimental Void image and run scripts/verify.sh against it'
|
||||
|
||||
build: $(BINARIES) $(RUNTIME_HELPERS)
|
||||
build: $(BINARIES)
|
||||
|
||||
$(BANGER_BIN): $(GO_SOURCES) go.mod go.sum
|
||||
mkdir -p "$(BUILD_BIN_DIR)"
|
||||
|
|
@ -59,9 +49,9 @@ $(BANGERD_BIN): $(GO_SOURCES) go.mod go.sum
|
|||
mkdir -p "$(BUILD_BIN_DIR)"
|
||||
$(GO) build -o "$(BANGERD_BIN)" ./cmd/bangerd
|
||||
|
||||
$(RUNTIME_SOURCE_DIR)/banger-vsock-agent: $(GO_SOURCES) go.mod go.sum
|
||||
mkdir -p "$(RUNTIME_SOURCE_DIR)"
|
||||
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 $(GO) build -o "$(RUNTIME_SOURCE_DIR)/banger-vsock-agent" ./cmd/banger-vsock-agent
|
||||
$(VSOCK_AGENT_BIN): $(GO_SOURCES) go.mod go.sum
|
||||
mkdir -p "$(BUILD_BIN_DIR)"
|
||||
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 $(GO) build -o "$(VSOCK_AGENT_BIN)" ./cmd/banger-vsock-agent
|
||||
|
||||
test:
|
||||
$(GO) test ./...
|
||||
|
|
@ -74,55 +64,28 @@ tidy:
|
|||
|
||||
clean:
|
||||
rm -rf "$(BUILD_BIN_DIR)"
|
||||
rm -f "$(RUNTIME_SOURCE_DIR)/banger-vsock-agent"
|
||||
|
||||
runtime-bundle:
|
||||
$(GO) run ./cmd/runtimebundle fetch --manifest "$(RUNTIME_MANIFEST)" --out "$(RUNTIME_SOURCE_DIR)"
|
||||
|
||||
runtime-package:
|
||||
$(GO) run ./cmd/runtimebundle package --manifest "$(RUNTIME_MANIFEST)" --runtime-dir "$(RUNTIME_SOURCE_DIR)" --out "$(RUNTIME_ARCHIVE)"
|
||||
|
||||
bench-create: build
|
||||
BANGER_BIN="$(abspath $(BANGER_BIN))" bash ./scripts/bench-create.sh $(ARGS)
|
||||
|
||||
check-runtime:
|
||||
@test -d "$(RUNTIME_SOURCE_DIR)" || { echo "missing runtime bundle directory: $(RUNTIME_SOURCE_DIR); run 'make runtime-bundle'" >&2; exit 1; }
|
||||
@for path in $(RUNTIME_EXECUTABLES) $(RUNTIME_DATA_FILES) $(RUNTIME_BOOT_FILES) $(RUNTIME_MODULES_DIR); do \
|
||||
test -e "$(RUNTIME_SOURCE_DIR)/$$path" || { echo "missing runtime artifact: $(RUNTIME_SOURCE_DIR)/$$path; run 'make runtime-bundle'" >&2; exit 1; }; \
|
||||
done
|
||||
|
||||
install: build check-runtime
|
||||
install: build
|
||||
mkdir -p "$(DESTDIR)$(BINDIR)"
|
||||
mkdir -p "$(DESTDIR)$(RUNTIMEDIR)"
|
||||
mkdir -p "$(DESTDIR)$(RUNTIMEDIR)/wtf/root/boot"
|
||||
mkdir -p "$(DESTDIR)$(RUNTIMEDIR)/wtf/root/lib/modules"
|
||||
mkdir -p "$(DESTDIR)$(LIBDIR)/banger"
|
||||
$(INSTALL) -m 0755 "$(BANGER_BIN)" "$(DESTDIR)$(BINDIR)/banger"
|
||||
$(INSTALL) -m 0755 "$(BANGERD_BIN)" "$(DESTDIR)$(BINDIR)/bangerd"
|
||||
@for path in $(RUNTIME_EXECUTABLES); do \
|
||||
$(INSTALL) -m 0755 "$(RUNTIME_SOURCE_DIR)/$$path" "$(DESTDIR)$(RUNTIMEDIR)/$$path"; \
|
||||
done
|
||||
@for path in $(RUNTIME_DATA_FILES) $(RUNTIME_BOOT_FILES); do \
|
||||
$(INSTALL) -m 0644 "$(RUNTIME_SOURCE_DIR)/$$path" "$(DESTDIR)$(RUNTIMEDIR)/$$path"; \
|
||||
done
|
||||
@for path in $(RUNTIME_OPTIONAL_DATA_FILES); do \
|
||||
if test -e "$(RUNTIME_SOURCE_DIR)/$$path"; then \
|
||||
$(INSTALL) -m 0644 "$(RUNTIME_SOURCE_DIR)/$$path" "$(DESTDIR)$(RUNTIMEDIR)/$$path"; \
|
||||
fi; \
|
||||
done
|
||||
chmod 0600 "$(DESTDIR)$(RUNTIMEDIR)/id_ed25519"
|
||||
cp -a "$(RUNTIME_SOURCE_DIR)/$(RUNTIME_MODULES_DIR)" "$(DESTDIR)$(RUNTIMEDIR)/wtf/root/lib/modules/"
|
||||
$(INSTALL) -m 0755 "$(VSOCK_AGENT_BIN)" "$(DESTDIR)$(LIBDIR)/banger/banger-vsock-agent"
|
||||
|
||||
rootfs:
|
||||
BANGER_RUNTIME_DIR="$(abspath $(RUNTIME_SOURCE_DIR))" ./scripts/make-rootfs.sh
|
||||
BANGER_MANUAL_DIR="$(abspath $(BUILD_MANUAL_DIR))" BANGER_BIN="$(abspath $(BANGER_BIN))" ./scripts/make-rootfs.sh $(ARGS)
|
||||
|
||||
void-kernel:
|
||||
BANGER_RUNTIME_DIR="$(abspath $(RUNTIME_SOURCE_DIR))" ./scripts/make-void-kernel.sh
|
||||
BANGER_MANUAL_DIR="$(abspath $(BUILD_MANUAL_DIR))" ./scripts/make-void-kernel.sh $(ARGS)
|
||||
|
||||
rootfs-void:
|
||||
BANGER_RUNTIME_DIR="$(abspath $(RUNTIME_SOURCE_DIR))" ./scripts/make-rootfs-void.sh
|
||||
BANGER_MANUAL_DIR="$(abspath $(BUILD_MANUAL_DIR))" BANGER_BIN="$(abspath $(BANGER_BIN))" ./scripts/make-rootfs-void.sh $(ARGS)
|
||||
|
||||
void-register: build
|
||||
BANGER_RUNTIME_DIR="$(abspath $(RUNTIME_SOURCE_DIR))" VOID_IMAGE_NAME="$(VOID_IMAGE_NAME)" BANGER_BIN="$(abspath $(BANGER_BIN))" ./scripts/register-void-image.sh
|
||||
BANGER_MANUAL_DIR="$(abspath $(BUILD_MANUAL_DIR))" VOID_IMAGE_NAME="$(VOID_IMAGE_NAME)" BANGER_BIN="$(abspath $(BANGER_BIN))" ./scripts/register-void-image.sh
|
||||
|
||||
void-vm: void-register
|
||||
"$(abspath $(BANGER_BIN))" vm create --image "$(VOID_IMAGE_NAME)" --name "$(VOID_VM_NAME)"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue