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

Delay the stopping of instances when requested. #706

Open
lengau opened this issue Dec 18, 2024 · 2 comments
Open

Delay the stopping of instances when requested. #706

lengau opened this issue Dec 18, 2024 · 2 comments
Labels
Enhancement New feature or request

Comments

@lengau
Copy link
Contributor

lengau commented Dec 18, 2024

What needs to get done

Basically make #571 production-ready.

  • Change Provider.launched_environment() to take an optional shutdown delay time (default to None using current behaviour, otherwise delay for the specified number of minutes).
  • Change each Provider to be able to handle an already-running instance. (Perhaps setting and releasing a lock on that instance?)
  • Change each Provider to run the shutdown command if the instance has a shutdown delay time set (even if that time is 0, in which case the shutdown should still occur asynchronously).

Why it needs to get done

During iteration on a (snap|charm|rock|whatever), each run includes starting up and shutting down an instance, which can add significantly to the time the run takes. A pre-warmed machine can avoid this.

NOTE: It will be up to the application to actually opt into using this feature, so it will be a backwards compatible change.

@lengau lengau added the Enhancement New feature or request label Dec 18, 2024
@sergiusens
Copy link
Collaborator

Multipass' stop has a timeout to delay the shutdown, we used to always use this with a timeout that would allow for iterations. Not sure why that is no where to be seen now

@lengau
Copy link
Contributor Author

lengau commented Dec 18, 2024

It looks like we still have code to use that, but the multipass provider doesn't use it.

LXD doesn't have the equivalent so we'll need to use my mentioned implementation there, but for multipass we can just expose that value.

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

No branches or pull requests

2 participants