@Test public void testRegisterJobs_ProjectNoLabel_Exclusive() throws Exception { Project<?, ?> lemon = createFreeStyleProject("lemon"); DumbSlave exclusive_slave = createOnlineSlave(new LabelAtom("foo")); exclusive_slave.setMode(Mode.EXCLUSIVE); AbstractWorkerThread oneiric = new ExecutorWorkerThread( "GearmanServer", 4730, "MyWorker", exclusive_slave.toComputer(), "master", new NoopAvailabilityMonitor()); oneiric.testInitWorker(); oneiric.registerJobs(); Set<String> functions = oneiric.worker.getRegisteredFunctions(); assertEquals(0, functions.size()); }
@DataBoundConstructor public ParallelsDesktopVMSlave(ParallelsDesktopVM vm, ParallelsDesktopConnectorSlaveComputer connector) throws IOException, Descriptor.FormException { super(vm.getSlaveName(), "", vm.getRemoteFS(), 1, Mode.NORMAL, vm.getLabels(), vm.getLauncher(), new ParallelsDesktopCloudRetentionStrategy(), new ArrayList<NodeProperty<?>>()); this.connector = connector; this.vm = vm; }
@DataBoundConstructor public ParallelsDesktopConnectorSlave(ParallelsDesktopCloud owner, String name, String remoteFS, ComputerLauncher launcher, boolean useAsBuilder) throws IOException, Descriptor.FormException { super(name, "", remoteFS, 1, Mode.NORMAL, "", launcher, useAsBuilder ? new RetentionStrategy.Always() : new RetentionStrategy.Demand(1, 1), new ArrayList<NodeProperty<?>>()); this.owner = owner; this.useAsBuilder = useAsBuilder; }
public MesosSlaveInfo( String labelString, Mode mode, double slaveCpus, int slaveMem, int minExecutors, int maxExecutors, double executorCpus, double diskNeeded, int executorMem, String remoteFSRoot, int idleTerminationMinutes, JSONObject slaveAttributes, String jvmArgs, String jnlpArgs, Boolean defaultSlave, ContainerInfo containerInfo, List<URI> additionalURIs, List<? extends NodeProperty<?>> nodeProperties) throws IOException, NumberFormatException { this.labelString = labelString; this.mode = mode; this.slaveCpus = slaveCpus; this.slaveMem = slaveMem; this.minExecutors = minExecutors < 1 ? 1 : minExecutors; // Ensure minExecutors is at least equal to 1 this.maxExecutors = maxExecutors; this.executorCpus = executorCpus; this.diskNeeded = diskNeeded; this.executorMem = executorMem; this.remoteFSRoot = remoteFSRoot; this.idleTerminationMinutes = idleTerminationMinutes; this.slaveAttributes = slaveAttributes; this.jvmArgs = jvmArgs; this.jnlpArgs = jnlpArgs; this.defaultSlave = defaultSlave; this.containerInfo = containerInfo; this.additionalURIs = additionalURIs; this.nodeProperties.replaceBy(nodeProperties == null ? new ArrayList<NodeProperty<?>>() : nodeProperties); }
@Override public Node.Mode getMode() { return useAsBuilder ? Node.Mode.NORMAL : Node.Mode.EXCLUSIVE; }
@DataBoundConstructor public MesosSlaveInfo( String labelString, Mode mode, String slaveCpus, String slaveMem, String minExecutors, String maxExecutors, String executorCpus, String diskNeeded, String executorMem, String remoteFSRoot, String idleTerminationMinutes, String slaveAttributes, String jvmArgs, String jnlpArgs, String defaultSlave, ContainerInfo containerInfo, List<URI> additionalURIs, List<? extends NodeProperty<?>> nodeProperties) throws IOException, NumberFormatException { // Parse the attributes provided from the cloud config this( Util.fixEmptyAndTrim(labelString), mode != null ? mode : Mode.NORMAL, Double.parseDouble(slaveCpus), Integer.parseInt(slaveMem), Integer.parseInt(minExecutors), Integer.parseInt(maxExecutors), Double.parseDouble(executorCpus), Double.parseDouble(diskNeeded), Integer.parseInt(executorMem), StringUtils.isNotBlank(remoteFSRoot) ? remoteFSRoot.trim() : "jenkins", Integer.parseInt(idleTerminationMinutes), parseSlaveAttributes(slaveAttributes), StringUtils.isNotBlank(jvmArgs) ? cleanseJvmArgs(jvmArgs) : DEFAULT_JVM_ARGS, StringUtils.isNotBlank(jnlpArgs) ? jnlpArgs : "", Boolean.valueOf(defaultSlave), containerInfo, additionalURIs, nodeProperties); }
public Mode getMode() { return mode; }