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

Why is there a slave_windows_java_opts but no slave_linux_java_opts ? #38

Open
timblaktu opened this issue Sep 23, 2020 · 0 comments
Open

Comments

@timblaktu
Copy link

SUMMARY

Why is there a slave_windows_java_opts but no slave_linux_java_opts? Since your role seems to have no way to define agent java options, I am using another method and am looking for your feedback.

I am using your role to provision 2 ssh linux agents associated with a master that is also provisioned with the same ansible project/site.yml. The master configuration is managed by a custom playbook that installs the configuration-as-code plugin. In the CasC yaml, I define the agents as follows:

  - permanent:
      name: "jenkins-testing-agent-1"
      nodeDescription: "Fungible Agent for jenkins-testing"
      labelString: ""
      # Allow to run arbitrary jobs not matching label patterns
      mode: "NORMAL"
      remoteFS: "/home/jenkins/.jenkins"
      launcher:
        # see here for details on these settings: https://github.com/jenkinsci/ssh-slaves-plugin/blob/master/doc/CONFIGURE.md
        ssh:
          credentialsId: "jenkins_user_on_linux_agent"
          host: "jenkins-testing-agent-1"
          jvmOptions: "-Dhudson.slaves.WorkspaceList=- -Dorg.apache.commons.jelly.tags.fmt.timeZone=America/Vancouver -Xmx64g -Xms64g -XX:+AlwaysPreTouch -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/home/jenkins/.jenkins/support -XX:+UseG1GC -XX:+UseStringDeduplication -XX:+ParallelRefProcEnabled -XX:+DisableExplicitGC -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -verbose:gc -Xlog:gc:/home/jenkins/.jenkins/support/gc-%t.log -XX:+PrintGC -XX:+PrintGCDetails -XX:ErrorFile=/hs_err_%p.log -XX:+LogVMOutput -XX:LogFile=/home/jenkins/.jenkins/support/jvm.log"
          # These settings are just for the initial ssh connection
          launchTimeoutSeconds: 30
          maxNumRetries: 20
          port: 22
          retryWaitTime: 10
          sshHostKeyVerificationStrategy: "nonVerifyingKeyVerificationStrategy"

however, when these agents are launched, the agents' log still shows empty jvmOptions in the ssh launcher call. Agent Log excerpt:

SSHLauncher{host='jenkins-testing-agent-1', port=22, credentialsId='jenkins_user_on_linux_agent', **jvmOptions=''**, javaPath='', prefixStartSlaveCmd='', suffixStartSlaveCmd='', launchTimeoutSeconds=30, maxNumRetries=20, retryWaitTime=10, sshHostKeyVerificationStrategy=hudson.plugins.sshslaves.verifiers.NonVerifyingKeyVerificationStrategy, tcpNoDelay=true, trackCredentials=true} 
[09/22/20 15:56:12] [SSH] Opening SSH connection to jenkins-testing-agent-1:22. 
[09/22/20 15:56:16] [SSH] WARNING: SSH Host Keys are not being verified. Man-in-the-middle attacks may be possible against this connection. 
[09/22/20 15:56:16] [SSH] Authentication successful. 
[09/22/20 15:56:16] [SSH] The remote user's environment is: BASH=/usr/bin/bash
.
.
.
[SSH] java -version returned 11.0.8. 
[09/22/20 15:56:16] [SSH] Starting sftp client. 
[09/22/20 15:56:16] [SSH] Copying latest remoting.jar... Source agent hash is 0146753DA5ED62106734D59722B1FA2C. Installed agent hash is 0146753DA5ED62106734D59722B1FA2C Verified agent jar. No update is necessary. Expanded the channel window size to 4MB 
[09/22/20 15:56:16] [SSH] Starting agent process: cd "/home/jenkins/.jenkins" && java -jar remoting.jar -workDir /home/jenkins/.jenkins -jar-cache /home/jenkins/.jenkins/remoting/jarCache Sep 22, 2020 3:56:17 PM org.jenkinsci.remoting.engine.WorkDirManager initializeWorkDir INFO: Using /home/jenkins/.jenkins/remoting as a remoting work directory Sep 22, 2020 3:56:17 PM org.jenkinsci.remoting.engine.WorkDirManager setupLogging INFO: Both error and output logs will be printed to /home/jenkins/.jenkins/remoting <===[JENKINS REMOTING CAPACITY]===>channel started Remoting version: 4.2 This is a Unix agent WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by jenkins.slaves.StandardOutputSwapper$ChannelSwapper to constructor java.io.FileDescriptor(int) WARNING: Please consider reporting this to the maintainers of jenkins.slaves.StandardOutputSwapper$ChannelSwapper WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release Evacuated stdout Agent successfully connected and online

Let me know if you have any ideas why my agents aren't using the specified jvm options. I'm perplexed. My agent logs are zero length as well.

ISSUE TYPE
  • Documentation Report
ANSIBLE VERSION
ansible 2.9.10
  config file = None
  configured module search path = ['/home/tblack/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/tblack/.local/lib/python3.8/site-packages/ansible
  executable location = /home/tblack/.local/bin/ansible
  python version = 3.8.3 (default, Jun 30 2020, 11:18:52) [GCC 6.3.0 20170516]
OS / ENVIRONMENT

Controller = Debian Stretch
Controlled = Debian Buster

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

No branches or pull requests

1 participant