-
Notifications
You must be signed in to change notification settings - Fork 187
Introduce kola qemuexec --devshell, make cosa run use it
#1338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
8f8e9a6 to
d3e0778
Compare
|
OK rebased 🏄 - I think you will all like using this as much as I did writing it! |
|
I took this PR for a test drive. It's a much better UX than prior! No more annoyances with overwritten terminal lines and no more resetting my terminal after |
jlebon
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good overall! Just a few nits.
This finally unifies the advantages of `cosa run` and `kola spawn`. I kept getting annoyed by how serial console sizing is broken (e.g. trying to use `less` etc.). Using `ssh` via `kola spawn` addresses that, but it means you can't debug the initramfs. Now things work in an IMO pretty cool way; if you do e.g. `cosa run --kargs ignition.config.url=blah://` (or inject a bad Ignition config) to cause a failure in the initramfs, you'll see a nice error (building on coreos/ignition-dracut#146 ) telling you to rerun with `cosa run --devshell-console`. Things are also wired up cleanly so that we support rebooting with the equivalent of `kola spawn --reconnect` (which we should probably remove now). You can exit via *either* quitting SSH cleanly or using `poweroff`, and the lifecycle of ssh and qemu is wired together. And finally, if we detect a cosa workdir we also bind it in by default. More to come here, such as auto-injecting debugging tools and containers.
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cgwalters, jlebon The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
Man, Prow is having a bad day today. /override ci/prow/sanity |
|
@jlebon: Overrode contexts on behalf of jlebon: ci/prow/sanity DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
In coreos#1338 we fixed the problem of having one's terminal be corrupted by the serial console. This fixes the same problem for `cosa build` which ends up running a VM too. First, there's no real reason to dump the kernel bootup output to the terminal (or build logs) - it's totally uninteresting stuff that we only want to see if something fails. Gather the serial console to one log file, and the output of the *command* we run in the VM to another. Fork off a `tail` process to follow just the command output. (When we rewrite this in a better language we will do this properly async)
I ran out of space in `/tmp` today and it turned out I had a whole lot of `/tmp/mantle-qemu` files, including some really big disk images. This is a combination of changes from coreos#1338 and the multipath PR coreos#1296 Basically if we get interrupted by Ctrl-C which is a lot more likely now when qemu isn't owning the serial console from the start, we will leak our tmpfiles. We probably need to install a `SIGINT` handler but that's a whole mess that's avoided if we just let the kernel clean up our resources for us, which is what was happening before the multipath PR (well, at least for files and not the swtpm tmpdir, but that's small). And actually coreos#1380 does install a `SIGINT` handler so someone please review that and we can maybe fix this more after that lands.
I ran out of space in `/tmp` today and it turned out I had a whole lot of `/tmp/mantle-qemu` files, including some really big disk images. This is a combination of changes from coreos#1338 and the multipath PR coreos#1296 Basically if we get interrupted by Ctrl-C which is a lot more likely now when qemu isn't owning the serial console from the start, we will leak our tmpfiles. We probably need to install a `SIGINT` handler but that's a whole mess that's avoided if we just let the kernel clean up our resources for us, which is what was happening before the multipath PR (well, at least for files and not the swtpm tmpdir, but that's small). And actually coreos#1380 does install a `SIGINT` handler so someone please review that and we can maybe fix this more after that lands.
I ran out of space in `/tmp` today and it turned out I had a whole lot of `/tmp/mantle-qemu` files, including some really big disk images. This is a combination of changes from coreos#1338 and the multipath PR coreos#1296 Basically if we get interrupted by Ctrl-C which is a lot more likely now when qemu isn't owning the serial console from the start, we will leak our tmpfiles. We probably need to install a `SIGINT` handler but that's a whole mess that's avoided if we just let the kernel clean up our resources for us, which is what was happening before the multipath PR (well, at least for files and not the swtpm tmpdir, but that's small). And actually coreos#1380 does install a `SIGINT` handler so someone please review that and we can maybe fix this more after that lands.
I ran out of space in `/tmp` today and it turned out I had a whole lot of `/tmp/mantle-qemu` files, including some really big disk images. This is a combination of changes from #1338 and the multipath PR #1296 Basically if we get interrupted by Ctrl-C which is a lot more likely now when qemu isn't owning the serial console from the start, we will leak our tmpfiles. We probably need to install a `SIGINT` handler but that's a whole mess that's avoided if we just let the kernel clean up our resources for us, which is what was happening before the multipath PR (well, at least for files and not the swtpm tmpdir, but that's small). And actually #1380 does install a `SIGINT` handler so someone please review that and we can maybe fix this more after that lands.
In coreos#1338 we fixed the problem of having one's terminal be corrupted by the serial console. This fixes the same problem for `cosa build` which ends up running a VM too. First, there's no real reason to dump the kernel bootup output to the terminal (or build logs) - it's totally uninteresting stuff that we only want to see if something fails. Gather the serial console to one log file, and the output of the *command* we run in the VM to another. Fork off a `tail` process to follow just the command output. (When we rewrite this in a better language we will do this properly async)
In #1338 we fixed the problem of having one's terminal be corrupted by the serial console. This fixes the same problem for `cosa build` which ends up running a VM too. First, there's no real reason to dump the kernel bootup output to the terminal (or build logs) - it's totally uninteresting stuff that we only want to see if something fails. Gather the serial console to one log file, and the output of the *command* we run in the VM to another. Fork off a `tail` process to follow just the command output. (When we rewrite this in a better language we will do this properly async)
This finally unifies the advantages of
cosa runandkola spawn.I kept getting annoyed by how serial console sizing is broken
(e.g. trying to use
lessetc.). Usingsshviakola spawnaddresses that, but it means you can't debug the initramfs.
Now things work in an IMO pretty cool way; if you do e.g.
cosa run --kargs ignition.config.url=blah://(or inject a badIgnition config) to cause a failure in the initramfs,
you'll see a nice error (building on
coreos/ignition-dracut#146 ) telling you
to rerun with
cosa run --devshell-console.Things are also wired up cleanly so that we support rebooting
with the equivalent of
kola spawn --reconnect(which we shouldprobably remove now). You can exit via either quitting SSH
cleanly or using
poweroff, and the lifecycle of ssh and qemuis wired together.
And finally, if we detect a cosa workdir we also bind it in by
default.
More to come here, such as auto-injecting debugging
tools and containers.