mirror of
https://github.com/devvmhq/devvm.git
synced 2026-12-01 21:36:40 -10:00
devvm ssh is devvm host. devvm tools shows this folder's VM's shared tools (TOOL VERSION NEWER BUILT, from the lock as it is, never online); devvm tools add/rm TOOL... add and take out shared tools, each a word of its own (joined with + refused: tools_joined; add takes only shared tools: unknown_tool), and devvm tools update moves the VM to the newest. devvm IMAGE on a VM that exists adds nothing and asks nothing: it fails with vm_lacks_tools, naming the devvm tools add command, or vm_lacks_layer, as only a new VM gets a layer. devvm export is devvm history export [FILE]; devvm history lists the exports in the exports folder (FILE VM FOLDER DATE SIZE), the folder from a <export>.folder file written beside devvm's own exports and deleted with them. gc --exports is gc --history, retention's exports.age/count are history.age/count, and devvm space's row is history. The in-place layer machinery goes: Launch.addLayers and runLayers, dockerLayers' inPlace/set/unset, backend.DockerLayerVM.SetDockerLayer and the Docker backend's SetDockerLayer, with the add_in_place, restart_for_mounts, no_terminal_confirm, keeping, adding and add_layer_failed messages. vm.Tools (tools.go) holds Add, Remove, Update and List; tools.VMs.Show lists a VM's tools; tools.Remove takes names as a list; VMs.Update compares a VM's files as a set. New messages: vm_lacks_tools, vm_lacks_layer, has_tools, tools_joined, history_failed, tools_failed; renamed: unknown_tool, gc_history, gc_history_export, deleted_history, gc_older_than_needs_history. Command files: host.go, tools.go, history.go, refreshtools.go (_refresh-tools); ssh.go, remove.go, update.go, export.go and gc_exports.go gone. Tests: TestImageLacks, TestToolsAdd, TestShow, TestCompleteToolNames; history.txtar, gc_history.txtar, host_code.txtar and the e2e tools, docker layer and host checks updated. Docs, the CLI reference, AGENTS.md and the e2e header follow. Co-Authored-By: Claude Opus 5.5 <[email protected]>
31 lines
1.0 KiB
Go
31 lines
1.0 KiB
Go
package vm
|
|
|
|
import (
|
|
"github.com/w3cj/devvm/internal/backend"
|
|
"github.com/w3cj/devvm/internal/msg"
|
|
)
|
|
|
|
// dockerLayers is how new VMs run the docker layer on a backend that
|
|
// makes VMs for it (backend.DockerLayerVM): the runtime (KeyDockerLayer).
|
|
// Such a VM gets no network policy.
|
|
type dockerLayers struct{ *Env }
|
|
|
|
// choice is the runtime a VM with the docker layer runs it under on a
|
|
// backend that makes VMs for it (dl), and the features its layers (img)
|
|
// need (docker-layer, refused by Require while unreviewed, and any
|
|
// other's); the backend's refusal where it can't run it.
|
|
func (e dockerLayers) choice(dl backend.DockerLayerVM, vm, img string) (string, []backend.Feature, error) {
|
|
rt, err := dl.DockerLayer(vm)
|
|
if err != nil {
|
|
return "", nil, err
|
|
}
|
|
return rt, backend.ImageFeatures(img), nil
|
|
}
|
|
|
|
// say says which runtime runs a VM's docker layer; nothing for "".
|
|
func (e dockerLayers) say(b backend.Backend, mode, vm string) {
|
|
if mode != "" {
|
|
e.Info(msg.DockerLayerRuntime(b.Name(), mode, vm))
|
|
}
|
|
}
|