Skip to content

USHIFT-1363: tools to build multiple images for ci#1951

Merged
openshift-merge-robot merged 10 commits intoopenshift:mainfrom
dhellmann:build-multiple-images-for-ci
Jul 3, 2023
Merged

USHIFT-1363: tools to build multiple images for ci#1951
openshift-merge-robot merged 10 commits intoopenshift:mainfrom
dhellmann:build-multiple-images-for-ci

Conversation

@dhellmann
Copy link
Copy Markdown
Contributor

@dhellmann dhellmann commented Jun 22, 2023

This PR adds a framework for managing "test scenarios". It is possible to independently define images, VMs, and tests, then mix and match them to produce scenarios like "test upgrade and rollback from MicroShift 4.13 to 4.14 on RHEL 9.2". The PR includes a few scenarios as examples. The scripts have been tested on a RHEL hypervisor using remote access similar to what we will do in CI. The next phase of implementation will include some wrappers and integration scripts for linking in to CI, but these scripts are usable as-is for developers to run locally.

@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 22, 2023
@openshift-ci openshift-ci Bot requested review from jogeo and pacevedom June 22, 2023 22:52
@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 22, 2023
@dhellmann dhellmann marked this pull request as draft June 22, 2023 22:52
@dhellmann dhellmann removed request for jogeo and pacevedom June 22, 2023 23:43
Comment thread test/README.md Outdated
Comment thread test/image-blueprints/rhel92-microshift413.toml Outdated
Comment thread test/bin/download_images.sh Outdated
@dhellmann dhellmann force-pushed the build-multiple-images-for-ci branch 10 times, most recently from 72f7727 to f9fc47f Compare June 25, 2023 19:56
@dhellmann dhellmann changed the title WIP: tools to build multiple images for ci USHIFT-1363: tools to build multiple images for ci Jun 25, 2023
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jun 25, 2023
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Jun 25, 2023

@dhellmann: This pull request references USHIFT-1363 which is a valid jira issue.

Details

In response to this:

Which issue(s) this PR addresses:

Closes #

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.

@dhellmann dhellmann marked this pull request as ready for review June 25, 2023 20:34
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 25, 2023
@openshift-ci openshift-ci Bot requested review from copejon and pmtk June 25, 2023 20:34
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Jun 25, 2023

@dhellmann: This pull request references USHIFT-1363 which is a valid jira issue.

Details

In response to this:

This PR adds a framework for managing "test scenarios". It is possible to independently define images, VMs, and tests, then mix and match them to produce scenarios like "test upgrade and rollback from MicroShift 4.13 to 4.14 on RHEL 9.2". The PR includes a few scenarios as examples. The scripts have been tested on a RHEL hypervisor using remote access similar to what we will do in CI. The next phase of implementation will include some wrappers and integration scripts for linking in to CI, but these scripts are usable as-is for developers to run locally.

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.

@dhellmann dhellmann force-pushed the build-multiple-images-for-ci branch from f9fc47f to d77f20e Compare June 25, 2023 21:10
…stem

When we have to get the kubeconfig from a remote system through a
port-forwarded connection, we may have to update the connection URL.
…stem

When we run the tests on a remote system through a port-forwarded
connection, we may have to modify some connection parameters.
@dhellmann dhellmann force-pushed the build-multiple-images-for-ci branch from cd89147 to a61f75a Compare June 29, 2023 22:08
Copy link
Copy Markdown
Member

@pmtk pmtk left a comment

Choose a reason for hiding this comment

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

overall looks good to me, waiting for final version :)

Comment thread test/README.md Outdated
Comment thread test/bin/ci_phase_iso_boot.sh Outdated
Comment thread test/image-blueprints/rhel92.toml Outdated
@dhellmann dhellmann force-pushed the build-multiple-images-for-ci branch from 931ba69 to 866ce46 Compare June 30, 2023 15:37
@dhellmann dhellmann force-pushed the build-multiple-images-for-ci branch 7 times, most recently from 5ec860a to 7ca02c1 Compare July 1, 2023 21:26
dhellmann added 4 commits July 2, 2023 13:07
dnf is reporting different missing file errors in CI, so retry the
command a few times
Define a test harness for running different "scenarios" defined by
combining OS images, MicroShift versions, and test suites.
Add image blueprint data for RHEL 9.2 images without MicroShift and
with MicroShift 4.13 and the package built from source.

Add package sources for fast-datapath and RHOCP 4.13 for dependencies.

Add a kickstart template for booting an image from an ostree commit.

Add a scenario for running the standard test suite against a host
running RHEL 9.2 and MicroShift built from source.

Add a scenario for running the upgrade test against a host running
RHEL 9.2 and MicroShift built from source.
@dhellmann dhellmann force-pushed the build-multiple-images-for-ci branch from f448dc2 to 4860f1a Compare July 2, 2023 17:08
Copy link
Copy Markdown
Member

@pmtk pmtk left a comment

Choose a reason for hiding this comment

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

just some nits we can address in separate PR
/lgtm
/hold

local failed=true
local deps="libvirt virt-manager virt-install virt-viewer libvirt-client qemu-kvm qemu-img sshpass"

set +e # retry because we see errors caching different RPMs in CI
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Which failure is this supposed to prevent? I think if command; then doesn't need this

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think I had this here before the linter made me use the if statement. I'll take it out in a follow-up.


# Build all of the needed VMs
for scenario in scenarios/*.sh; do
time bash -x ./bin/scenario.sh create "${scenario}"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

time or /usr/bin/time? /usr/bin/time -v prints some nice stats

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I was mostly curious how long it was taking to make the VMs, so I just wanted clock time. This section is going to be rewritten to run the steps in parallel, and I can use /usr/bin/time -v when I do that.

Comment thread test/bin/scenario.sh
local ip="${2}"

echo "Waiting ${VM_BOOT_TIMEOUT} for greenboot on ${vmname} to complete"
timeout "${VM_BOOT_TIMEOUT}" bash -c "until ssh redhat@${ip} \"sudo journalctl -n 5 -u greenboot-healthcheck; sudo systemctl status greenboot-healthcheck | grep 'active (exited)'\"; do date; sleep 10; done"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are we sure -n 5 is enough?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's in a loop, so it shows the last few lines every 10 seconds. I saw a lot of repeated output. I could make it print more lines if you think that would help? Maybe 10?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I missed the loop :)

@openshift-ci openshift-ci Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 3, 2023
@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jul 3, 2023
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Jul 3, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dhellmann, pmtk

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

@dhellmann
Copy link
Copy Markdown
Contributor Author

/hold cancel

@openshift-ci openshift-ci Bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 3, 2023
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Jul 3, 2023

@dhellmann: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-openshift-conformance-reduced-arm 4860f1a link false /test e2e-openshift-conformance-reduced-arm
ci/prow/microshift-e2e-arm 4860f1a link false /test microshift-e2e-arm

Full PR test history. Your PR dashboard.

Details

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. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants