windsource / picus

Connects to Woodpecker CI and dynamically creates an agent in the cloud.
MIT License
39 stars 4 forks source link

max idle time doesn't apply for last build running #18

Open ghazninattarshah opened 19 hours ago

ghazninattarshah commented 19 hours ago

when max idle time is set to low like 5 mins, and the job count is 0, it means the last build is still running, the agent shutdown abruptly even when the build is not finished.

windsource commented 16 hours ago

@ghazninattarshah Picus starts the idle timer when running_count is 0 again. During the build running_count is > 0. I have just checked this with Woodpecker 2.7.1 and it works fine even with long build times and short PICUS_MAX_IDLE_TIME.

ghazninattarshah commented 37 minutes ago

@windsource The build started with starting an instance. I set the max idle to 2m. You can see the log when it starts and shuts down. The build duration is exactly 2 minutes. By the way, we're using AWS. (there are 2 agents configured with picus)

image

reference:

image image