Manage image artifacts and show VM create progress
Stop relying on ad hoc rootfs handling by adding image promotion, managed work-seed fingerprint metadata, and lazy self-healing for older managed images after the first create. Rebuild guest images with baked SSH access, a guest NIC bootstrap, and default opencode services, and add the staged Void kernel/initramfs/modules workflow so void-exp uses a matching Void boot stack. Replace the opaque blocking vm.create RPC with a begin/status flow that prints live stages in the CLI while still waiting for vsock health and opencode on guest port 4096. Validate with GOCACHE=/tmp/banger-gocache go test ./... and live void-exp create/delete smoke runs.
This commit is contained in:
parent
9f09b0d25c
commit
30f0c0b54a
37 changed files with 2334 additions and 99 deletions
34
verify.sh
34
verify.sh
|
|
@ -33,6 +33,7 @@ SSH_COMMON_ARGS=(
|
|||
-o StrictHostKeyChecking=no
|
||||
-o UserKnownHostsFile=/dev/null
|
||||
)
|
||||
OPENCODE_PORT=4096
|
||||
|
||||
firecracker_running() {
|
||||
local pid="$1"
|
||||
|
|
@ -68,6 +69,21 @@ wait_for_ssh() {
|
|||
return 1
|
||||
}
|
||||
|
||||
wait_for_tcp() {
|
||||
local host="$1"
|
||||
local port="$2"
|
||||
local deadline="$3"
|
||||
|
||||
while ((SECONDS < deadline)); do
|
||||
if (exec 3<>/dev/tcp/"$host"/"$port") >/dev/null 2>&1; then
|
||||
return 0
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
refresh_vm_metadata() {
|
||||
if ! VM_JSON="$(./banger vm show "$VM_NAME" 2>/dev/null)"; then
|
||||
return 1
|
||||
|
|
@ -240,9 +256,21 @@ if ! wait_for_ssh "$GUEST_IP" "$BOOT_DEADLINE"; then
|
|||
fi
|
||||
ssh "${SSH_COMMON_ARGS[@]}" "root@${GUEST_IP}" "uname -a" >/dev/null
|
||||
|
||||
if [[ "$IMAGE_NAME" == "void-exp" ]]; then
|
||||
log "asserting mise and opencode are available in the Void guest"
|
||||
ssh "${SSH_COMMON_ARGS[@]}" "root@${GUEST_IP}" "command -v mise >/dev/null 2>&1 && command -v opencode >/dev/null 2>&1 && mise --version >/dev/null 2>&1 && opencode --version >/dev/null 2>&1" >/dev/null
|
||||
log "asserting opencode is available and listening in the guest"
|
||||
ssh "${SSH_COMMON_ARGS[@]}" "root@${GUEST_IP}" "command -v opencode >/dev/null 2>&1 && ss -H -lntp | awk '\$4 ~ /:${OPENCODE_PORT}\$/ { found = 1 } END { exit found ? 0 : 1 }'" >/dev/null
|
||||
|
||||
log "asserting opencode server is reachable from the host"
|
||||
if ! wait_for_tcp "$GUEST_IP" "$OPENCODE_PORT" "$BOOT_DEADLINE"; then
|
||||
log "opencode server did not become reachable at ${GUEST_IP}:${OPENCODE_PORT}"
|
||||
dump_diagnostics
|
||||
exit 1
|
||||
fi
|
||||
|
||||
log "asserting opencode port is reported by banger vm ports"
|
||||
if ! ./banger vm ports "$VM_NAME" | grep -F ":${OPENCODE_PORT}" >/dev/null 2>&1; then
|
||||
log "banger vm ports did not report ${OPENCODE_PORT}"
|
||||
dump_diagnostics
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if (( NAT_ENABLED )); then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue