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] delete kind cluster after tests run #120

Closed

Conversation

mucahitkurt
Copy link
Contributor

@mucahitkurt mucahitkurt commented Nov 14, 2019

Delete kind cluster after tests run. Inside a real Prow job it is better to clean up at runtime instead of leaving that to the Prow job cleanup code because the later sometimes times out.

Related issue is kubernetes-csi/csi-release-tools#24

@k8s-ci-robot
Copy link
Contributor

@mucahitkurt: Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

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.

@k8s-ci-robot k8s-ci-robot added do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Nov 14, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: mucahitkurt
To complete the pull request process, please assign saad-ali
You can assign the PR to them by writing /assign @saad-ali in a comment when ready.

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

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Nov 16, 2019
@pohly
Copy link
Contributor

pohly commented Nov 16, 2019

Can you explain why you want this changed?

The prow.sh script intentionally doesn't clean up after itself. When it's used inside a Prow job, deleting that job should clean up. When it's used on a developer's machine, then keeping everything running simplifies debugging in case of a failure. Running the script again will then destroy the cluster and start anew, so it's not leaving an unbounded number of clusters behind.

I had once contemplated to write a wrapper script around prow.sh which takes care of setting up a temporary GOPATH (which does get modified by the script!) and properly cleans up afterwards. That makes sense to me, but not trying to clean up inside the script itself (because it isn't always needed or desired).

@mucahitkurt
Copy link
Contributor Author

Can you explain why you want this changed?

The prow.sh script intentionally doesn't clean up after itself. When it's used inside a Prow job, deleting that job should clean up. When it's used on a developer's machine, then keeping everything running simplifies debugging in case of a failure. Running the script again will then destroy the cluster and start anew, so it's not leaving an unbounded number of clusters behind.

I had once contemplated to write a wrapper script around prow.sh which takes care of setting up a temporary GOPATH (which does get modified by the script!) and properly cleans up afterwards. That makes sense to me, but not trying to clean up inside the script itself (because it isn't always needed or desired).

@pohly I opened the PR because of the issue kubernetes-csi/csi-release-tools#24. I got the issue as not cleaning cluster after test run can cause timeout for the test jobs.

Btw this is the test PR, actual PR is kubernetes-csi/csi-release-tools#46.

@pohly
Copy link
Contributor

pohly commented Nov 18, 2019

kubernetes-csi/csi-release-tools#24 (comment) explains why this change is needed. This is information that better should better be copied into the commit message and the PR description because then it is available when reviewers like me need it. I wasn't aware of that issue.

For csi-release-tools changes it is better to first discuss and finalize the review in one of the components, then create the PR in csi-release-tools. That way there's no confusion about where to discuss the change and if changes are needed, you don't need to update the csi-release-tools PR potentially multiple times.

@@ -1017,6 +1023,7 @@ main () {
fi
fi
fi
delete_cluster
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we make this conditional and only do it in the CI? At least I sometimes run this script manually and prefer to keep the cluster around for debugging.

We could turn this into:

# Inside a real Prow job it is better to clean up at runtime
# instead of leaving that to the Prow job cleanup code
# because the later sometimes times out (https://github.com/kubernetes-csi/csi-release-tools/issues/24#issuecomment-554765872).
if [ "$JOB_NAME" ]; then
    delete_cluster
fi

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed! I assume you don't want the same thing for tests_need_alpha_cluster?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, I do. I just didn't point it out explicitly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I moved the control to delete_cluster method and renamed it to delete_cluster_inside_prow_job.

@mucahitkurt
Copy link
Contributor Author

kubernetes-csi/csi-release-tools#24 (comment) explains why this change is needed. This is information that better should better be copied into the commit message and the PR description because then it is available when reviewers like me need it. I wasn't aware of that issue.

For csi-release-tools changes it is better to first discuss and finalize the review in one of the components, then create the PR in csi-release-tools. That way there's no confusion about where to discuss the change and if changes are needed, you don't need to update the csi-release-tools PR potentially multiple times.

Ok. Thanks for the heads up!

…ter to clean up at runtime instead of leaving that to the Prow job cleanup code because the later sometimes times out.

Signed-off-by: Mucahit Kurt <mucahitkurt@gmail.com>
@k8s-ci-robot
Copy link
Contributor

@mucahitkurt: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
pull-kubernetes-csi-csi-driver-host-path-unit 7fd2c42 link /test pull-kubernetes-csi-csi-driver-host-path-unit

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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.

Copy link
Contributor

@pohly pohly left a comment

Choose a reason for hiding this comment

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

Looks good to me, please update the csi-release-tools PR and we can merge it there.

I can then kick of a round of repo updates to merge that into the different sidecars.

@mucahitkurt
Copy link
Contributor Author

Looks good to me, please update the csi-release-tools PR and we can merge it there.

I can then kick of a round of repo updates to merge that into the different sidecars.

@pohly I updated the csi-release-tools PR, thank you!

pohly added a commit to pohly/csi-driver-host-path that referenced this pull request May 5, 2021
6616a6b5 Merge pull request kubernetes-csi#146 from pohly/kubernetes-1.21
510fb0f9 prow.sh: support Kubernetes 1.21
c63c61b3 prow.sh: add CSI_PROW_DEPLOYMENT_SUFFIX
51ac11c3 Merge pull request kubernetes-csi#144 from pohly/pull-jobs
dd54c926 pull-test.sh: test importing csi-release-tools into other repo
7d2643a5 Merge pull request kubernetes-csi#143 from pohly/path-setup
6880b0c8 prow.sh: avoid creating paths unless really running tests
bc0504ad Merge pull request kubernetes-csi#140 from jsafrane/remove-unused-k8s-libs
5b1de1ad go-get-kubernetes.sh: remove unused k8s libs
49b42693 Merge pull request kubernetes-csi#120 from pohly/add-kubernetes-release
f7e7ee49 docs: steps for adding testing against new Kubernetes release

git-subtree-dir: release-tools
git-subtree-split: 6616a6b5294b6df39cfce37f4fce7cdce0a77583
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants