action #77905
closedcoordination #58184: [saga][epic][use case] full version control awareness within openQA
coordination #48641: [epic] Trigger openQA tests in pull requests of any product github pull request
coordination #77698: [epic] synchronous qemu based system level test in pull request CI runs, e.g. standalone isotovideo or openQA tests
CI pipeline proof-of-concept running isotovideo
Description
Acceptance criteria¶
- AC1: A proof-of-concept CI configuration and run showing how isotovideo executes tests exists
Suggestions¶
- DONE: Install and run isotovideo for os-autoinst-distri-example -> see https://github.com/os-autoinst/os-autoinst-distri-example/pull/4
- DONE: Optional: Containerize isotovideo, e.g. based on https://build.opensuse.org/package/show/home:okurz:container/isotovideo , to make startup easier and faster in repeated CI runs
- DONE created https://build.opensuse.org/package/show/home:okurz:container/isotovideo-qemu-x86 and https://build.opensuse.org/package/show/home:okurz:container/isotovideo-qemu-kvm
- DONE @waitfor https://github.com/os-autoinst/os-autoinst/pull/1567
- DONE then create package in build.opensuse.org/project/show/devel:openQA with _service that extracts the Dockerfile from os-autoinst and builds and publishes images
- DONE use that image in https://github.com/os-autoinst/os-autoinst-distri-example/pull/4
- DONE Add to documentation, e.g. https://github.com/os-autoinst/os-autoinst/blob/master/README.asciidoc in https://github.com/os-autoinst/os-autoinst/pull/1563
- Optional: Try in a CI that supports nested virt, e.g. travis CI in parallel to github actions. Then likely https://build.opensuse.org/package/show/home:okurz:container/isotovideo-qemu-kvm is a better selection -> not done for now as travis CI is suffering from very long queue times due to their recent travis-ci.org->travis-ci.com migration going on and changes in the plans they offer
Updated by okurz almost 4 years ago
- Status changed from Workable to In Progress
- Assignee set to okurz
I have https://build.opensuse.org/package/view_file/home:okurz:container/isotovideo/Dockerfile?expand=1 since about a year. Let's see if I can streamline that for upstream inclusion and use it in github actions.
Updated by okurz almost 4 years ago
As a general draft including multiple changes: gh#os-autoinst/os-autoinst#1563
But for easier reviewing I created specific pull requests for smaller, not inter-dependant changes, e.g.:
- Use Test::Most instead of Test::More for convenience gh#os-autoinst/os-autoinst#1564 (merged)
- Cover all test output in t/13-osutils and remove unneeded debug messages gh#os-autoinst/os-autoinst#1565 (merged)
- README: Prefer user-centric documentation over developer-centric instructions gh#os-autoinst/os-autoinst#1566 (merged)
- docker: Add Dockerfile for isotovideo+qemu gh#os-autoinst/os-autoinst#1567
Now I wonder what is the best approach for testing. I would like to have a testing solution that is callable by every developer locally and also in CI. I tried with a simple perl test module where I call something like qx{podman build …}
which fails with errors like:
# Failed test 'container could be built successfully'
# at t/30-container.t line 36.
# got: '125'
# expected: '0'
# Output: STEP 1: FROM registry.opensuse.org/opensuse/tumbleweed
# Getting image source signatures
# Copying blob sha256:7fce653214d4500372a2df7b523918146b0f8e61e62613feaab18a46393e96e1
# Copying config sha256:2eac6045a15c8023b0a89aa585850c17ba02bae23185557f6edc0ac57939c316
# Writing manifest to image destination
# Storing signatures
# time="2020-11-15T14:45:15+01:00" level=error msg="Error while applying layer: ApplyLayer exit status 1 stdout: stderr: there might not be enough IDs available in the namespace (requested 0:15 for /etc/shadow): lchown /etc/shadow: invalid argument"
# Error: error creating build container: Error committing the finished image: error adding layer with blob "sha256:7fce653214d4500372a2df7b523918146b0f8e61e62613feaab18a46393e96e1": ApplyLayer exit status 1 stdout: stderr: there might not be enough IDs available in the namespace (requested 0:15 for /etc/shadow): lchown /etc/shadow: invalid argument
which I need to understand first or not follow up with at all as it can be just enough to build-test the container within OBS.
EDIT: I understood the error which I could reproduce with perl -e 'qx{podman build -f docker/isotovideo/Dockerfile.qemu . }'
. Problem is my alias alias podman='sudo podman'
because rootless podman does not work out of the box, at least not in my env. Trying with docker.
Further ideas what I found on the go:
- Use https://github.com/wagoodman/dive like
CI=true dive <your-image>
to check image - Use dgoss https://medium.com/@aelsabbahy/tutorial-how-to-test-your-docker-image-in-half-a-second-bbd13e06a4a9 for having a YAML based expectation document to test against our containers
I created https://github.com/os-autoinst/os-autoinst-distri-example/pull/4 with a github actions definition file using a temporary OBS project https://build.opensuse.org/package/show/home:okurz:container/isotovideo-qemu
https://github.com/okurz/os-autoinst-distri-example/runs/1402935643?check_suite_focus=true shows the results when running with qemu_no_kvm=1
as github actions do not provide /dev/kvm, so no nested virt. I could define an example in travis CI in parallel as well.
Changed the Dockerfile to do RUN zypper -n in os-autoinst qemu-x86 qemu-tools
instead. Probably I should be explicit and define a "isotovideo:qemu-x86" container and one "isotovideo:qemu-kvm". Have one https://build.opensuse.org/package/show/home:okurz:container/isotovideo-qemu-kvm now and
https://build.opensuse.org/package/show/home:okurz:container/isotovideo-qemu-x86
https://github.com/os-autoinst/os-autoinst-distri-example/pull/4 is ready now with a correct expected successful isotovideo run in
https://github.com/okurz/os-autoinst-distri-example/runs/1403357323?check_suite_focus=true
where "successful" means a completed test run with result "failed" as the example repo has no needles which is left as the training step to complete for beginners using the example repo.
So I could update https://github.com/os-autoinst/os-autoinst/pull/1567
Updated by okurz almost 4 years ago
- Status changed from Feedback to In Progress
After a reminder I could motivate team colleagues to followup with the pending review :)
https://github.com/os-autoinst/os-autoinst/pull/1567 is merged and also another idea was mentioned and followed up with https://github.com/os-autoinst/os-autoinst/pull/1573 to add specific subpackages.
https://github.com/os-autoinst/os-autoinst-distri-example/pull/4 was merged and https://github.com/os-autoinst/os-autoinst-distri-example/actions/runs/385231860 shows the successful run.
- Generate the container within OBS, e.g. checkout Dockerfile from VCS
EDIT: Did osc copypac devel:openQA os-autoinst_dev devel:openQA isotovideo-qemu-x86
and created the file _service
with content:
<services>
<service name="download_url">
<param name="protocol">https</param>
<param name="host">raw.githubusercontent.com</param>
<param name="path">/os-autoinst/os-autoinst/master/docker/isotovideo/Dockerfile.qemu-x86</param>
<param name="filename">Dockerfile</param>
</service>
</services>
I realized that this builds against "containers15.2" but I wanted to use Tumbleweed as base. https://build.opensuse.org/projects/devel:openQA/meta had "containers" but referencing openSUSE Leap 15.1. I think we don't need that anymore. I switched openSUSE:Containers:Leap:15.1 to "openSUSE:Containers:Tumbleweed". I also removed:
<disable repository="containers"/>
and more old cruft, e.g. for SLE12 which mkittler already removed elsewhere. Then I still needed to enable the container build for Tumbleweed in https://build.opensuse.org/package/meta/devel:openQA/isotovideo-qemu-x86
- Update the Dockerfile to use the new convenience packages instead
Created https://github.com/os-autoinst/os-autoinst/pull/1575 to add the qemu-kvm as well
- Update https://github.com/os-autoinst/os-autoinst/pull/1563
- Reference the container in os-autoinst README
Includes the updated OBS path
- Build qemu-kvm as well and document
https://github.com/os-autoinst/os-autoinst/pull/1575
- Review and consider update of os-autoinst-distri-example
Done with https://github.com/os-autoinst/os-autoinst-distri-example/pull/5
- TODO: @waitfor https://github.com/os-autoinst/os-autoinst/pull/1575
- TODO: @waitfor https://github.com/os-autoinst/os-autoinst-distri-example/pull/5
- TODO: Create post on opensuse-factory@lists.opensuse.org , link to post on openqa@suse.de , invite for workshop
Updated by okurz almost 4 years ago
waiting for https://build.opensuse.org/package/live_build_log/devel:openQA/isotovideo-qemu-x86/containers/x86_64 and it being published on registry.opensuse.org
Updated by okurz almost 4 years ago
- Description updated (diff)
- Status changed from Feedback to Resolved
- https://github.com/os-autoinst/os-autoinst/pull/1575 is merged, created https://build.opensuse.org/package/show/devel:openQA/isotovideo-qemu-kvm which we already reference in https://github.com/os-autoinst/os-autoinst#getting-started
https://build.opensuse.org/package/show/devel:openQA/isotovideo-qemu-kvm is currently "unresolvable" because likely we need to wait for the new version of os-autoinst to be published as part of a new snapshot of openSUSE:Factory
https://github.com/os-autoinst/os-autoinst-distri-example/pull/5 is merged
Create post on opensuse-factory@lists.opensuse.org , link to post on openqa@suse.de , invite for workshop
Wrote to opensuse-factory@opensuse.org with https://lists.opensuse.org/archives/list/factory@lists.opensuse.org/thread/X6P2GO4REOXIKTQC6VL2PXGTJTDXCA4D/ , referenced on openqa@suse.de , posted on https://one.suse.com/content/perma?id=47028 and in https://chat.suse.de/channel/testing?msg=kSCcZodacdfnCx4HZ