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
|
|
@ -56,6 +56,7 @@ func (d *Daemon) registeredCapabilities() []vmCapability {
|
|||
}
|
||||
return []vmCapability{
|
||||
workDiskCapability{},
|
||||
opencodeCapability{},
|
||||
dnsCapability{},
|
||||
natCapability{},
|
||||
}
|
||||
|
|
@ -103,6 +104,14 @@ func (d *Daemon) prepareCapabilityHosts(ctx context.Context, vm *model.VMRecord,
|
|||
|
||||
func (d *Daemon) postStartCapabilities(ctx context.Context, vm model.VMRecord, image model.Image) error {
|
||||
for _, capability := range d.registeredCapabilities() {
|
||||
switch capability.Name() {
|
||||
case "dns":
|
||||
vmCreateStage(ctx, "apply_dns", "publishing vm dns record")
|
||||
case "nat":
|
||||
if vm.Spec.NATEnabled {
|
||||
vmCreateStage(ctx, "apply_nat", "configuring nat")
|
||||
}
|
||||
}
|
||||
if hook, ok := capability.(postStartCapability); ok {
|
||||
if err := hook.PostStart(ctx, d, vm, image); err != nil {
|
||||
return err
|
||||
|
|
@ -191,10 +200,11 @@ func (workDiskCapability) ContributeMachine(cfg *firecracker.MachineConfig, vm m
|
|||
}
|
||||
|
||||
func (workDiskCapability) PrepareHost(ctx context.Context, d *Daemon, vm *model.VMRecord, image model.Image) error {
|
||||
if err := d.ensureWorkDisk(ctx, vm, image); err != nil {
|
||||
prep, err := d.ensureWorkDisk(ctx, vm, image)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return d.ensureAuthorizedKeyOnWorkDisk(ctx, vm)
|
||||
return d.ensureAuthorizedKeyOnWorkDisk(ctx, vm, image, prep)
|
||||
}
|
||||
|
||||
func (workDiskCapability) AddDoctorChecks(_ context.Context, d *Daemon, report *system.Report) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue