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

test: use config file rather than environment variables for the kata CI job #8166

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

littlejawa
Copy link
Contributor

What type of PR is this?

/kind ci

What this PR does / why we need it:

There are a number of integration tests that rely on creating a new runtime class with specific parameters, and make it the default before running some tests.
Theses tests fail with kata, because the kata CI job setup uses environment variables (CONTAINER_DEFAULT_RUNTIME typically), which take precedence in crio's config.

This PR tries to modify the kata job's configuration so that it relies on config files too. This way, no interaction should happen, and we should be able to enable additional tests for kata.

Which issue(s) this PR fixes:

None

Special notes for your reviewer:

Does this PR introduce a user-facing change?

None

@littlejawa littlejawa requested a review from mrunalp as a code owner May 13, 2024 09:45
@openshift-ci openshift-ci bot added release-note-none Denotes a PR that doesn't merit a release note. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. kind/ci Categorizes issue or PR as related to CI labels May 13, 2024
@openshift-ci openshift-ci bot requested review from hasan4791 and QiWang19 May 13, 2024 09:45
Copy link
Contributor

openshift-ci bot commented May 13, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: littlejawa
Once this PR has been reviewed and has the lgtm label, please assign giuseppe for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

@littlejawa
Copy link
Contributor Author

/hold

This PR contains a commit that we don't want to merge.

@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 May 13, 2024
Copy link

codecov bot commented May 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 49.57%. Comparing base (747c152) to head (5e68e4d).
Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8166   +/-   ##
=======================================
  Coverage   49.57%   49.57%           
=======================================
  Files         153      153           
  Lines       16953    16953           
=======================================
  Hits         8404     8404           
  Misses       7503     7503           
  Partials     1046     1046           

@littlejawa littlejawa force-pushed the kata_ci_config_simplified branch 2 times, most recently from c31b4c7 to 961cff2 Compare May 14, 2024 08:36
@littlejawa
Copy link
Contributor Author

/test ci-fedora-kata

@littlejawa
Copy link
Contributor Author

/test ci-fedora-kata

1 similar comment
@littlejawa
Copy link
Contributor Author

/test ci-fedora-kata

@littlejawa littlejawa force-pushed the kata_ci_config_simplified branch 4 times, most recently from 83a3a8f to 51e9edd Compare May 16, 2024 08:40
@littlejawa
Copy link
Contributor Author

/test ci-fedora-kata

@littlejawa littlejawa force-pushed the kata_ci_config_simplified branch 2 times, most recently from ad8303f to 7728583 Compare May 16, 2024 15:08
@littlejawa
Copy link
Contributor Author

/test ci-fedora-kata

@littlejawa littlejawa force-pushed the kata_ci_config_simplified branch 2 times, most recently from 7d08d21 to 8dfec01 Compare May 16, 2024 16:35
@littlejawa
Copy link
Contributor Author

/test ci-fedora-kata

1 similar comment
@littlejawa
Copy link
Contributor Author

/test ci-fedora-kata

@littlejawa
Copy link
Contributor Author

/test ci-fedora-integration

@littlejawa littlejawa force-pushed the kata_ci_config_simplified branch 4 times, most recently from 0ac8a72 to 57ebd2b Compare May 23, 2024 06:35
@littlejawa
Copy link
Contributor Author

/test ci-fedora-integration

1 similar comment
@littlejawa
Copy link
Contributor Author

/test ci-fedora-integration

@littlejawa
Copy link
Contributor Author

/test ci-fedora-kata

2 similar comments
@littlejawa
Copy link
Contributor Author

/test ci-fedora-kata

@littlejawa
Copy link
Contributor Author

/test ci-fedora-kata

@littlejawa
Copy link
Contributor Author

/test ci-fedora-integration

@littlejawa
Copy link
Contributor Author

/test ci-fedora-kata

1 similar comment
@littlejawa
Copy link
Contributor Author

/test ci-fedora-kata

The way our tests are working, we don't always stop/delete containers
before we shut down crio.
That's ok for most tests because the container processes will go away
with crio, but with kata, the runtime and (most importantly) the qemu
process running the VM are still active.

This is not an issue for the test themselves, as the multiple processes
left over by the tests do not interact with each other. But the resource
consumption on the test machine is growing during the execution, and
could lead to missing memory after hundreds of tests.

This commit ensures that we kill the runtime, which will properly
shut down the VM.

Signed-off-by: Julien Ropé <jrope@redhat.com>
Adding a test that verifies we're actually running the job with the kata runtime.
This is meant to validate the CI job's config for kata while working on the
test scripts themselves.

Signed-off-by: Julien Ropé <jrope@redhat.com>
The RUNTIME_BINARY_PATH as it is set assumes that the runtime name is also
the binary name for the runtime.
That's not true for kata, where the runtime name "kata" is different than
the binary name in most installations.

We used to use the "containerd-shim-kata-v2" name for the runtime,
so that the CI would work, but that's making a difference between
how we test and how it's actually used by most users.

This commit allows us to set RUNTIME_BINARY_PATH as needed, and
keeps the default behavior for any other runtimes.

Signed-off-by: Julien Ropé <jrope@redhat.com>
The helpers.bash function "create_runtime_with_allowed_annotation()"
was missing a couple settings that the kata container runtime needs,
resulting in an incomplete configuration for testing with kata containers.

Signed-off-by: Julien Ropé <jrope@redhat.com>
This is a shared functionality for multiple tests: create a new
runtime config, set it to default, and add specific parameters to it.
Can be allowed annotation, min memory, etc.

These tests are failing in the kata use case because they miss
some of the required settings that the kata runtime needs.
Their created runtime is just not properly set for kata containers.

Based on the existing "create_runtime_with_allowed_annotation()", this
commit creates a generic function to have a new runtime and set it
as the default. The function returns the path to the created config file
so that the caller can append any needed parameter to it.

Subsequent commits will try to use that new function where needed.

Signed-off-by: Julien Ropé <jrope@redhat.com>
These tests create a new runtime class with only the "runtime_binary"
parameter set.
Kata requires additional parameters that are ignored here,
which is why they fail with it.

This commit uses the newly added "create_new_runtime_class" in helpers.bash
to make sure that all parameters are set.

Signed-off-by: Julien Ropé <jrope@redhat.com>
Apply the function "create_new_default_runtime()"
to cgroups.bats and ctr.bats

Signed-off-by: Julien Ropé <jrope@redhat.com>
Signed-off-by: Julien Ropé <jrope@redhat.com>
Now that the helpers.bash function is fixed, try re-enabling those tests.

Signed-off-by: Julien Ropé <jrope@redhat.com>
Signed-off-by: Julien Ropé <jrope@redhat.com>
Signed-off-by: Julien Ropé <jrope@redhat.com>
Signed-off-by: Julien Ropé <jrope@redhat.com>
@littlejawa
Copy link
Contributor Author

/test ci-fedora-kata

@littlejawa
Copy link
Contributor Author

/test ci-fedora-integration

@littlejawa
Copy link
Contributor Author

/test ci-fedora-kata

Copy link
Contributor

openshift-ci bot commented May 30, 2024

@littlejawa: 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/ci-cgroupv2-e2e-features e02f2d7 link true /test ci-cgroupv2-e2e-features
ci/prow/ci-cgroupv2-e2e-crun e02f2d7 link true /test ci-cgroupv2-e2e-crun
ci/prow/ci-e2e-conmonrs e02f2d7 link true /test ci-e2e-conmonrs
ci/prow/ci-rhel-e2e e02f2d7 link true /test ci-rhel-e2e
ci/prow/ci-cgroupv2-e2e e02f2d7 link true /test ci-cgroupv2-e2e
ci/prow/ci-cgroupv2-integration e02f2d7 link true /test ci-cgroupv2-integration
ci/prow/ci-e2e e02f2d7 link true /test ci-e2e
ci/prow/ci-fedora-critest e02f2d7 link true /test ci-fedora-critest
ci/prow/ci-rhel-critest e02f2d7 link true /test ci-rhel-critest
ci/prow/ci-e2e-evented-pleg e02f2d7 link true /test ci-e2e-evented-pleg
ci/prow/ci-crun-e2e e02f2d7 link true /test ci-crun-e2e
ci/prow/e2e-gcp-ovn e02f2d7 link true /test e2e-gcp-ovn
ci/prow/e2e-aws-ovn e02f2d7 link true /test e2e-aws-ovn
ci/prow/ci-fedora-kata e02f2d7 link true /test ci-fedora-kata

Full PR test history. Your PR dashboard.

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-sigs/prow 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
dco-signoff: yes Indicates the PR's author has DCO signed all their commits. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. kind/ci Categorizes issue or PR as related to CI release-note-none Denotes a PR that doesn't merit a release note.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant