-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add --noReconnectAfter 1d
option when available in the agent image.
#1553
Conversation
Add system properties based switches to use the new mechanism To enable usage of REMOTING_OPTS -Dorg.csanchez.jenkins.plugins.kubernetes.PodTemplateBuilder.useRemotingOpts=true Enabling it requires all pod templates to use a version of agent with jenkinsci/docker-agent#809 in. Add extra REMOTING options -Dorg.csanchez.jenkins.plugins.kubernetes.PodTemplateBuilder.extraRemotingOpts="-noReconnectAfter 10m" Used this approach because there are migration challenges: * The remoting version must be recent enough to support REMOTING_OPTS * When overriding the JNLP container, the configuration form is generic, and part of REMOTING_OPTS is generated based on options defined in the cloud, so can't expose either an "extra remoting options" field, not use the `REMOTING_OPTS` environment variable.
REMOTING_OPTS
to remoting agent.
You could just continue to use the existing (now deprecated) variables for existing purposes, and allow the new variable to be set for new purposes such as |
Actually I expected |
Can be tuned via org.csanchez.jenkins.plugins.kubernetes.PodTemplateBuilder.noReconnectAfter using the same syntax as what remoting.jar -noReconnectAfter takes. If the remoting version is too old, this parameter is ignored
🤔
or just a new text field in |
* Bump built-in remoting to the version coming with REMOTING_OPTS
REMOTING_OPTS
to remoting agent.--noReconnectAfter
option when available in the agent image.
--noReconnectAfter
option when available in the agent image.--noReconnectAfter 1d
option when available in the agent image.
Simplified the patch accordingly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks nice and simple.
jenkinsci/docker-agent#809 added support for
REMOTING_OPTS
in order to pass custom remoting options to the agent.This makes use of the new option to pass
--noReconnectAfter 1d
, allowing the agent to bail out after 1 day of not being able to contact the controller.This can be tweaked using
-Dorg.csanchez.jenkins.plugins.kubernetes.PodTemplateBuilder.noReconnectAfter=30d
using the syntax allowed by the agent per jenkinsci/remoting#738Tested using
mvn hpi:run -Dorg.csanchez.jenkins.plugins.kubernetes.PodTemplateBuilder.noReconnectAfter=1m
, launching a kubernetes agent, then turning off the controller. The agent bails out after 1 minute in that case.Testing done
Submitter checklist