jenkinsci / nomad-plugin

Nomad cloud plugin for Jenkins
https://plugins.jenkins.io/nomad/
MIT License
56 stars 41 forks source link

slave.jar: "-headless" is not a valid option #35

Closed askoobe closed 5 years ago

askoobe commented 6 years ago

Tried to find somewhere with a solution but to no avail, sorry to ask here but I am stuck. I'd love to get this working, but when a slave starts up (Nomad Java driver) it fails because the -headless argument seems to be not available in newer version of slave.jar. Or am I missing something?

phedoreanu commented 5 years ago

You get different arguments depending on how the jar is invoked: diff

zakk4223 commented 5 years ago

The plugin includes the 'jar_file' parameter to the nomad job, which causes nomad to run it as java -jar slave.jar . The plugin also unconditionally includes '-headless' which does not work if you execute the jar file this way. In short, it appears the nomad java driver based slaves are non-functional right now, at least with latest jenkins LTS.

I think if you include "class" key that will fix it. I'll try to get a plugin build environment setup to test.

aphill70 commented 5 years ago

It looks like the MR to add support for the tunnel arg messed up the java driver. I will see if i can get a patch for it

aphill70 commented 5 years ago

I think the fix is in this change that once I finish testing will submit against the master branch. It looks like the Java Driver starts differently than the docker driver and the refactor fixing the docker driver added incompatible options to the java driver. https://github.com/aphill70/nomad-plugin/pull/4/files#diff-32076d9aefec62080e5dc98ab12872d0L89