public ZFSProvisioner(Node node) throws IOException, InterruptedException { rootDataset = node.getRootPath().act(new GetName()); } private static class GetName extends MasterToSlaveFileCallable<String> {
@Override protected Callable<DiskSpace, IOException> createCallable(Computer c) { Node node = c.getNode(); if (node == null) return null; FilePath p = node.getRootPath(); if(p==null) return null; return p.asCallableWith(new GetUsableSpace()); } };
@Override protected Callable<DiskSpace,IOException> createCallable(Computer c) { Node node = c.getNode(); if (node == null) return null; FilePath p = node.getRootPath(); if(p==null) return null; return p.asCallableWith(new GetTempSpace()); } }
public String getToolHome(Node node, ToolInstallation tool, TaskListener log) throws IOException, InterruptedException { if (node.getRootPath() == null) { log.error(node.getDisplayName() + " is offline; cannot locate " + tool.getName()); return null;
/** * Convenience method to find a location to install a tool. * @param tool the tool being installed * @param node the computer on which to install the tool * @return {@link ToolInstallation#getHome} if specified, else a path within the local * Jenkins work area named according to {@link ToolInstallation#getName} * @since 1.310 */ protected final FilePath preferredLocation(ToolInstallation tool, Node node) { if (node == null) { throw new IllegalArgumentException("must pass non-null node"); } String home = Util.fixEmptyAndTrim(tool.getHome()); if (home == null) { home = sanitize(tool.getDescriptor().getId()) + File.separatorChar + sanitize(tool.getName()); } FilePath root = node.getRootPath(); if (root == null) { throw new IllegalArgumentException("Node " + node.getDisplayName() + " seems to be offline"); } return root.child("tools").child(home); }
public ZFSProvisioner(Node node) throws IOException, InterruptedException { rootDataset = node.getRootPath().act(new MasterToSlaveFileCallable<String>() { private static final long serialVersionUID = -2142349338699797436L; public String invoke(File f, VirtualChannel channel) throws IOException { ZFSFileSystem fs = libzfs.getFileSystemByMountPoint(f); if(fs!=null) return fs.getName(); // TODO: for now, only support agents that are already on ZFS. throw new IOException("Not on ZFS"); } }); }
private boolean eligibleNode(Node node) { if (node == null) { return false; } if (node.getRootPath() == null) { return false; } return node.getNumExecutors() != 0; }
public ZFSProvisioner(Node node) throws IOException, InterruptedException { this.node = node; rootDataset = node.getRootPath().act(new FileCallable<String>() { public String invoke(File f, VirtualChannel channel) throws IOException { ZFSFileSystem fs = libzfs.getFileSystemByMountPoint(f); if(fs!=null) return fs.getName(); // TODO: for now, only support slaves that are already on ZFS. throw new IOException("Not on ZFS"); } }); }
public ZFSProvisioner(Node node) throws IOException, InterruptedException { this.node = node; rootDataset = node.getRootPath().act(new FileCallable<String>() { public String invoke(File f, VirtualChannel channel) throws IOException { ZFSFileSystem fs = libzfs.getFileSystemByMountPoint(f); if(fs!=null) return fs.getName(); // TODO: for now, only support slaves that are already on ZFS. throw new IOException("Not on ZFS"); } }); }
@Override protected Callable<DiskSpace,IOException> createCallable(Computer c) { Node node = c.getNode(); if (node == null) return null; FilePath p = node.getRootPath(); if(p==null) return null; return p.asCallableWith(new GetTempSpace()); } }
@Override protected Callable<DiskSpace, IOException> createCallable(Computer c) { Node node = c.getNode(); if (node == null) return null; FilePath p = node.getRootPath(); if(p==null) return null; return p.asCallableWith(new GetUsableSpace()); } };
protected DiskSpace getFreeSpace(Computer c) throws IOException, InterruptedException { FilePath p = c.getNode().getRootPath(); if(p==null) return null; return p.act(new GetUsableSpace()); } };
protected DiskSpace getFreeSpace(Computer c) throws IOException, InterruptedException { FilePath p = c.getNode().getRootPath(); if(p==null) return null; return p.act(new GetTempSpace()); } };
protected DiskSpace getFreeSpace(Computer c) throws IOException, InterruptedException { FilePath p = c.getNode().getRootPath(); if(p==null) return null; return p.act(new GetUsableSpace()); } };
@Override protected Lease decideWorkspace(Node n, WorkspaceList wsl) throws IOException, InterruptedException { String customWorkspace = getProject().getCustomWorkspace(); if (customWorkspace != null) { // we allow custom workspaces to be concurrently used between jobs. return Lease.createDummyLease(n.getRootPath().child(getEnvironment(listener).expand(customWorkspace))); } return super.decideWorkspace(n, wsl); }
@Override protected Lease decideWorkspace(Node n, WorkspaceList wsl) throws IOException, InterruptedException { String customWorkspace = getProject().getCustomWorkspace(); if (customWorkspace != null) // we allow custom workspaces to be concurrently used between jobs. return Lease.createDummyLease(n.getRootPath().child(getEnvironment(listener).expand(customWorkspace))); return super.decideWorkspace(n,wsl); } }
@Override protected Lease decideWorkspace(Node n, WorkspaceList wsl) throws IOException, InterruptedException { String customWorkspace = getProject().getCustomWorkspace(); if (customWorkspace != null) { // we allow custom workspaces to be concurrently used between jobs. return Lease.createDummyLease(n.getRootPath().child(getEnvironment(listener).expand(customWorkspace))); } return super.decideWorkspace(n, wsl); } }
@Override protected Lease decideWorkspace(Node n, WorkspaceList wsl) throws IOException, InterruptedException { String customWorkspace = getProject().getCustomWorkspace(); if (customWorkspace != null) { // we allow custom workspaces to be concurrently used between jobs. return Lease.createDummyLease(n.getRootPath().child(getEnvironment(listener).expand(customWorkspace))); } return super.decideWorkspace(n, wsl); }
@Override protected Lease decideWorkspace(Node n, WorkspaceList wsl) throws IOException, InterruptedException { String customWorkspace = getProject().getCustomWorkspace(); if (customWorkspace != null) // we allow custom workspaces to be concurrently used between jobs. return Lease.createDummyLease(n.getRootPath().child(getEnvironment(listener).expand(customWorkspace))); return super.decideWorkspace(n,wsl); } }
protected Lease getParentWorkspaceLease(final Node n, final WorkspaceList wsl) throws InterruptedException, IOException { final DynamicProject mp = getParent().getParent(); final String customWorkspace = mp.getCustomWorkspace(); if (customWorkspace != null) { // we allow custom workspaces to be concurrently used between // jobs. return Lease.createDummyLease(n.getRootPath().child(getEnvironment(this.listener).expand(customWorkspace))); } return wsl.allocate(n.getWorkspaceFor(mp), getParentBuild()); }