java -jar slave.jar -jnlpUrl http://127.0.0.1 -noreconnect true

986 views
Skip to first unread message

Martin, Eladio

unread,
Dec 8, 2011, 12:12:11 PM12/8/11
to jenkin...@googlegroups.com

Hello folks…

 

Problem I want to solve:

I want to be able to dynamically provision workers for my Jenkins on the fly.  

 

Solution/Workflow:

I have a plugin in Jenkins (will call it Jenkins Client to differentiate from other roles) that makes a call to another Jenkins called the Dispatcher.   The Dispatcher has the dedicated workers that will be passed back to the Jenkins Client.   How we do this is on the Dispatcher, is by executing a Job that runs the slave.jar with the jnlpurl pass in from the Jenkins Client. 

 

The Job on the Dispatcher looks like this:

-          Execute shell:

java -jar slave.jar -jnlpUrl $JnlpUrl

-          $JnlpUrl  is a Job parameter

 

The Jenkins Client then gets the worker and executes the Job.

 

The worker on the Jenkins Client is set to disconnect after a few minutes of idle time.

 

The Issue:

On the Dispatcher, the Job that gets executed, runs for ever.   I want the Dispatcher’s job to end.

 

In the logs of the Job I see:

INFO: Connected
Dec 8, 2011 8:46:39 AM hudson.remoting.jnlp.Main$CuiListener status
INFO: Terminated
Dec 8, 2011 8:46:49 AM hudson.remoting.jnlp.Main$CuiListener status
INFO: Locating server among [http://xxxxxxxxxxxx/builds]
Dec 8, 2011 8:46:49 AM hudson.remoting.jnlp.Main$CuiListener status
INFO: Connecting to xxx.xxx.xxx.xx:xxxx
Dec 8, 2011 8:46:49 AM hudson.remoting.jnlp.Main$CuiListener status
INFO: Handshaking
Dec 8, 2011 8:46:49 AM hudson.remoting.jnlp.Main$CuiListener status
INFO: Connected
Continues on forever…

 

On the Jenkins Client, the Job has completed, the worker has terminated by idling out but the Dispatcher keeps the Job going.

 

I would like the Dispatcher Job to end once it hits Terminated and not reconnect.

 

In the slave.jar, there is a –noreconnect option.

 

But I am not able to use it because it does not find that option.

 

Does anyone know how to call slave.jar with –noreconnect set to true?

 

C:\mywork\Development\mbuild_csc>java -jar slave.jar -jnlpUrl http://127.0.0.1 -noreconnect true

“-noreconnect” is not a valid option

java -jar slave.jar [options...]

-auth user:pass                : If your Hudson is security-enabeld, specify a

                                  valid user name and password.

-connectTo HOST:PORT           : make a TCP connection to the given host and

                                 port, then start communication.

-cp (-classpath) PATH          : add the given classpath elements to the

                                  system classloader.

-jnlpCredentials USER:PASSWORD : HTTP BASIC AUTH header to pass in for making

                                  HTTP requests.

-jnlpUrl URL                   : instead of talking to the master via

                                  stdin/stdout, emulate a JNLP client by making

                                  a TCP connection to the master. Connection

                                  parameters are obtained by parsing the JNLP

                                  file.

-tcp FILE                      : instead of talking to the master via

                                  stdin/stdout, listens to a random local port,

                                  write that port number to the given file,

                                  then wait for the master to connect to that

                                  port.

-text                          : encode communication with the master with

                                  base64. Useful for running slave over 8-bit

                                  unsafe protocol like telnet

 

I am using version 1.410 of Jenkins.

 

Any thoughts, really appreciate it.

 

Thanks.

 

Eladio

 


This message w/attachments (message) is intended solely for the use of the intended recipient(s) and may contain information that is privileged, confidential or proprietary. If you are not an intended recipient, please notify the sender, and then please delete and destroy all copies and attachments, and be advised that any review or dissemination of, or the taking of any action in reliance on, the information contained in or attached to this message is prohibited.
Unless specifically indicated, this message is not an offer to sell or a solicitation of any investment products or other financial product or service, an official confirmation of any transaction, or an official statement of Sender. Subject to applicable law, Sender may intercept, monitor, review and retain e-communications (EC) traveling through its networks/systems and may produce any such EC to regulators, law enforcement, in litigation and as required by law.
The laws of the country of each sender/recipient may impact the handling of EC, and EC may be archived, supervised and produced in countries other than the country in which you are located. This message cannot be guaranteed to be secure or free of errors or viruses.

References to "Sender" are references to any subsidiary of Bank of America Corporation. Securities and Insurance Products: * Are Not FDIC Insured * Are Not Bank Guaranteed * May Lose Value * Are Not a Bank Deposit * Are Not a Condition to Any Banking Service or Activity * Are Not Insured by Any Federal Government Agency. Attachments that are part of this EC may have additional important disclosures and disclaimers, which you should read. This message is subject to terms available at the following link:
http://www.bankofamerica.com/emaildisclaimer. By messaging with Sender you consent to the foregoing.

Martin, Eladio

unread,
Dec 13, 2011, 11:04:39 AM12/13/11
to jenkin...@googlegroups.com

Hello folks…

 

In my logs when I execute slave.jar over jnlp…  I see the following repeated:

 

Dec 13, 2011 8:58:10 AM hudson.remoting.jnlp.Main$CuiListener status

INFO: Connecting to x.y.z:n

Dec 13, 2011 8:58:10 AM hudson.remoting.jnlp.Main$CuiListener status

INFO: Handshaking

Dec 13, 2011 8:58:10 AM hudson.remoting.jnlp.Main$CuiListener status

INFO: Connected

Dec 13, 2011 8:58:10 AM hudson.remoting.jnlp.Main$CuiListener status

INFO: Terminated

 

 

Is there a way to have slave.jar just exit and not reconnect endlessly?

 

Thanks.

 

Eladio

 

 

Reply all
Reply to author
Forward
0 new messages