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

kola: add additionalDisks support in kola.json #1573

Merged
merged 3 commits into from
Jul 10, 2020

Conversation

jlebon
Copy link
Member

@jlebon jlebon commented Jul 3, 2020

Add the ability to specify additional disks in kola.json for use by
external tests. This will be useful for testing the new rootfs
reprovisioning work.

For now, this only supports the qemu platform.

Closes: #1565

@openshift-ci-robot
Copy link

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@jlebon
Copy link
Member Author

jlebon commented Jul 3, 2020

See example usage in coreos/ignition#1010.

mantle/kola/register/register.go Outdated Show resolved Hide resolved
NewMachine(userdata *conf.UserData) (Machine, error)

// NewMachineWithDisks creates a new CoreOS machine with additional disks.
NewMachineWithDisks(userdata *conf.UserData, addDisks []string) (Machine, error)
Copy link
Contributor

Choose a reason for hiding this comment

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

Does it make sense to have a separate method for this, rather than generalizing NewMachineWithOptions to all platforms?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd be +1 on changing this to be NewMachineWithOptions and having a generalized MachineOptions type. I really like shifting the general implementations up to the interface so we can drop explicit type checking.

I am worried that the current implementation, forcing test errors rather than skipping tests that are requesting additional resources on platforms that don't implement them yet, will be a bit obtuse to work around once tests are added to kola that make use of it. I wonder if there might be some value in implementing a platform check + skip into the harness (similar to what's done for --no-net).

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm +1 on NewMachineWithOptions as well.

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 was a bit trickier than expected, because there are some options that are just specific to QEMU, like host port forwarding and pdeathsig handling. I split out a new QEMU-specific type that's a superset of the now generalized MachineOptions type. This does still allow us to clean up the type-checking.

Copy link
Member Author

Choose a reason for hiding this comment

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

I am worried that the current implementation, forcing test errors rather than skipping tests that are requesting additional resources on platforms that don't implement them yet, will be a bit obtuse to work around once tests are added to kola that make use of it.

Hmm, can you expand on this? Support for e.g. AWS tests that want to use AdditionalDisks is contingent on first adding AdditionalDisks support for AWS, right?

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, can you expand on this? Support for e.g. AWS tests that want to use AdditionalDisks is contingent on first adding AdditionalDisks support for AWS, right?

Yes if the test wants to use AdditionalDisks then it requires that the platform support it. With as it was at the time I made the comment (haven't gone through the current code yet) if I say add an external test that requires additional disks and then run my external tests on qemu & aws in CI the tests for aws always fail because we don't support additional disks. What I was talking about was adding something to the harness that would check if the test needed additional disks and if so skip the test if the platform was one that doesn't have the support for adding them.

jlebon added 3 commits July 9, 2020 09:15
The key there is a space-separated list of platform names, not a JSON
list directly.
Make `NewMachineWithOptions` part of the cross-platform interface
instead of being specific to QEMU. This then adds support for additional
disks (though it only works on QEMU right now). We add a new
`NewMachineWithQemuOptions` type which embeds this type and includes
more QEMU-specific features, such as host port forwarding and
`PR_SET_PDEATHSIG`.

This allows us to simplify tests which previously had to use dynamic
type checking in order to add additional disks.

This also fixes support for `kola spawn --remove=false`, which broke at
some point.
Add the ability to specify additional disks in `kola.json` for use by
external tests. This will be useful for testing the new rootfs
reprovisioning work.

For now, this only supports the qemu platform.

Closes: coreos#1565
@jlebon jlebon force-pushed the pr/add-disks-tests branch from 0a5bdff to 07552f6 Compare July 9, 2020 13:16
@jlebon jlebon marked this pull request as ready for review July 9, 2020 13:22
@jlebon
Copy link
Member Author

jlebon commented Jul 9, 2020

Ready for review!

@cgwalters
Copy link
Member

LGTM
Though it'd be nice to have coreosci back for this repo before we merge big things, what is the status on that?

@jlebon
Copy link
Member Author

jlebon commented Jul 9, 2020

LGTM
Though it'd be nice to have coreosci back for this repo before we merge big things, what is the status on that?

It's mostly back up now (still sorting through some issues) and green on this PR! ✔️

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.

/lgtm

We can address skipping tests on platforms that don't have this new support in a followup.

@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: arithx, 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 11230ad into coreos:master Jul 10, 2020
@jlebon jlebon deleted the pr/add-disks-tests branch April 22, 2023 23:34
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.

Allow external host tests to specify additional disks via kola.json
7 participants