Skip to content

Conversation

@jder
Copy link
Contributor

@jder jder commented Apr 7, 2025

We had some cases when machines were not shutting themselves down after running a job. When installdependencies.sh fails, this was previously skipping the cat <<-EOF > /etc/systemd/system/shutdown.sh line in the startup script, which caused the shutdown service to fail rather than deleting the instance.

This PR changes the behavior so that any failure in the startup script will instead cause the instance to get deleted. (It also adds set -e to the startup script to make debugging a bit easier, but happy to revert that piece if you like.)

@ravwojdyla
Copy link
Collaborator

👋 @jder looks great!! thank you

@ravwojdyla ravwojdyla merged commit b7ae6e7 into related-sciences:main Apr 8, 2025
1 check passed
echo ❌ Machine setup failed so deleting $VM_ID in ${machine_zone} ...
${shutdown_command}
}
trap shutdown EXIT
Copy link
Collaborator

Choose a reason for hiding this comment

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

@jder actually - wouldn't this run the shutdown as soon as the startup script finish - even if there was no problem?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@jder please see 1ec4146, let me know if that still works for you.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, sorry, I was too focused on testing the failure case :) This makes more sense. Thanks!

Copy link
Collaborator

Choose a reason for hiding this comment

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

@jder no problem, btw our CI

- run: echo "This runs on the GCE runner VM"
did not catch this because it's too quick (it's just an echo) - it was able to finish before the VM was shutdown.

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.

2 participants