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

Simplifying JNLPLauncher #8762

Merged
merged 9 commits into from
Dec 13, 2023
Merged

Simplifying JNLPLauncher #8762

merged 9 commits into from
Dec 13, 2023

Conversation

jglick
Copy link
Member

@jglick jglick commented Dec 7, 2023

#8639 (comment) cleaning up from jenkinsci/remoting#677. The situation is more complicated than that in #6543 because the deprecated properties will still be used if you use the deprecated -jnlpUrl mode.

Testing done

jenkinsci/configuration-as-code-plugin#2430 continues to pass against this change. Interactively:

Preferred config

inbound-config

Deprecated config

When reconfiguring an agent predating this change.
inbound-config-deprecated

Launcher page

inbound-main

Proposed changelog entries

  • Deprecating all configurable options in Launch agent by connecting it to the controller (inbound in JCasC), as these are only useful in conjunction with the deprecated -jnlpUrl mode.

Proposed upgrade guidelines

Reset all inbound launcher options to defaults, and follow new guidance for command-line options for agent.jar.

Before the changes are marked as ready-for-merge:

Maintainer checklist

Comment on lines -109 to -110
// which is already defined and deprecated. Could retroactively let no-arg constructor use default for workDirSettings,
// which would be a behavioral change only for callers of the Java constructor (unlikely).
Copy link
Member Author

Choose a reason for hiding this comment

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

Would only affect

  • Java callers
  • which use the no-arg ctor that had been deprecated for years
  • which use the now-deprecated -jnlpUrl mode
  • which even care about the location of the work dir

@@ -38,28 +38,6 @@ THE SOFTWARE.
<j:set var="copy_java_cmd_unix" value="java -jar agent.jar -url ${jenkinsURL} ${it.launcher.getRemotingOptionsUnix(it)}${it.launcher.getWorkDirOptions(it)}" />
<j:set var="copy_java_cmd_windows" value="java -jar agent.jar -url ${jenkinsURL} ${it.launcher.getRemotingOptionsWindows(it)}${it.launcher.getWorkDirOptions(it)}" />
<j:if test="${h.hasPermission(it, it.CONNECT)}">
<j:choose>
<j:when test="${it.ACL.hasPermission(app.ANONYMOUS, it.CONNECT)}">
Copy link
Member Author

Choose a reason for hiding this comment

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

This clause tried to omit the -secret when Jenkins is run without security, which did not actually work (perhaps as of jenkinsci/remoting#677, or perhaps due to changes in #8639). I do not see any compelling reason not to just always offer -secret.

powerShell.cli.curl=Note: PowerShell users must use curl.exe instead of curl because curl is a default PowerShell cmdlet alias for Invoke-WebRequest.
commonOptions=\
The most commonly used option is <code>-webSocket</code>. \
Copy link
Member Author

Choose a reason for hiding this comment

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

I doubt -tunnel and the various workdir-related options are relevant to enough people to be worth enumerating here.

Copy link
Member

@basil basil left a comment

Choose a reason for hiding this comment

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

Very nice!

@jglick jglick marked this pull request as draft December 8, 2023 14:55
Comment on lines +91 to +94
<p>
${%instance-identity-missing}
<l:isAdmin><a href="${rootURL}/manage/pluginManager/available">${%install-instance-identity}</a>.</l:isAdmin>
</p>
Copy link
Member Author

Choose a reason for hiding this comment

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

inbound-instance-identity

@@ -245,8 +245,7 @@ public ComputerLauncher getLauncher() {
LOGGER.log(Level.WARNING, "could not update historical agentCommand setting to CommandLauncher", x);
}
}
// Default launcher does not use Work Directory
Copy link
Member Author

Choose a reason for hiding this comment

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

Should only affect loading of ancient node definitions from disk, or I guess someone defining nodes via XML produced from template who for some reason declined to specify a launcher.

return FormValidation.error(Messages.JNLPLauncher_WebsocketNotEnabled());
}
if (Util.fixEmptyAndTrim(tunnel) != null) {
return FormValidation.error(Messages.JNLPLauncher_TunnelingNotSupported());
Copy link
Member Author

Choose a reason for hiding this comment

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

This and other improper combinations now handled by args4j in the launcher itself.

<l:isAdmin><a href="${rootURL}/manage/pluginManager/available">${%install-instance-identity}</a>.</l:isAdmin>
</p>
</j:if>
<j:if test="${!it.launcher.descriptor.webSocketSupported}">
Copy link
Member Author

Choose a reason for hiding this comment

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

(untested)

Comment on lines +85 to +88
<p>
${%tcp-port-disabled}
<l:isAdmin><a href="${rootURL}/manage/configureSecurity/">${%configure.link.text}</a>.</l:isAdmin>
</p>
Copy link
Member Author

Choose a reason for hiding this comment

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

Similar to older message, but not marked as an error since it may be perfectly normal in a WebSockets-only installation.

@@ -20,7 +20,6 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

slaveAgentPort.disabled=El puerto TCP para los agentes via JNLP está deshabilitado.
Copy link
Member Author

Choose a reason for hiding this comment

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

Renaming key and deleting old translations since there is now a significant extra clause about WebSockets.

@jglick jglick marked this pull request as ready for review December 8, 2023 18:05
@jglick
Copy link
Member Author

jglick commented Dec 8, 2023

OOME creating the WAR; probably unrelated?

@MarkEWaite
Copy link
Contributor

MarkEWaite commented Dec 8, 2023

OOME creating the WAR; probably unrelated?

Very likely unrelated. I've seem OOM errors on Java 21 environments for plugin builds in the last 1-2 weeks but have not investigated further to see if there is a root reason for the failures.

@NotMyFault NotMyFault added rfe For changelog: Minor enhancement. use `major-rfe` for changes to be highlighted developer Changes which impact plugin developers labels Dec 9, 2023
@NotMyFault
Copy link
Member

/label ready-for-merge


This PR is now ready for merge. We will merge it after ~24 hours if there is no negative feedback.
Please see the merge process documentation for more information about the merge process.
Thanks!

@comment-ops-bot comment-ops-bot bot added the ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback label Dec 12, 2023
@basil basil merged commit 6a2d94b into jenkinsci:master Dec 13, 2023
17 checks passed
@jglick jglick deleted the JNLPLauncher branch December 13, 2023 21:40
@akomakom
Copy link

akomakom commented Feb 7, 2024

FYI, I am seeing consistent NullPointerExceptions when using the docker plugin in JNLP mode, starting with Jenkins 2.437 (The first version with these changes). See jenkinsci/docker-plugin#1047 for details. jnlpLauncher is null in affected versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
developer Changes which impact plugin developers ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback rfe For changelog: Minor enhancement. use `major-rfe` for changes to be highlighted
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants