Jenkins master and slave workspace directory

19,182 views
Skip to first unread message

Aswini Rajasekaran

unread,
Apr 25, 2013, 8:04:09 AM4/25/13
to jenkins...@googlegroups.com
Hi all,

I have a small question, this might sound silly but I am not able to find the answer for this.

In my jenkins master node, the workspace directory is defined as <jenkinsroot>/jobs/<jobname>/workspace - this is configured as ${ITEM_ROOTDIR}/workspace in jenkins master.
whereas in slave, the workspace directory gets stored like this  <jenkinsroot>/jobs/workspace/<jobname>

I want both the workspace directory, in master and slave to be consistent. Is there anything that I can do to make this happen?
Thanks in advance.

Regards,
Aswini

Adam PAPAI

unread,
Apr 26, 2013, 4:22:58 AM4/26/13
to jenkins...@googlegroups.com
What is the reason why do you want it to be the same?

Anyway on the master you shouldn't run tests. Only on the slaves.

The reason is:

on the master under the <jenkinsroot>jobs/jobname there are the meta infos, build history, config.xml and so on, so the "realy" workspace is under the <jobname>/workspace

On the slaves, Jenkins does not store meta info, build history, configs, so that's why its located under: <jenkinsroot>/jobs/workspace/<jobname>

April 25, 2013 2:04 PM
--
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-use...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
Adam PAPAI
E-mail: wo...@wooh.hu
Phone: +3630 3355735
Web: http://www.wooh.hu

Aswini Rajasekaran

unread,
Apr 26, 2013, 4:27:50 AM4/26/13
to jenkins...@googlegroups.com, wo...@wooh.hu
Hi Adam,

I am running tests on both master and slaves and am specifying the test location directory in user-extensions.js file in selenium. As the workspaces are different in master and slave, I can't run the same job in both master and slave depending on the load on master. If I can't make this to run on any node, then I have to end up tying it to one node which completely nullifies the parallel execution concept.

Regards,
Aswini

Adam PAPAI

unread,
Apr 26, 2013, 4:29:33 AM4/26/13
to jenkins...@googlegroups.com
Why don't you use the $WORKSPACE variable? It always points to the directory where your source code is - or in other words where your job is located.

April 26, 2013 10:27 AM
Hi Adam,

I am running tests on both master and slaves and am specifying the test location directory in user-extensions.js file in selenium. As the workspaces are different in master and slave, I can't run the same job in both master and slave depending on the load on master. If I can't make this to run on any node, then I have to end up tying it to one node which completely nullifies the parallel execution concept.

Regards,
Aswini



On Friday, 26 April 2013 09:22:58 UTC+1, Adam PAPAI wrote: --
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-use...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
April 26, 2013 10:22 AM
What is the reason why do you want it to be the same?

Anyway on the master you shouldn't run tests. Only on the slaves.

The reason is:

on the master under the <jenkinsroot>jobs/jobname there are the meta infos, build history, config.xml and so on, so the "realy" workspace is under the <jobname>/workspace

On the slaves, Jenkins does not store meta info, build history, configs, so that's why its located under: <jenkinsroot>/jobs/workspace/<jobname>


--
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-use...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
April 25, 2013 2:04 PM
Hi all,

I have a small question, this might sound silly but I am not able to find the answer for this.

In my jenkins master node, the workspace directory is defined as <jenkinsroot>/jobs/<jobname>/workspace - this is configured as ${ITEM_ROOTDIR}/workspace in jenkins master.
whereas in slave, the workspace directory gets stored like this  <jenkinsroot>/jobs/workspace/<jobname>

I want both the workspace directory, in master and slave to be consistent. Is there anything that I can do to make this happen?
Thanks in advance.

Regards,
Aswini
--
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-use...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Aswini Rajasekaran

unread,
Apr 26, 2013, 4:31:21 AM4/26/13
to jenkins...@googlegroups.com, wo...@wooh.hu
Yes, I am using that in all of my other configuration files for build. But when it comes to javascript, user-extensions.js file in selenium is javascript, I don't have any way of accessing a env variable in java script.

Aswini

Geoff Cummings

unread,
Apr 26, 2013, 6:07:34 AM4/26/13
to jenkins...@googlegroups.com


Manage Jenkins -->  Configure System

At the top right of the page, there is an advanced button which gives more options just below the "Home Directory" and above the "System Message"

Update the Workspace Root Directory field to the following:    

${JENKINS_HOME}/workspace/${ITEM_FULLNAME}


Not sure if you need to restart jenkins to pick this up or not??

This will update the workspaces on Master to be the same folder layout as the slaves.


Geoff

Aswini Rajasekaran

unread,
Apr 26, 2013, 6:44:00 AM4/26/13
to jenkins...@googlegroups.com
This works.. Thanks a lot Geoff.

Regards,
Aswini

Geoff Cummings

unread,
Apr 26, 2013, 8:07:30 AM4/26/13
to jenkins...@googlegroups.com
Good :)

I think it's good to keep workspace separate from build config and history.
--

Les Mikesell

unread,
Apr 26, 2013, 8:56:51 AM4/26/13
to jenkinsci-users
On Fri, Apr 26, 2013 at 5:44 AM, Aswini Rajasekaran
<aswini.ra...@gmail.com> wrote:
> This works.. Thanks a lot Geoff.

Alternatively, you can run a slave on your master machine and no
executors on the master itself.

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

Aswini Rajasekaran

unread,
Apr 26, 2013, 9:17:55 AM4/26/13
to jenkins...@googlegroups.com
Hi Les,

This seems to be a very good idea. But will the performance of the server increase/decrease if we make the master node to run as a slave node also and work as master at the same time?

Regards,
Aswini

Les Mikesell

unread,
Apr 26, 2013, 10:37:30 AM4/26/13
to jenkinsci-users
On Fri, Apr 26, 2013 at 8:17 AM, Aswini Rajasekaran
<aswini.ra...@gmail.com> wrote:
> Hi Les,
>
> This seems to be a very good idea. But will the performance of the server
> increase/decrease if we make the master node to run as a slave node also and
> work as master at the same time?

There is probably a tiny amount of overhead in communication between a
master and slave process, but I wouldn't expect it to be noticeable.
On the other hand you might see some competition for disk access if
the builds and jenkins master files are on the same physical device -
whether or not it is handled by the same process.

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

Aswini Rajasekaran

unread,
Apr 26, 2013, 10:41:42 AM4/26/13
to jenkins...@googlegroups.com
Hi Les,
I don't run my master as slave right now and use 3 executors on master. But at times, it is heavily loaded and the CPU usage of the master goes to 250% or so.
If I run the master as slave, will this overloading reduce on master?

Aswini

Les Mikesell

unread,
Apr 26, 2013, 10:59:37 AM4/26/13
to jenkinsci-users
On Fri, Apr 26, 2013 at 9:41 AM, Aswini Rajasekaran
<aswini.ra...@gmail.com> wrote:
> Hi Les,
> I don't run my master as slave right now and use 3 executors on master. But
> at times, it is heavily loaded and the CPU usage of the master goes to 250%
> or so.
> If I run the master as slave, will this overloading reduce on master?

First, the CPU use is probably not from jenkins itself but from
whatever programs the build jobs invoke, so it won't make much
difference whether they are run by a master or slave instance.
Second, a value of 250% for CPU doesn't make sense unless it is scaled
to 100% per CPU - in which case it may or may not be a problem
depending on how many CPUs you have. If you are concerned about
wall-clock time to complete a job, you need to look at the competition
for CPU/RAM/disk across the concurrent jobs to choose the optimal
number of executors - and disk contention would be a more common
bottleneck than CPU. If you are running CPU or network intensive
tests and want to emulate a production environment, then you would
want to match the concurrency you expect there, or run a single
instance for consistent timing values.

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

Aswini Rajasekaran

unread,
Apr 26, 2013, 11:11:13 AM4/26/13
to jenkins...@googlegroups.com
Hi,

Yes, the CPU usage of the process which runs hudson.war scales to 250+%.
It doesn't run hudson.war alone, but it also runs the Maven, ANT, jboss and other tasks required by the jobs. And sometimes because of the intensity of the jobs or so, it goes out of PermGenSpace and I have to restart jenkins for resolving that. I run jenkins on a 32 bit server in Red Hat Linux.
Can you tell me the good MAVEN_OPTS configuration settings? I think MAVEN runs out of memory when it does something with very high intensity and things break loose.
I am not able to get the optimum MAVEN settings for Jenkins.

Regards,
Aswini

Les Mikesell

unread,
Apr 26, 2013, 12:18:27 PM4/26/13
to jenkinsci-users
On Fri, Apr 26, 2013 at 10:11 AM, Aswini Rajasekaran
<aswini.ra...@gmail.com> wrote:
>
> Yes, the CPU usage of the process which runs hudson.war scales to 250+%.

Again, that only makes sense in the context of how many CPU's you have
- and whether they are real cores or hyperthreads that get counted as
CPUs. If you have 8 cores, 250% isn't all that busy.

> It doesn't run hudson.war alone, but it also runs the Maven, ANT, jboss and
> other tasks required by the jobs. And sometimes because of the intensity of
> the jobs or so, it goes out of PermGenSpace and I have to restart jenkins
> for resolving that. I run jenkins on a 32 bit server in Red Hat Linux.

That's something entirely different. You are short of RAM - and you
may be burning a lot of CPU in java garbage collection to deal with
it. Your real problem is that a 32 bit system will have a 2 GB
address space restriction even if the machine has more available.

> Can you tell me the good MAVEN_OPTS configuration settings? I think MAVEN
> runs out of memory when it does something with very high intensity and
> things break loose.
> I am not able to get the optimum MAVEN settings for Jenkins.

That's a battle I might have tried to fight in some other century, but
now the right answer is lots of RAM and a 64-bit OS and JVM.

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

kannikanti madhukumar

unread,
Nov 10, 2014, 9:29:50 AM11/10/14
to jenkins...@googlegroups.com
Hi Geoff,

My one hour search for changing workspace issue ended after seeing your post.

Really nice post.

Thanks,
madhu

Viktor Józsa

unread,
May 4, 2015, 4:51:36 AM5/4/15
to jenkins...@googlegroups.com, wo...@wooh.hu
Hi,

I'm testing Jenkins on Master-Slave configuration, but I didn't configure slave workspace directory. I set FS root on the slave, but Jenkins added "workspace" word to the path.
Example:
FSRoot: D:\JK
output: Building remotely on jenkins-win-fin in workspace d:\JK\workspace\Main-Win-FIN

This path is too long for my project, so I would like to use shorter path.

Thanks in advanced.

Viktor Józsa
Message has been deleted
Message has been deleted

Shriya Chhajed

unread,
Feb 23, 2017, 1:16:47 AM2/23/17
to Jenkins Users
Hi, 

I am facing an issue for setting the Sonar_Runner_Path. Sonar scanner is installed on my local desktop where as i am trying to integrate it on jenkins. so what path shall i put there. by putting the local path it is showing a warning and thus the build is failed. Please revert 

Thank you
Reply all
Reply to author
Forward
0 new messages