Mercurial automatic installer on slave node

1,155 views
Skip to first unread message

Gili

unread,
Aug 30, 2012, 10:34:20 AM8/30/12
to jenkins...@googlegroups.com
Hi,

I've configured a master node on Windows and a slave node on OSX 10.7. I
configured automatic tool installation on the master (including for
Mercurial) and created a task that runs exclusively on the OSX node. When I
first the task it fails because Mercurial is not installed. It seems Jenkins
never attempts to install it.

I'm new to clustering. How am I supposed to configure this? Am I doing
something wrong or is this simply not supported? I am using Jenkins 1.478.

PS: I cross-posted this question to
http://stackoverflow.com/questions/12185230/jenkins-how-to-configure-mercurial-installer

Thanks,
Gili

Chuck Doucette

unread,
Aug 30, 2012, 10:52:52 AM8/30/12
to jenkins...@googlegroups.com
I believe you must manually install both Java (if you haven't already) and Mercurial on the OSX node.
It would be nice if Jenkins or more specifically its Mercurial plugin also installed Mercurial automatically.

Chuck

gili.tzabari

unread,
Aug 30, 2012, 10:56:54 AM8/30/12
to jenkins...@googlegroups.com
Chuck,

Are you sure? Looking at
https://wiki.jenkins-ci.org/display/JENKINS/Tool+Auto-Installation it
says "Mercurial available as of 1.18". I thought this means that
Mercurial supports auto-installation.

We really need someone to put up some sort of grid of operating
systems and supported auto-installers. Also, note that in the past the
JDK auto-installer didn't support OSX because Oracle JDK wasn't
available. Today it is. Is anyone updating the JDK installer for OSX?

Thanks,
Gili

Chuck Doucette

unread,
Aug 30, 2012, 11:10:30 AM8/30/12
to jenkins...@googlegroups.com
I don't know what is supposed to happen, I just know that I recently configured a Jenkins slave node on OSX and it didn't work until I manually
installed both Java and Mercurial. Indeed, it would be nice if both happened automatically (Jenkins install Java and the Mercurial plugin install Mercurial). I wasn't aware of this page that you referenced or exactly what that implies. I read that page as saying that more tools, specifically auto-installation of SCMs, is needed (e.g. Mercurial). Why it specifically says: "Mercurial available as of 1.18" is indeed confusing (since it implies it is already supported, but is listed under missing tools).

Chuck

gili.tzabari

unread,
Aug 30, 2012, 11:16:53 AM8/30/12
to jenkins...@googlegroups.com
Hi again,

So I installed Mercurial manually but now I get:

Building remotely on MacOS X 10.7 in workspace <workspace>
JDK installation skipped: Unknown CPU name: mac os x
$ hg clone --rev default --noupdate <repository> <workspace>
ERROR: Failed to clone <repository> because hg could not be found; check that you've properly configured your Mercurial installation
ERROR: Failed to clone <repository>


Thing is, if I manually ssh into OSX from Windows I can execute
"hg" just fine. Same thing in a local terminal on the Mac. Any ideas how
to troubleshoot this further?

Thanks,
Gili

Chuck Doucette

unread,
Aug 30, 2012, 11:43:59 AM8/30/12
to jenkins...@googlegroups.com
You ran into the same problem that I did.
I assume Mercurial (hg) was installed in /usr/local/bin.
I also assume that the user you have set up to run Jenkins has /usr/local/bin in its path.
Thus, you should reasonably expect for the Mercurial plugin to find hg in the path.
Since it does not, I believe that is a bug.
Perhaps you would report that for both of us?

In the meantime, let me tell you about the workaround that is working for me.

Go onto the Jenkins configuration page (Manage Jenkins, Configure System),
Scroll down to the section for the Mercurial plugin.
Click on the button that says Mercurial installations.
Define an installation something like this:

Name: osx
Installation directory: /usr/local
Executable: INSTALLATION/bin/hg

Then, whatever project you have that depends on Mercurial on OSX, change that Mercurial installation for that project and choose the osx (or whatever you called it) installation, rather than default.

Let us know if this resolves your problems.

gili.tzabari

unread,
Aug 30, 2012, 12:13:30 PM8/30/12
to jenkins...@googlegroups.com
Hi Chuck,

    Good catch! But I think I might be having a different problem. I followed your advice but now I get:

$ /usr/local/bin/hg clone --noupdate <repository> C:\Users\Gili\.jenkins\hgcache\FD91D6ED4EFC637D1A4D0A8F0B8E1D0DB4D1A237-vtlr
ERROR: Failed to use repository cache for <repository> java.io.IOException: Cannot run program "/usr/local/bin/hg": CreateProcess error=2, The system cannot find the file specified

    ... which is clearly nonsense since I can invoke that same command-line myself and it works. Any other ideas? Is it perhaps some sort of permission problem?

PS: My repository requires authentication which I haven't configured yet so I *know* it'll fail once it reaches that point, but thus it seems it hasn't even found "hg" yet so I don't think it's related.

PS2: I filed https://issues.jenkins-ci.org/browse/JENKINS-14996 for the issue you reported.

Gili

Gili

unread,
Aug 30, 2012, 4:20:48 PM8/30/12
to jenkins...@googlegroups.com
Hi Chuck,

  I just noticed something. In the "hgcache" line below, the "hg" path resolves relative to the slave home directory but "hgcache" resolves relative to the master home directory. Is this a bug? Shouldn't "hgcache" resolve relative to the slave's home directory?

Thanks,
Gili

Chuck Doucette

unread,
Aug 30, 2012, 4:35:00 PM8/30/12
to jenkins...@googlegroups.com

I’ve never tried to use caching – although I should – since most of my Mac projects are from the same repository.

It appears that the problem is not in accessing /usr/local/bin/hg but accessing your cache.

I’d try turning off caching in the top-level Mercurial configuration for now to see if you get farther (up to authorization for the initial clone).

However, if you get it working – share that knowledge.

 

The help text for Mercurial’s “Use repository cache” says that the cache is kept on the master node, although additional caches may be kept on the slave. I don’t see any configuration to specify how to access the master node’s file system (where the caches would be kept) from the slave node.

 

Chuck

 

From: jenkins...@googlegroups.com [mailto:jenkins...@googlegroups.com] On Behalf Of Gili
Sent: Thursday, August 30, 2012 4:21 PM
To: jenkins...@googlegroups.com
Subject: Re: Mercurial automatic installer on slave node

 

Hi Chuck,

From: jenkins...@googlegroups.com [mailto:jenkins...@googlegroups.com] On Behalf Of gili.tzabari
Sent: Thursday, August 30, 2012 11:17 AM
Subject: Re: Mercurial automatic installer on slave node
 
Hi again,
 
     So I installed Mercurial manually but now I get:
 
Building remotely on MacOS X 10.7 in workspace <workspace> JDK installation skipped: Unknown CPU name: mac os x $ hg clone --rev default --noupdate <repository> <workspace>
ERROR: Failed to clone <repository> because hg could not be found; check that you've properly configured your Mercurial installation
ERROR: Failed to clone <repository>
 
 
     Thing is, if I manually ssh into OSX from Windows I can execute "hg" just fine. Same thing in a local terminal on the Mac. Any ideas how to troubleshoot this further?
 
Thanks,
Gili
 
On 30/08/2012 11:10 AM, Chuck Doucette wrote:
I don't know what is supposed to happen, I just know that I recently 
configured a Jenkins slave node on OSX and it didn't work until I manually installed both Java and Mercurial. Indeed, it would be nice if both happened automatically (Jenkins install Java and the Mercurial plugin install Mercurial). I wasn't aware of this page that you referenced or exactly what that implies. I read that page as saying that more tools, specifically auto-installation of SCMs, is needed (e.g. Mercurial). Why it specifically says: "Mercurial available as of 1.18" is indeed confusing (since it implies it is already supported, but is listed under missing tools).
 
Chuck
 
-----Original Message-----
Sent: Thursday, August 30, 2012 10:57 AM

gili.tzabari

unread,
Aug 30, 2012, 4:54:43 PM8/30/12
to jenkins...@googlegroups.com
Hi Chuck,

    This is even more interesting. It turns out that "echo $PATH" returns

'C:\Program' 'Files\Java\jdk1.7.0_06/bin:/usr/bin:/bin:/usr/sbin:/sbin'

which is clearly wrong. I did some more research and tracked down the problem to the JDK auto-installer. I filed this bug report: https://issues.jenkins-ci.org/browse/JENKINS-15000

	I believe the repository cache issue is a separate bug so I've filed https://issues.jenkins-ci.org/browse/JENKINS-15001

	Is anyone using Jenkins on OSX in production? It looks like not... :)

Gili
Reply all
Reply to author
Forward
0 new messages