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

SDN-4168: Optimize timing for IPsec tests #28797

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pperiyasamy
Copy link
Member

@pperiyasamy pperiyasamy commented May 13, 2024

The ipsec test suite takes about 5-6 hours to finish running the tests which doesn't work well with e2e-aws-ovn-ipsec-serial CI lane as it produces many disruptive events and failing all the time. Hence this commit optimizes ipsec tests so that it doesn't cause any cluster reboot when changing ipsec modes.

@pperiyasamy pperiyasamy marked this pull request as draft May 13, 2024 11:52
@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 May 13, 2024
@openshift-ci openshift-ci bot requested review from knobunc and trozet May 13, 2024 11:58
@pperiyasamy pperiyasamy changed the title Fix IPsec tests for CI run Optimize timing for IPsec tests May 15, 2024
Copy link
Contributor

openshift-ci bot commented May 15, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: pperiyasamy
Once this PR has been reviewed and has the lgtm label, please assign deads2k 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

@pperiyasamy pperiyasamy marked this pull request as ready for review May 15, 2024 13:47
@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 May 15, 2024
@pperiyasamy pperiyasamy changed the title Optimize timing for IPsec tests SDN-4168: Optimize timing for IPsec tests May 15, 2024
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label May 15, 2024
@openshift-ci-robot
Copy link

openshift-ci-robot commented May 15, 2024

@pperiyasamy: This pull request references SDN-4168 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.16.0" version, but no target version was set.

In response to this:

The ipsec test suite takes about 5-6 hours to finish running the tests which doesn't work well with e2e-aws-ovn-ipsec-serial CI lane as it produces many disruptive events and failing all the time. Hence this commit optimizes ipsec tests so that it doesn't cause any cluster reboot when changing ipsec modes.

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-trt-bot
Copy link

Job Failure Risk Analysis for sha: 94bd34b

Job Name Failure Risk
pull-ci-openshift-origin-master-e2e-aws-ovn-single-node-upgrade Low
[bz-Node Tuning Operator] clusteroperator/node-tuning should not change condition/Available
This test has passed 50.00% of 2 runs on release 4.17 [amd64 aws ovn single-node upgrade upgrade-micro] in the last week.
---
[bz-apiserver-auth] clusteroperator/authentication should not change condition/Available
This test has passed 0.00% of 2 runs on release 4.17 [amd64 aws ovn single-node upgrade upgrade-micro] in the last week.
---
[bz-openshift-controller-manager] clusteroperator/openshift-controller-manager should not change condition/Available
This test has passed 50.00% of 2 runs on release 4.17 [amd64 aws ovn single-node upgrade upgrade-micro] in the last week.
---
[bz-Storage] clusteroperator/storage should not change condition/Available
This test has passed 50.00% of 2 runs on release 4.17 [amd64 aws ovn single-node upgrade upgrade-micro] in the last week.
---
Showing 4 of 7 test results

@pperiyasamy
Copy link
Member Author

/assign @jcaamano

@openshift-trt-bot
Copy link

Job Failure Risk Analysis for sha: 59a8b3a

Job Name Failure Risk
pull-ci-openshift-origin-master-e2e-aws-ovn-single-node IncompleteTests
Tests for this run (98) are below the historical average (1543): IncompleteTests (not enough tests ran to make a reasonable risk analysis; this could be due to infra, installation, or upgrade problems)

Copy link
Contributor

@jcaamano jcaamano left a comment

Choose a reason for hiding this comment

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

@pperiyasamy I think we need to find a way to test this in CI without merging

return wait.PollUntilContextTimeout(context.Background(), ipsecRolloutWaitInterval,
ipsecRolloutWaitDuration, true, func(ctx context.Context) (bool, error) {
ds, err := getDaemonSet(oc, ovnNamespace, ovnIPsecDsName)
Copy link
Contributor

Choose a reason for hiding this comment

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

I would add a comment here that you expect the daemon set to not be deployed

Copy link
Member Author

Choose a reason for hiding this comment

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

done

err := checkDstNodeTraffic(dst)
if err != nil {
return fmt.Errorf("error capturing traffic on the dst node: %v", err)
}
return nil
})
pingSync.Go(func() error {
wg.Wait()
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this wait group is going to help

I would just increase the ping counter if you think we need that

@@ -371,6 +388,7 @@ var _ = g.Describe("[sig-network][Feature:IPsec]", g.Ordered, func() {
o.Expect(err).To(o.HaveOccurred())
err = pingAndCheckNodeTraffic(config.srcNodeConfig, config.dstNodeConfig, icmp)
o.Expect(err).To(o.HaveOccurred())
err = nil
Copy link
Contributor

Choose a reason for hiding this comment

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

why did you need this?

Copy link
Contributor

Choose a reason for hiding this comment

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

I just realized you probably need to consider using GinkgoHelper() if you are going to use gomega on helper functions
https://onsi.github.io/gomega/#making-assertions-in-helper-functions

Copy link
Member Author

Choose a reason for hiding this comment

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

The err is expected to happen here. so err = nil is needed to make defer block clean up test pods.
added GinkgoHelper() in helper functions.

o.Expect(nsCertMachineConfig).NotTo(o.BeNil())
o.Eventually(func() bool {
pools, err := getMachineConfigPoolByLabel(oc, workerRoleMachineConfigLabel)
o.Expect(err).NotTo(o.HaveOccurred())
Copy link
Contributor

Choose a reason for hiding this comment

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

I just realized your function needs to take a gomega instance as parameter if you plan to use it within Eventually blocks
https://onsi.github.io/gomega/#category-3-making-assertions-eminem-the-function-passed-into-codeeventuallycode

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, done.

test/extended/networking/ipsec.go Outdated Show resolved Hide resolved
@@ -511,37 +551,17 @@ var _ = g.Describe("[sig-network][Feature:IPsec]", g.Ordered, func() {
checkNodeTraffic(v1.IPsecModeDisabled)

g.By(fmt.Sprintf("configure IPsec in %s mode and validate traffic", mode))
// Change IPsec mode to External and packet capture on the node's interface
// must be geneve encapsulated ones.
// Change IPsec mode to given mode and do packet capture on the node's interface
Copy link
Contributor

Choose a reason for hiding this comment

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

This err := configureIPsecMode(oc, mode) is not causing a reboot when ipsec machine config extensions are deployed? Is that because we the CI job starts deploys the cluster with IPSec already enabled? In Full mode?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, this is what we discussed last week. We'll have CI job starting cluster with IPsec full mode and then execute the tests with minimal number of node reboots

if !time.Now().Before(certExpirationDate) {
framework.Failf("certficates in the Machine Config are expired, Please consider recreating those certificates")
}
nsCertMachineConfig, err := createIPsecCertsMachineConfig(oc)
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess this does not cause a reboot because they are just ceerts

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 still causes reboot of worker nodes and certs are deployed via machine config.

The ipsec test suite takes about 5-6 hours to finish running the tests which
doesn't work well with e2e-aws-ovn-ipsec-serial CI lane as it produces many
disruptive events and failing all the time. Hence this commit optimizes
ipsec tests so that it doesn't cause any cluster reboot when changing
ipsec modes.

Signed-off-by: Periyasamy Palanisamy <[email protected]>
Copy link
Member Author

@pperiyasamy pperiyasamy left a comment

Choose a reason for hiding this comment

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

I think we need to find a way to test this in CI without merging

yes, we must merge this CI lane openshift/release#50687 to get this tested. cc @jluhrsen

return wait.PollUntilContextTimeout(context.Background(), ipsecRolloutWaitInterval,
ipsecRolloutWaitDuration, true, func(ctx context.Context) (bool, error) {
ds, err := getDaemonSet(oc, ovnNamespace, ovnIPsecDsName)
Copy link
Member Author

Choose a reason for hiding this comment

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

done

@@ -371,6 +388,7 @@ var _ = g.Describe("[sig-network][Feature:IPsec]", g.Ordered, func() {
o.Expect(err).To(o.HaveOccurred())
err = pingAndCheckNodeTraffic(config.srcNodeConfig, config.dstNodeConfig, icmp)
o.Expect(err).To(o.HaveOccurred())
err = nil
Copy link
Member Author

Choose a reason for hiding this comment

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

The err is expected to happen here. so err = nil is needed to make defer block clean up test pods.
added GinkgoHelper() in helper functions.

if !time.Now().Before(certExpirationDate) {
framework.Failf("certficates in the Machine Config are expired, Please consider recreating those certificates")
}
nsCertMachineConfig, err := createIPsecCertsMachineConfig(oc)
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 still causes reboot of worker nodes and certs are deployed via machine config.

@@ -511,37 +551,17 @@ var _ = g.Describe("[sig-network][Feature:IPsec]", g.Ordered, func() {
checkNodeTraffic(v1.IPsecModeDisabled)

g.By(fmt.Sprintf("configure IPsec in %s mode and validate traffic", mode))
// Change IPsec mode to External and packet capture on the node's interface
// must be geneve encapsulated ones.
// Change IPsec mode to given mode and do packet capture on the node's interface
Copy link
Member Author

Choose a reason for hiding this comment

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

yes, this is what we discussed last week. We'll have CI job starting cluster with IPsec full mode and then execute the tests with minimal number of node reboots

o.Expect(nsCertMachineConfig).NotTo(o.BeNil())
o.Eventually(func() bool {
pools, err := getMachineConfigPoolByLabel(oc, workerRoleMachineConfigLabel)
o.Expect(err).NotTo(o.HaveOccurred())
Copy link
Member Author

Choose a reason for hiding this comment

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

yes, done.

@pperiyasamy
Copy link
Member Author

/test ?

Copy link
Contributor

openshift-ci bot commented May 31, 2024

@pperiyasamy: The following commands are available to trigger required jobs:

  • /test e2e-aws-jenkins
  • /test e2e-aws-ovn-edge-zones
  • /test e2e-aws-ovn-fips
  • /test e2e-aws-ovn-image-registry
  • /test e2e-aws-ovn-serial
  • /test e2e-gcp-ovn
  • /test e2e-gcp-ovn-builds
  • /test e2e-gcp-ovn-image-ecosystem
  • /test e2e-gcp-ovn-upgrade
  • /test e2e-metal-ipi-ovn-ipv6
  • /test images
  • /test lint
  • /test unit
  • /test verify
  • /test verify-deps

The following commands are available to trigger optional jobs:

  • /test 4.12-upgrade-from-stable-4.11-e2e-aws-ovn-upgrade-rollback
  • /test e2e-agnostic-ovn-cmd
  • /test e2e-aws
  • /test e2e-aws-csi
  • /test e2e-aws-disruptive
  • /test e2e-aws-etcd-recovery
  • /test e2e-aws-ovn
  • /test e2e-aws-ovn-cgroupsv2
  • /test e2e-aws-ovn-etcd-scaling
  • /test e2e-aws-ovn-ipsec-serial
  • /test e2e-aws-ovn-kubevirt
  • /test e2e-aws-ovn-single-node
  • /test e2e-aws-ovn-single-node-serial
  • /test e2e-aws-ovn-single-node-upgrade
  • /test e2e-aws-ovn-upgrade
  • /test e2e-aws-ovn-upi
  • /test e2e-aws-proxy
  • /test e2e-azure
  • /test e2e-azure-ovn-etcd-scaling
  • /test e2e-azure-ovn-upgrade
  • /test e2e-baremetalds-kubevirt
  • /test e2e-gcp-csi
  • /test e2e-gcp-disruptive
  • /test e2e-gcp-fips-serial
  • /test e2e-gcp-ovn-etcd-scaling
  • /test e2e-gcp-ovn-rt-upgrade
  • /test e2e-gcp-ovn-techpreview
  • /test e2e-gcp-ovn-techpreview-serial
  • /test e2e-metal-ipi-ovn
  • /test e2e-metal-ipi-ovn-dualstack
  • /test e2e-metal-ipi-ovn-dualstack-local-gateway
  • /test e2e-metal-ipi-serial
  • /test e2e-metal-ipi-serial-ovn-ipv6
  • /test e2e-metal-ipi-virtualmedia
  • /test e2e-openstack-ovn
  • /test e2e-openstack-serial
  • /test e2e-vsphere
  • /test e2e-vsphere-ovn-dualstack-primaryv6
  • /test e2e-vsphere-ovn-etcd-scaling
  • /test okd-e2e-gcp
  • /test okd-scos-images

Use /test all to run the following jobs that were automatically triggered:

  • pull-ci-openshift-origin-master-e2e-agnostic-ovn-cmd
  • pull-ci-openshift-origin-master-e2e-aws-csi
  • pull-ci-openshift-origin-master-e2e-aws-ovn-cgroupsv2
  • pull-ci-openshift-origin-master-e2e-aws-ovn-edge-zones
  • pull-ci-openshift-origin-master-e2e-aws-ovn-fips
  • pull-ci-openshift-origin-master-e2e-aws-ovn-ipsec-serial
  • pull-ci-openshift-origin-master-e2e-aws-ovn-serial
  • pull-ci-openshift-origin-master-e2e-aws-ovn-single-node
  • pull-ci-openshift-origin-master-e2e-aws-ovn-single-node-serial
  • pull-ci-openshift-origin-master-e2e-aws-ovn-single-node-upgrade
  • pull-ci-openshift-origin-master-e2e-aws-ovn-upgrade
  • pull-ci-openshift-origin-master-e2e-gcp-csi
  • pull-ci-openshift-origin-master-e2e-gcp-ovn
  • pull-ci-openshift-origin-master-e2e-gcp-ovn-builds
  • pull-ci-openshift-origin-master-e2e-gcp-ovn-rt-upgrade
  • pull-ci-openshift-origin-master-e2e-gcp-ovn-upgrade
  • pull-ci-openshift-origin-master-e2e-metal-ipi-ovn
  • pull-ci-openshift-origin-master-e2e-metal-ipi-ovn-ipv6
  • pull-ci-openshift-origin-master-e2e-openstack-ovn
  • pull-ci-openshift-origin-master-images
  • pull-ci-openshift-origin-master-lint
  • pull-ci-openshift-origin-master-unit
  • pull-ci-openshift-origin-master-verify
  • pull-ci-openshift-origin-master-verify-deps

In response to this:

/test ?

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.

@pperiyasamy
Copy link
Member Author

/test e2e-aws-ovn-ipsec-serial

Copy link
Contributor

openshift-ci bot commented May 31, 2024

@pperiyasamy: 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-gcp-ovn-rt-upgrade ff43448 link false /test e2e-gcp-ovn-rt-upgrade
ci/prow/e2e-aws-ovn-single-node ff43448 link false /test e2e-aws-ovn-single-node
ci/prow/e2e-aws-ovn-single-node-upgrade ff43448 link false /test e2e-aws-ovn-single-node-upgrade
ci/prow/e2e-aws-ovn-edge-zones ff43448 link true /test e2e-aws-ovn-edge-zones
ci/prow/e2e-gcp-ovn ff43448 link true /test e2e-gcp-ovn
ci/prow/e2e-aws-ovn-ipsec-serial ff43448 link false /test e2e-aws-ovn-ipsec-serial

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.

@openshift-trt-bot
Copy link

Job Failure Risk Analysis for sha: ff43448

Job Name Failure Risk
pull-ci-openshift-origin-master-e2e-aws-ovn-single-node-upgrade IncompleteTests
Tests for this run (99) are below the historical average (1782): IncompleteTests (not enough tests ran to make a reasonable risk analysis; this could be due to infra, installation, or upgrade problems)
pull-ci-openshift-origin-master-e2e-aws-ovn-single-node IncompleteTests
Tests for this run (98) are below the historical average (1114): IncompleteTests (not enough tests ran to make a reasonable risk analysis; this could be due to infra, installation, or upgrade problems)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants