Re: Running a shell command on multiple/all slaves from script console

2013-12-16 Thread Omer Weissman
I was considering using the matix job, but it has a major flaw, it will be 
queued with the regular builds...we have one executor per slave and some of 
the jobs run for a long time ~30 minutes, so on part of the slaves it will 
wait for a long time in the queue.
I'm ok with t processing one by one from the script console, i'm just 
failing to do so :S
if I could only add an executor in the beginning of the build and remove it 
afterwards...

any ideas about the script ?

On Sunday, December 15, 2013 6:18:57 PM UTC+2, LesMikesell wrote:

 On Sun, Dec 15, 2013 at 6:05 AM, Omer Weissman 
 weis...@gmail.comjavascript: 
 wrote: 
  
  Thanks for the idea, I didn't try dsh, and I was not familiar with it. 
  But I still want to accomplish this through Jenkins Console, as dsh 
 requires me to be in the same LAN or use VPN, and I want to be able to do 
 it through the interface. 
  
  any ideas ? 

 I think the script console can only connect to one node at a time. 
 You could put you command in a matrix (multi-configuration) job and 
 select all the nodes, though. 

 -- 
   Les Mikesell 
 lesmi...@gmail.com javascript: 


-- 
You received this message because you are subscribed to the Google Groups 
Jenkins Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Running a shell command on multiple/all slaves from script console

2013-12-16 Thread Les Mikesell
On Mon, Dec 16, 2013 at 9:24 AM, Omer Weissman weiss...@gmail.com wrote:
 I was considering using the matix job, but it has a major flaw, it will be
 queued with the regular builds...we have one executor per slave and some of
 the jobs run for a long time ~30 minutes, so on part of the slaves it will
 wait for a long time in the queue.
 I'm ok with t processing one by one from the script console, i'm just
 failing to do so :S
 if I could only add an executor in the beginning of the build and remove it
 afterwards...

You can run more than one slave agent on a machine - which lets you
give them different node names and labels to control what they
execute.

 any ideas about the script ?

The script console runs groovy, which gives an execute() method to
quoted strings.   Have you tried something like:
println your_command.execute().text
in the script console?   If the target is windows you may have to keep
in mind that some of the things you think are commands are build into
the cmd program.

-- 
   Les Mikesell
  lesmikes...@gmail.com

-- 
You received this message because you are subscribed to the Google Groups 
Jenkins Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Running a shell command on multiple/all slaves from script console

2013-12-16 Thread Omer Weissman
I have 17 slaves and soon will have more, so adding another maintenance 
agent per machine is a huge overhead...

I'm aware of the execute().text
as I understand, from the manage console it will only run on the master.
please see my original post for the loop trying to accomplish this.

many thanks 

On Monday, December 16, 2013 6:10:26 PM UTC+2, LesMikesell wrote:

 On Mon, Dec 16, 2013 at 9:24 AM, Omer Weissman 
 weis...@gmail.comjavascript: 
 wrote: 
  I was considering using the matix job, but it has a major flaw, it will 
 be 
  queued with the regular builds...we have one executor per slave and some 
 of 
  the jobs run for a long time ~30 minutes, so on part of the slaves it 
 will 
  wait for a long time in the queue. 
  I'm ok with t processing one by one from the script console, i'm just 
  failing to do so :S 
  if I could only add an executor in the beginning of the build and remove 
 it 
  afterwards... 

 You can run more than one slave agent on a machine - which lets you 
 give them different node names and labels to control what they 
 execute. 

  any ideas about the script ? 

 The script console runs groovy, which gives an execute() method to 
 quoted strings.   Have you tried something like: 
 println your_command.execute().text 
 in the script console?   If the target is windows you may have to keep 
 in mind that some of the things you think are commands are build into 
 the cmd program. 

 -- 
Les Mikesell 
   lesmi...@gmail.com javascript: 


-- 
You received this message because you are subscribed to the Google Groups 
Jenkins Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Running a shell command on multiple/all slaves from script console

2013-12-16 Thread Les Mikesell
On Mon, Dec 16, 2013 at 10:23 AM, Omer Weissman weiss...@gmail.com wrote:
 I have 17 slaves and soon will have more, so adding another maintenance
 agent per machine is a huge overhead...

I don't find adding nodes to be difficult, especially if you start
them with ssh.  Just add by copying an existing one and change the ssh
credentials.  But it would add a lot of clutter on the jenkins web
page.

 I'm aware of the execute().text
 as I understand, from the manage console it will only run on the master.
 please see my original post for the loop trying to accomplish this.

I have a 'script console' link on every node page.  If you don't have
that, maybe it comes with installing the groovy plugin.Commands
run there will run on the node. But, I don't know how to make a single
command iterate over the nodes - that is probably possible somewhere
in the API, though.

You could, of course run a script on the master that uses ssh (with
keys configured for passwordless access) to run the commands remotely
on the slaves without very much jenkins involvement.   That would be a
more natural approach for me since I use ssh much more than java or
groovy.

-- 
   Les Mikesell
  lesmikes...@gmail.com

-- 
You received this message because you are subscribed to the Google Groups 
Jenkins Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Running a shell command on multiple/all slaves from script console

2013-12-15 Thread Omer Weissman
Hi,

Thanks for the idea, I didn't try dsh, and I was not familiar with it.
But I still want to accomplish this through Jenkins Console, as dsh 
requires me to be in the same LAN or use VPN, and I want to be able to do 
it through the interface.

any ideas ?

Thanks,
Omer 



On Thursday, December 12, 2013 11:38:54 AM UTC+2, Dirk Heinrichs wrote:

  Am 12.12.2013 10:33, schrieb Omer Weissman:

  I want to execute an administrative shell script on all slaves using the 
 script console in Jenkins manage. 


 Did you try the Debian distributed shell (dsh)?

 HTH...

 Dirk
 -- 

 *Dirk Heinrichs*, Senior Systems Engineer, Engineering Solutions
 *Recommind GmbH*, Von-Liebig-Straße 1, 53359 Rheinbach
 *Tel*: +49 2226 159 (Ansage) 1149
 *Email*: d...@recommind.com javascript:
 *Skype*: dirk.heinrichs.recommind
 www.recommind.com
  

-- 
You received this message because you are subscribed to the Google Groups 
Jenkins Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Running a shell command on multiple/all slaves from script console

2013-12-15 Thread Les Mikesell
On Sun, Dec 15, 2013 at 6:05 AM, Omer Weissman weiss...@gmail.com wrote:

 Thanks for the idea, I didn't try dsh, and I was not familiar with it.
 But I still want to accomplish this through Jenkins Console, as dsh requires 
 me to be in the same LAN or use VPN, and I want to be able to do it through 
 the interface.

 any ideas ?

I think the script console can only connect to one node at a time.
You could put you command in a matrix (multi-configuration) job and
select all the nodes, though.

-- 
  Les Mikesell
lesmikes...@gmail.com

-- 
You received this message because you are subscribed to the Google Groups 
Jenkins Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Running a shell command on multiple/all slaves from script console

2013-12-12 Thread Dirk Heinrichs
Am 12.12.2013 10:33, schrieb Omer Weissman:

 I want to execute an administrative shell script on all slaves using
 the script console in Jenkins manage. 

Did you try the Debian distributed shell (dsh)?

HTH...

Dirk
-- 

*Dirk Heinrichs*, Senior Systems Engineer, Engineering Solutions
*Recommind GmbH*, Von-Liebig-Straße 1, 53359 Rheinbach
*Tel*: +49 2226 159 (Ansage) 1149
*Email*: d...@recommind.com mailto:d...@recommind.com
*Skype*: dirk.heinrichs.recommind
www.recommind.com http://www.recommind.com



http://www.recommind.com

-- 
You received this message because you are subscribed to the Google Groups 
Jenkins Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
inline: Logo.gif