coreos / coreos-assembler

Tooling container to assemble CoreOS-like systems
https://coreos.github.io/coreos-assembler/
Apache License 2.0
333 stars 165 forks source link

mantle/kola: support running commands via kola spawn #3776

Closed dustymabe closed 3 months ago

dustymabe commented 3 months ago

This will allow us to pass commands directly to kola spawn. It will then run the command on the brought up instance and exit success or failure based on that. Example:

[coreos-assembler]$ cosa kola spawn ls /root/
kola -p qemu spawn ls /root/ --output-dir tmp/kola
<<<< STDOUT >>>>

<<<< STDERR >>>>
ls: cannot open directory '/root/': Permission denied
<<<<<<<<>>>>>>>>
Error: running command failed: Process exited with status 2
2024-04-11T15:03:40Z cli: running command failed: Process exited with status 2
failed to execute cmd-kola: exit status 1
dustymabe commented 3 months ago

Something like this will make it easier to write simple tests for use with something like coreos-builds-bisect.

jlebon commented 3 months ago

How about matching the UX for cosa run -x '...' for consistency?

jbtrystram commented 3 months ago

TIL about kola spawn. What's the difference with cosa run ?

dustymabe commented 3 months ago

How about matching the UX for cosa run -x '...' for consistency?

TBH I didn't even know about that. TIL.

dustymabe commented 3 months ago

TIL about kola spawn. What's the difference with cosa run ?

cosa run is a frontend for kola qemuexec. The biggest difference that I understand is spawn can work with other platforms than qemu, but qemuexec has more features.

dustymabe commented 3 months ago

How about matching the UX for cosa run -x '...' for consistency?

pushed a fixup commit. if it looks good I'll squash

dustymabe commented 3 months ago

squashed and rebased on top of latest