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

[FEATURE]: timeouts for cleanup commands #6076

Open
salotz opened this issue May 24, 2024 · 6 comments
Open

[FEATURE]: timeouts for cleanup commands #6076

salotz opened this issue May 24, 2024 · 6 comments
Assignees

Comments

@salotz
Copy link

salotz commented May 24, 2024

Feature Request

Background / Motivation

I need to run cleanup namespace in a workflow and I'm hitting the hard-coded timeouts for this as it can take a while. When this runs in CI this becomes a problem as it then causes CI to fail as the task exits as failed.

What should the user be able to do?

Specify a timeout when running cleanup ... commands with garden.

Suggested Implementation(s)

garden cleanup --timeout=1000 [...]

How important is this feature for you/your team?

Somewhere between:

🥀 Crucial, Garden is unusable for us without it

🌵 Not having this feature makes using Garden painful

As I don't really know a workaround.

@vvagaytsev vvagaytsev changed the title [FEATURE]: timeouts for cleeanup commands [FEATURE]: timeouts for cleanup commands May 28, 2024
@eysi09
Copy link
Collaborator

eysi09 commented May 28, 2024

Hi @salotz

Thanks for flagging this. Your suggestion makes sense and we'll add support for this.

@eysi09
Copy link
Collaborator

eysi09 commented May 28, 2024

Actually, it might make more sense to just bump the default timeout.

Do you have a rough feeling for what a sensible value could be for your use case?

@salotz
Copy link
Author

salotz commented May 28, 2024

@eysi09 Usually increasing timeouts to 15min does it for me, but I don't have a good intuition about which operations actually take so long. Especially when cleaning up namespaces I find sometimes k8s gets stuck.

@eysi09
Copy link
Collaborator

eysi09 commented May 29, 2024

Ok gotcha. The current default timeout is 300 seconds so that would be quite a large bump.

In that case I think the quickest win would be to set this is an environment variable. The cleanup command can technically delete things beyond K8s namespaces so the --timeout flag wouldn't really be well defined and you might need different values for different "kinds" of namespaces in the future.

Do you think the env var approach would work for your use case?

Something like:

GARDEN_K8S_DELETE_NS_TIMEOUT_MS=900 garden cleanup namespace

(A little verbose but the quickest win AFIACT since this blocking you)

@salotz
Copy link
Author

salotz commented May 29, 2024

That should work yes.

@salotz
Copy link
Author

salotz commented May 29, 2024

I do have a workaround implemented in CI to just use kubectl for deleting the namespace which I can set timeouts for btw.

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

No branches or pull requests

2 participants