Add an option to wait for custom startup script to finish before launching the agent#346
Add an option to wait for custom startup script to finish before launching the agent#346caseyduquettesc wants to merge 12 commits intojenkinsci:developfrom
Conversation
| // default value will be 0 until it finishes | ||
| "exit $(systemctl show google-startup-scripts --property ExecMainExitTimestampMonotonic | cut -d \"=\" -f 2)", | ||
| // not "initializing" or "starting" - benefit is doesn't require google-startup-scripts | ||
| // "[ \"$(systemctl is-system-running)\" != \"starting\" ]", |
There was a problem hiding this comment.
Do we think it's better to check that google-startup-scripts has finished or that systemctl is-system-running does not return "initializing" or "starting"? Those seem to be the two best ways on my ubuntu 18/20 machines, but curious what others think here.
There was a problem hiding this comment.
Hi @caseyduquettesc thank you. I think it's just fine to check google-startup-scripts has finished.
When can this be merged? I was hoping I could use it pretty soon.
There was a problem hiding this comment.
Will need a project maintainer to review. I'll try asking in the slack channel
72f47b5 to
a9137c6
Compare
|
Sorry for the direct ping, but @donmccasland or @alecharp do you know who would be best to review this? Thanks |
|
Is this a feature coming any time soon? We'd really love to have this feature as we currently hit a race condition where the pipeline starts building the agent before the startup script finishes logging in and breaks on first execution. |
|
This would be great. Our current workaround is to have the script stop sshd, then start it again at the end. Thank you! |
|
Any chance we could get codeowners to take a look at this PR? This feature would solve a lot of problems we're facing with setting up Jenkins on GCE |
Fixes #338
Adds a new option to the instance configuration that enables waiting to launch the agent until
google-startup-scriptshas finished running.Agent log - launcher checks startup status and it's already done
Agent log - launcher checks startup status and it's sleeping for 60s
Agent log - option disabled and launcher does not check startup status