packer-plugin-googlecompute icon indicating copy to clipboard operation
packer-plugin-googlecompute copied to clipboard

Add instance_max_run_duration_seconds config

Open phoenixuprising opened this issue 1 year ago • 5 comments

This pr adds a new instance_max_run_duration_seconds config field that gets piped down into the builder instance's maxRunDuration schedule. This will allow for an instance to automatically be stopped or deleted, even if the packer build process is killed.

It also adds an instance_termination_action which must be set if instance_max_run_duration_seconds config is set. This will tell GCP to either STOP or DELETE the instance once the max duration has been reached.

phoenixuprising avatar Dec 11 '24 05:12 phoenixuprising

CLA assistant check
All committers have signed the CLA.

hashicorp-cla-app[bot] avatar Dec 11 '24 05:12 hashicorp-cla-app[bot]

@nywilken - I saw you commenting on another PR. Is this something you can look at or pass off to someone that can?

My team is running packer in a github action and people will cancel the action sometimes while it is running, which doesn't give packer the opportunity to clean up instances correctly.

phoenixuprising avatar Dec 12 '24 17:12 phoenixuprising

@nywilken - I saw you commenting on another PR. Is this something you can look at or pass off to someone that can?

My team is running packer in a github action and people will cancel the action sometimes while it is running, which doesn't give packer the opportunity to clean up instances correctly.

@phoenixuprising I’m no longer working on this project. But I’m cc’ing @lbajolet-hashicorp to help get eyes on the pull-request. Please be mindful that the team’s priority might be elsewhere at the moment. So he made need time to review and respond.

nywilken avatar Dec 14 '24 13:12 nywilken

@lbajolet-hashicorp - Just wanted to check in and see if you could look over this PR. Thanks.

phoenixuprising avatar Jan 02 '25 23:01 phoenixuprising

I apologize this has been lagging 🙃 I will clean up the rest of this and get it prepared for merging.

phoenixuprising avatar Sep 17 '25 15:09 phoenixuprising