Skip to content

kola: Add support for injectContainer #2999

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

Merged
merged 1 commit into from
Aug 3, 2022

Conversation

cgwalters
Copy link
Member

Closes: #2952

For quite a while we've been generating a "base image" container
as part of our builds, but it has basically been entirely untested
outside of its processing and use by the ostree stack.

This adds a base framework such that external tests can request
the injection of the container (.ociarchive).

Now, we can (and definitely should) also pursue "natively" testing
this container image outside of kola, which is very virtual-machine
focused.

However, that will also require a lot of pipeline changes; this
approach allows us to natively "bridge" the worlds of cosa/kola
to test the container image.

cgwalters added a commit to cgwalters/fedora-coreos-config that referenced this pull request Jul 20, 2022
This builds on coreos/coreos-assembler#2999
to test that `rpm -q` works inside the container, which would
have caught coreos/fedora-coreos-tracker#1258
@cgwalters
Copy link
Member Author

Demo test: coreos/fedora-coreos-config#1859

@cgwalters
Copy link
Member Author

One thing I thought about here is generalizing this to e.g. injectArtifacts: ["ostree"]. That would lay the groundwork for e.g. injectArtifacts: ["qemu"] if someone wanted to write a test that tested a property of the qemu image itself (perhaps the file format), without running it outside of kola.

@cgwalters
Copy link
Member Author

Notice here that what will happen normally is we boot the "host system build under test" (qemu/aws/etc) and run the "container image under test" in it.

Yet another variant of this is testing using e.g. the stable release host system. Doing that flow would really want something more like the special kola upgrade test flow.

Finally of course, a huge thing we could also do here is generalize the old support for kola run --oscontainer which now applies to both FCOS and RHCOS, and have it perform an upgrade before testing.

@cgwalters cgwalters force-pushed the kola-inject-artifact branch 2 times, most recently from f8be7fa to bce9782 Compare July 20, 2022 22:33
@cgwalters
Copy link
Member Author

Finally of course, a huge thing we could also do here is generalize the old support for kola run --oscontainer

That's in #3004 !

@ashcrow ashcrow requested review from dustymabe and saqibali-2k July 25, 2022 19:05
saqibali-2k
saqibali-2k previously approved these changes Jul 28, 2022
Copy link
Member

@saqibali-2k saqibali-2k left a comment

Choose a reason for hiding this comment

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

LGTM, one minor nit.

@@ -194,6 +194,9 @@ const (
// kolaExtBinDataEnv is an environment variable pointing to the above
kolaExtBinDataEnv = "KOLA_EXT_DATA"

// kolaContainerDataEnv includes the path to the ostree base container image in oci-archive format.
kolaContainerDataEnv = "KOLA_OSTREE_OCIARCHIVE"
Copy link
Member

Choose a reason for hiding this comment

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

The other variables follow the pattern kolaExt- which indicates that this constant is used by external tests. Maybe we can rename this to kolaExtContainerDataEnv?

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed! Good suggestion.

Closes: coreos#2952

For quite a while we've been generating a "base image" container
as part of our builds, but it has basically been entirely untested
outside of its processing and use by the ostree stack.

This adds a base framework such that external tests can request
the injection of the container (`.ociarchive`).

Now, we can (and *definitely* should) also pursue "natively" testing
this container image outside of kola, which is very virtual-machine
focused.

However, that will also require a lot of pipeline changes; this
approach allows us to natively "bridge" the worlds of cosa/kola
to test the container image.
@cgwalters
Copy link
Member Author

/retest

@cgwalters cgwalters merged commit 4d4f3dd into coreos:main Aug 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

kola: Add -p container
2 participants