Skip to content

fix: Remove Orphan AWS runners #79

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

Merged
merged 2 commits into from
Jul 21, 2020

Conversation

npalm
Copy link
Member

@npalm npalm commented Jul 20, 2020

Remove potential orphan AWS instances

Closes #35

@npalm npalm requested a review from gertjanmaas July 20, 2020 13:07
@@ -74,9 +74,11 @@ export async function scaleDown(): Promise<void> {
repo: repo.repoName,
});

let orphanEc2Runner = true;
for (const ghRunner of registered.data.runners) {
const runnerName = ghRunner.name as string;
if (runnerName === ec2runner.instanceId && runnerMinimumTimeExceeded(ec2runner, minimumRunningTimeInMinutes)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Split up this if statement to determine if a EC2 instance is orphaned. Then only try to delete if the runnerMinimumTimeExceeded function returns true

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gertjanmaas created a fix

@gertjanmaas gertjanmaas merged commit 43e66c9 into develop Jul 21, 2020
@gertjanmaas gertjanmaas deleted the feature/ensure-remove-orphan-aws-runners branch July 21, 2020 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

If termination of EC2 instance fails, it is never cleaned up
2 participants