Skip to content
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

Introduce REMOTING_OPTS to pass arbitrary options to remoting on startup via an environment variable #809

Merged
merged 2 commits into from
May 17, 2024

Conversation

Vlatombe
Copy link
Member

@Vlatombe Vlatombe commented May 15, 2024

#802 (comment)

This deprecates existing environment variables allowing to set options to agent.jar. Going forward, this will ease addition or removal of options to agent.jar without impacting these launcher scripts.

Testing done

Submitter checklist

Preview Give feedback

@Vlatombe Vlatombe changed the title Introduce REMOTING_OPTS to pass arbitrary options to remoting on startup via an environment variable Introduce REMOTING_OPTS to pass arbitrary options to remoting on startup via an environment variable May 15, 2024
Copy link
Member

@jglick jglick left a comment

Choose a reason for hiding this comment

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

Should be decided what to do when both systems (command-line options, specific environment variables) are used and fail-fast accordingly.

I do not think we need to make it unnecessarily complicated; there is already too much code that tries to be clever this way, but Launcher itself should detect inappropriate option combinations and produce appropriate error messages.

I would suggest moving the new option to the top of the description, and noting that it supersedes all prior options except for JAVA_BIN and JAVA_OPTIONS and that use of those is now deprecated.

@Vlatombe Vlatombe marked this pull request as ready for review May 15, 2024 13:07
@Vlatombe Vlatombe requested a review from a team as a code owner May 15, 2024 13:07
Vlatombe added a commit to Vlatombe/kubernetes-plugin that referenced this pull request May 16, 2024
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.
@jglick
Copy link
Member

jglick commented May 16, 2024

@lemeurherve ?

@lemeurherve lemeurherve merged commit 5c3469a into jenkinsci:master May 17, 2024
10 checks passed
@Vlatombe Vlatombe deleted the remoting-opts branch May 17, 2024 07:24
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.

4 participants