runboat icon indicating copy to clipboard operation
runboat copied to clipboard

Improve the oldest_stopped algorithm

Open sbidoul opened this issue 3 years ago • 2 comments

Currently the oldest_stopped algorithm that is used by the undeployer protects the build for the last commit of each branch (non-PR) build.

The algorithm could be made smarter by also returning these for undeployment, and giving lower undeployment priority to the last commit of each PR too.

  • first undeploy builds by creation order, excluding the last build of each repo/target-branch/pr
  • then undeploy the last commit of prs
  • then undeploy the last commit of branches (non-PR)

sbidoul avatar Dec 03 '21 23:12 sbidoul

Wondering: would it be easy/convenient/helpful to trigger runboat build only on demand to avoid building every time? Something like /ocabot runboat [build|run], or using a label. All in all we don't always need to test manually.

simahawk avatar Dec 04 '21 09:12 simahawk

@simahawk I chose to optimize the experience for functional people who want to test PRs or main branches. With the current approach (since they usually come at least a little while after the commit), they click start and have an instance ready to use within a few seconds. If they had to wait for a full build that would be minutes, which disrupts the flow. The drawback is energy spending for builds that will never be started. Tradeoffs, as always.

BTW, I'm setting the good first issue label on this one as there is a test and it's just a matter of udpating the test and adjusting the SQL query.

sbidoul avatar Dec 04 '21 11:12 sbidoul