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

Add the ability to pause the remote pod #712

Closed
aviramha opened this issue Nov 9, 2022 · 8 comments
Closed

Add the ability to pause the remote pod #712

aviramha opened this issue Nov 9, 2022 · 8 comments
Assignees
Labels

Comments

@aviramha
Copy link
Member

aviramha commented Nov 9, 2022

Today, mirrord runs side-by-side with the existing pod/s. Many users want to "replace" the remote pod.
I think the best, nicest, approach wouldn't be to really replace the replicaset with our agent, but still run it side by side, making the agent send SIGSTOP to the pod's process, then SIGCONT when agent finishes running.
This way we're just pausing the activity of the original pod.

Small hint- I think we should have a loop that sends SIGSTOP every few seconds, as there might be some OS stuff that will send SIGCONT without us knowing/wanting.

Suggestion - flag would be --pause -p

  • We need to test it on multiple runtimes, so this should be covered in e2e, not just integration testing.
  • Manually test few frameworks (Python, Java, Go) to see how they behave with this method.
  • Check a scenario where the remote pod has health checks - I assume the local service would answer for those so k8s won't mark it as not ready / dead
@t4lz
Copy link
Member

t4lz commented Nov 27, 2022

Should we use docker's pause command if docker is the container's runtime?

And maybe if it's not docker we can still use cgroup freezer which is apparently what docker uses to pause?

@aviramha
Copy link
Member Author

I wouldn't bother with docker pause as it's not the common runtime.
cgroup freezer sounds cool but also overkill for now if we already went with the sigstop..

@t4lz
Copy link
Member

t4lz commented Nov 27, 2022

Saw your reply too late. But now we have a neat implementation using the docker/containerd API to pause the container instead of doing it ourselves :)

@t4lz
Copy link
Member

t4lz commented Nov 28, 2022

Is adding this feature to the IDEs part of this issue or should I open separate issues for that?
(PRs would be separate either way I guess)

@aviramha
Copy link
Member Author

Is adding this feature to the IDEs part of this issue or should I open separate issues for that? (PRs would be separate either way I guess)

No, this feature should be possible to enable from the config file - VS Code already uses it and IntelliJ is underway.

bors bot pushed a commit that referenced this issue Nov 29, 2022
#712

Add the `--pause` flag which pauses the target container while there are clients connected to the agent.
When the last client disconnects the container resumes.

Currently the pause behaviour is determined in the creation of the agent. So if clients from a different run want to reuse the same agent they will just get the existing pause behaviour of the agent.
@t4lz t4lz mentioned this issue Dec 1, 2022
4 tasks
@t4lz
Copy link
Member

t4lz commented Dec 1, 2022

Stable status tracked in #809, support for ephemeral tracked in #795.

@t4lz t4lz closed this as completed Dec 1, 2022
@bcouetil
Copy link

That exactly what is preventing me from using Telepresence 2.

Many thanks 🙏🎉

@aviramha
Copy link
Member Author

@bcouetil Thanks for letting us know! It'll make us prioritize stabilizing this feature :) #809
Let us know if you have any more feature requests/feedback.

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

No branches or pull requests

3 participants