-
Notifications
You must be signed in to change notification settings - Fork 212
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
[Test] delete kind cluster after tests run #120
Conversation
@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. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: mucahitkurt 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 |
ca2366b
to
73714e8
Compare
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. |
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. |
release-tools/prow.sh
Outdated
@@ -1017,6 +1023,7 @@ main () { | |||
fi | |||
fi | |||
fi | |||
delete_cluster |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
.
73714e8
to
bcd02d3
Compare
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 <[email protected]>
bcd02d3
to
7fd2c42
Compare
@mucahitkurt: The following test failed, say
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. |
There was a problem hiding this 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.
@pohly I updated the |
6616a6b Merge pull request kubernetes-csi#146 from pohly/kubernetes-1.21 510fb0f prow.sh: support Kubernetes 1.21 c63c61b prow.sh: add CSI_PROW_DEPLOYMENT_SUFFIX 51ac11c Merge pull request kubernetes-csi#144 from pohly/pull-jobs dd54c92 pull-test.sh: test importing csi-release-tools into other repo 7d2643a Merge pull request kubernetes-csi#143 from pohly/path-setup 6880b0c prow.sh: avoid creating paths unless really running tests bc0504a Merge pull request kubernetes-csi#140 from jsafrane/remove-unused-k8s-libs 5b1de1a go-get-kubernetes.sh: remove unused k8s libs 49b4269 Merge pull request kubernetes-csi#120 from pohly/add-kubernetes-release f7e7ee4 docs: steps for adding testing against new Kubernetes release git-subtree-dir: release-tools git-subtree-split: 6616a6b
docs: steps for adding testing against new Kubernetes release
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