-
Notifications
You must be signed in to change notification settings - Fork 85
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
Allow way to check if instance is ready before starting agent #104
Comments
Thanks for submitting this! I like the idea of waiting for cloud-init. In the meantime, I've created #105 to restore the previous functionality. |
Thanks! A slight amendment to my initial research about cloud-init. I am actually using the |
* Refactor to perform launch preparation in common method * First check java version, then copy agent jar. * PR feedback: Remove tight coupling by using abstract method instead. * PR Feedback: Separate concerns for preparing java launch string. * Make launch methods nearly identical by factoring out connection setup logic. * Consolidate into one method on the ComputeEngineComputerLauncher. * PR Feedback: De-duplicate logging methods, various cleanup of duplication and unused code.
I've cut a release 3.3.0 that has #105 included. Please try it out and let us know how it goes. |
Closing this with the release of 3.3.0. Please feel free to re-open if the issue persists. |
After one year, I am here looking for the exact same feature. Creating a custom image with java just for Jenkins agent is an overkill. So I ended up using the hack mentioned by @andyshinn by adding Please reopen this issue. |
I am doing some post-boot stuff with cloud-init and startup scripts to prepare my instance for Jenkins (mounting NVMe disks and post-boot Ansible playbook). I'm actually wanting to store Jenkins workspace data on the NVMe SSD for performance reasons which means I need to wait for this to complete before the plugin can copy and start the
agent.jar
.In 3.0.0 I was able to hack around this by creating a custom
/usr/local/bin/java
script that was picked up when the instance installer first checked output ofjava -version
. The wrapper script would artificially hang until the Ansible playbook had completed (to Jenkins it just appears that the command returns very slowly).This issue is a feature request to have a way to wait for the instance to be ready via external method. The simple fix to enable the hack again is to just move the
java -version
check before theagent.jar
copy. But I actually think longer term it might make sense to add a check for the cloud-init Final stage usingcloud-init status --wait
or the/var/lib/cloud/instance/boot-finished
file. This would likely account for my scenario and others where people bootstrap instances using cloud-init where there might be stuff required before the agent can actually run jobs.The text was updated successfully, but these errors were encountered: