Skip to content
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

Add a qemu-iso platform #1571

Merged
merged 1 commit into from
Jul 13, 2020
Merged

Conversation

cgwalters
Copy link
Member

@cgwalters cgwalters commented Jul 1, 2020

Lower the bits to do "inject Ignition via coreos-installer embed iso"
into the qemu layer. Copy the "qemu-unpriv" platform code into a
"qemu-iso" platform (both are mostly thin wrappers around qemu.go).

This makes it completely trivial to get a ssh shell in an ISO:
cosa run -p qemu-iso --memory 8192

And even better means we can start running a lot of the kola tests
directly against the ISO (though not everything will work, e.g.
tests that reboot can't persist state). I did verify this works:
kola run -p qemu-iso --qemu-memory 8192 basic

@cgwalters
Copy link
Member Author

I think what we may really want to do is:
kola run -p qemu-iso and kola run -p qemu-metal (the latter of which would actually go through the full install path).
But we can build that on top of this.

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.

Cool stuff. Definitely like the idea of making it easier to run the ISO without pulling out libvirt.

Though I think it'd be cleaner if instead of overloading the --qemu-image arg for this, it's a separate option, e.g. --qemu-cdrom. That should clean up the big if-statement switches based on the filename extension, and at the CLI level itself ISTM cleaner to be more explicit. Not a huge deal though if others want to get this in with the current semantics.

/cc @arithx

mantle/platform/qemu.go Outdated Show resolved Hide resolved
Copy link
Contributor

@arithx arithx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think what we may really want to do is:
kola run -p qemu-iso and kola run -p qemu-metal (the latter of which would actually go through the full install path).
But we can build that on top of this.

Agreed that ultimately ending up with them treated as independent platforms (that might re-use a lot / all of the platform builder code) is the desired end state.

Though I think it'd be cleaner if instead of overloading the --qemu-image arg for this, it's a separate option, e.g. --qemu-cdrom. That should clean up the big if-statement switches based on the filename extension, and at the CLI level itself ISTM cleaner to be more explicit. Not a huge deal though if others want to get this in with the current semantics.

In the far gone past we've done some auto-detection things on the images so I wouldn't block on it but I would agree that I prefer it being explicit (although as mentioned in the preivous reply I do think the correct level of explicitness is the platform rather than an image flag).

// primary disk is selected. This allows us to have "boot once" functionality on
// both UEFI and BIOS (`-boot once=d` OTOH doesn't work with OVMF).

// TBD: aarch64 does not support ide-cd but cdrom won't work either.Including it here as it doesn't error out at least.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it'd be better to explicitly error out with a message denoting that this setup path won't work on the arch.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code is just moved, but I can do that too.

@cgwalters cgwalters added the jira for syncing to jira label Jul 7, 2020
@cgwalters
Copy link
Member Author

OK I am looking at making this a separate platform, copying code from qemu - but it will be a notably bigger patch.

@cgwalters
Copy link
Member Author

OK reworked to add qemu-iso as a platform!

@cgwalters cgwalters force-pushed the flight-iso branch 2 times, most recently from 16d76b4 to f3a0d1d Compare July 8, 2020 14:33
@cgwalters
Copy link
Member Author

/test sanity

@cgwalters cgwalters changed the title Enable cosa/kola run for .iso Add a qemu-iso platform Jul 9, 2020
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.

Ahh sorry, I think this needs a rebase on top of #1573 now.

mantle/platform/qemu.go Outdated Show resolved Hide resolved
mantle/kola/harness.go Show resolved Hide resolved
Lower the bits to do "inject Ignition via coreos-installer embed iso"
into the qemu layer.  Copy the "qemu-unpriv" platform code into a
"qemu-iso" platform (both are mostly thin wrappers around `qemu.go`).

This makes it completely trivial to get a `ssh` shell in an ISO:
`cosa run -p qemu-iso --memory 8192`

And even better means we can start running a lot of the kola tests
directly against the ISO (though not everything will work, e.g.
tests that reboot can't persist state).   I did verify this works:
`kola run -p qemu-iso --qemu-memory 8192 basic`
@cgwalters
Copy link
Member Author

Rebased 🏄

@jlebon
Copy link
Member

jlebon commented Jul 13, 2020

Nice! Tested this locally, and it works great. (Apart from having to stop the boot to type in console=ttyS0; we should brainstorm on ways to cheaply inject that.)

/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

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

@openshift-merge-robot openshift-merge-robot merged commit 3b9bbdc into coreos:master Jul 13, 2020
@jlebon
Copy link
Member

jlebon commented Jul 15, 2020

Not sure if this is related to this PR, but just saw this in the FCOS pipeline:

Error: scenario pxe-install: Unexpected string from completion channel: coreos-installer-test-OK expected: live-test-OK
2020-07-15T16:18:51Z cli: scenario pxe-install: Unexpected string from completion channel: coreos-installer-test-OK expected: live-test-OK

@jlebon
Copy link
Member

jlebon commented Jul 15, 2020

cosa commits since last successful build:

$ gitlg 11230addaf9fb54269fffc4eb52e7b4589954961..
* 6699f4ac 2020-07-10 Sohan Kunkerkar mantle/kola/tests/ignition: don't skip ignitionFailure test
* 3b9bbdc1 2020-07-01 Colin Walters Add a qemu-iso platform
* 2d1366fd 2020-07-08 Colin Walters kola: More fixes for reboot
* 6833e462 2020-07-10 Michael Nguyen kola/tests/rhcos/luks: add NeedsInternet tags to Tang and SSS
* 0377a9f0 2020-07-10 Jonathan Lebon cmdlib: ignore SRPMs when finding override packages

@cgwalters
Copy link
Member Author

Ugh yeah it might be the qemu-iso platform changes. Sorry 😢 Who tests the tests etc

@jlebon
Copy link
Member

jlebon commented Jul 15, 2020

This might not actually be related to this PR. Filed #1597.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved jira for syncing to jira lgtm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants