In my build grid I define a resource identifying machines with insufficient disk space to run a job, using the 'node.nodeService.evalGroovyScript' method. I can't find this method in the documentation, so I presume I got it from you folks. Alas, after upgrading to v14, it no longer works, with the following error stack:
com.pmease.quickbuild.resource.NodeResourceType - Error calcualting resource count (resource: .NEEDS_CLEANUP_UNIX, node: unknown:0)
java.lang.RuntimeException: Failed to evaluate below expression: (script replicated at the end)
com.pmease.quickbuild.QuickbuildException: com.caucho.hessian.client.HessianRuntimeException:
com.caucho.hessian.client.HessianRuntimeException: Error connecting 'http://0.0.0.0:0/service/node'
java.net.ConnectException: Connection refused
(full stack omitted for brevity)
Here is the code; it works like a dream on QB 13:
groovy:
def freeScript = """
return new File(
'/var'
).getFreeSpace();
"""
// divide by 1gb for simple math
def freeSpace =
node.nodeService.evalGroovyScript(
freeScript
).intdiv( 1024**3 );
// omit machines with less than 10gb free
return (freeSpace < 10);
What do I need to do to make it better?