Skip to content

Conversation

@cgwalters
Copy link
Member

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.

@cgwalters
Copy link
Member Author

OK rebased 🏄 - I think you will all like using this as much as I did writing it!

@mike-nguyen
Copy link
Member

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 cosa run 🎉

Copy link
Member

@jlebon jlebon left a 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.
@jlebon
Copy link
Member

jlebon commented Apr 17, 2020

/lgtm

@openshift-ci-robot
Copy link

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@jlebon
Copy link
Member

jlebon commented Apr 17, 2020

Man, Prow is having a bad day today.

/override ci/prow/sanity

@openshift-ci-robot
Copy link

@jlebon: Overrode contexts on behalf of jlebon: ci/prow/sanity

Details

In response to this:

Man, Prow is having a bad day today.

/override ci/prow/sanity

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.

@openshift-merge-robot openshift-merge-robot merged commit da40517 into coreos:master Apr 17, 2020
cgwalters added a commit to cgwalters/coreos-assembler that referenced this pull request Apr 23, 2020
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)
cgwalters added a commit to cgwalters/coreos-assembler that referenced this pull request Apr 23, 2020
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.
cgwalters added a commit to cgwalters/coreos-assembler that referenced this pull request Apr 24, 2020
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.
cgwalters added a commit to cgwalters/coreos-assembler that referenced this pull request Apr 24, 2020
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.
openshift-merge-robot pushed a commit that referenced this pull request Apr 24, 2020
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.
cgwalters added a commit to cgwalters/coreos-assembler that referenced this pull request Apr 25, 2020
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)
openshift-merge-robot pushed a commit that referenced this pull request Apr 27, 2020
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants