ec2-github-runner icon indicating copy to clipboard operation
ec2-github-runner copied to clipboard

Specifying timeout(s)

Open AlexandreUnlatch opened this issue 4 years ago • 3 comments

I may be mistaken but I didn't find any options to specify a timeout.

It seems to me that 2 types of timeouts could be implemented.

  • Stopping the job after x amount of time. This could be achieved in a run statement, but having an argument like "job-timeout" or such could be useful.

  • Terminating the ec2 instance after x amount of time. To reduce the risk of paying for an unused EC2 instance if any edge case, where that could happen, was to happen. Self terminating the ec2 instance might be a way to implement this behavior. An argument "ec2-timeout" might then be appropriate.

AlexandreUnlatch avatar Sep 07 '21 08:09 AlexandreUnlatch

I was going to ask about the same thing, another mechanism to consider is https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/UsingAlarmActions.html#AddingTerminateActions Perhaps during the start-runner we can use some of the AWS API to setup an alarm that will terminate the instance after some time.

mikemhenry avatar Sep 07 '21 23:09 mikemhenry

Stopping the job after x amount of time

Which job?

jpalomaki avatar Sep 08 '21 17:09 jpalomaki

Hi ! The first bullet point actually refers to github actions job timeout and is thus already implemented :+1:

Only the one for terminating the ec2 may be useful to add !

AlexandreUnlatch avatar Sep 10 '21 04:09 AlexandreUnlatch