/** * @since 1.498 */ public String getJnlpMac() { return JnlpSlaveAgentProtocol.SLAVE_SECRET.mac(getName()); }
@WebMethod(name="slave-agent.jnlp") public HttpResponse doSlaveAgentJnlp(StaplerRequest req, StaplerResponse res) { return new EncryptedSlaveAgentJnlpFile(this, "slave-agent.jnlp.jelly", getName(), CONNECT); }
public void run() { try { c.connect(true).get(); if (c.isOnline()) { LOGGER.log(INFO, "Launched computer {0} per schedule", new Object[]{c.getName()}); } if (keepUpWhenActive && c.isOnline() && !c.isAcceptingTasks()) { LOGGER.log(INFO, "Enabling new jobs for computer {0} as it has started its scheduled uptime", new Object[]{c.getName()}); c.setAcceptingTasks(true); } } catch (InterruptedException | ExecutionException e) { } } });
@Override public void run() { if (c.isIdle()) { LOGGER.log(INFO, "Disconnecting computer {0} as it has finished all jobs running when " + "it completed its scheduled uptime", new Object[]{c.getName()}); c.disconnect(OfflineCause .create(Messages._SimpleScheduledRetentionStrategy_FinishedUpTime())); } } });
@Override public void run() { if (c.isIdle()) { LOGGER.log(INFO, "Disconnecting computer {0} as it has finished its scheduled uptime", new Object[]{c.getName()}); c.disconnect(OfflineCause .create(Messages._SimpleScheduledRetentionStrategy_FinishedUpTime())); } else { c.setAcceptingTasks(false); } } });
return lastConnectActivity; if(forceReconnect && isConnecting()) logger.fine("Forcing a reconnect on "+getName());
boolean shouldBeOnline = isOnlineScheduled(); LOGGER.log(Level.FINE, "Checking computer {0} against schedule. online = {1}, shouldBeOnline = {2}", new Object[]{c.getName(), c.isOnline(), shouldBeOnline}); if (shouldBeOnline && c.isOffline()) { LOGGER.log(INFO, "Trying to launch computer {0} as schedule says it should be on-line at " + "this point in time", new Object[]{c.getName()}); if (c.isLaunchSupported()) { Computer.threadPoolForRemoting.submit(new Runnable() { LOGGER.log(INFO, "Disabling new jobs for computer {0} as it has finished its scheduled uptime", new Object[]{c.getName()}); return 1; } else if (c.isIdle() && c.isAcceptingTasks()) { new Object[]{c.getName()}); c.disconnect(OfflineCause.create(Messages._SimpleScheduledRetentionStrategy_FinishedUpTime()));
/** * @since 1.498 */ public String getJnlpMac() { return JnlpSlaveAgentProtocol.SLAVE_SECRET.mac(getName()); }
@Override public String toString() { return Objects.toStringHelper(this) .add("name", super.getName()) .add("slave", getNode()) .toString(); } }
private Collection<String> getDockerRunCommand(ECSSlave slave, String jenkinsUrl) { Collection<String> command = new ArrayList<String>(); command.add("-url"); command.add(jenkinsUrl); if (StringUtils.isNotBlank(tunnel)) { command.add("-tunnel"); command.add(tunnel); } command.add(slave.getComputer().getJnlpMac()); command.add(slave.getComputer().getName()); return command; } }
@Override public void launch(SlaveComputer computer, TaskListener listener) { listener.getLogger().println("Launching " + computer.getDisplayName()); try { if (!(computer instanceof DockerComputerSingle)) { throw new IllegalStateException(computer.getName() + " not instance of DockerComputerSingle"); } provisionWithWait((DockerComputerSingle) computer, listener); } catch (Throwable e) { LOG.error("Can't launch ", e); listener.error("Can't launch " + e.getMessage()); Throwables.propagate(e); } }
@WebMethod(name="slave-agent.jnlp") public HttpResponse doSlaveAgentJnlp(StaplerRequest req, StaplerResponse res) throws IOException, ServletException { return new EncryptedSlaveAgentJnlpFile(this, "slave-agent.jnlp.jelly", getName(), CONNECT); }
public void run() { try { c.connect(true).get(); if (c.isOnline()) { LOGGER.log(INFO, "Launched computer {0} per schedule", new Object[]{c.getName()}); } if (keepUpWhenActive && c.isOnline() && !c.isAcceptingTasks()) { LOGGER.log(INFO, "Enabling new jobs for computer {0} as it has started its scheduled uptime", new Object[]{c.getName()}); c.setAcceptingTasks(true); } } catch (InterruptedException | ExecutionException e) { } } });
public long check(final SlaveComputer c) { if (c.isOffline() && !disabled.get()) { final long idleMilliseconds = System.currentTimeMillis() - c.getIdleStartMilliseconds(); final long defaultIdleMinutes = (this.idleMinutes != null ? this.idleMinutes.get() : 30); if (idleMilliseconds > MINUTES.toMillis(defaultIdleMinutes)) { LOGGER.info("Disconnecting dynaslave " + c.getName()); try { Hudson.getInstance().removeNode(c.getNode()); } catch (IOException e) { LOGGER.log(WARNING, "Failed to terminate " + c.getName(), e); } } } return 1; }
public void run() { try { c.connect(true).get(); if (c.isOnline()) { LOGGER.log(INFO, "Launched computer {0} per schedule", new Object[]{c.getName()}); } if (keepUpWhenActive && c.isOnline() && !c.isAcceptingTasks()) { LOGGER.log(INFO, "Enabling new jobs for computer {0} as it has started its scheduled uptime", new Object[]{c.getName()}); c.setAcceptingTasks(true); } } catch (InterruptedException e) { } catch (ExecutionException e) { } } });
public InstallerGui(SlaveInstaller installer, SlaveComputer sc) { this.installer = installer; final Slave node = sc.getNode(); if (node == null) { throw new IllegalStateException("The configration has change and the node for computer " + sc.getName() + " is removed"); } // TODO: missing null check this.slaveRoot = node.getRootPath(); this.jnlpMac = sc.getJnlpMac(); }
public void run() { try { c.connect(true).get(); if (c.isOnline()) { LOGGER.log(INFO, "Launched computer {0} per schedule", new Object[]{c.getName()}); } if (keepUpWhenActive && c.isOnline() && !c.isAcceptingTasks()) { LOGGER.log(INFO, "Enabling new jobs for computer {0} as it has started its scheduled uptime", new Object[]{c.getName()}); c.setAcceptingTasks(true); } } catch (InterruptedException e) { } catch (ExecutionException e) { } } });
@Override public void run() { if (c.isIdle()) { LOGGER.log(INFO, "Disconnecting computer {0} as it has finished all jobs running when " + "it completed its scheduled uptime", new Object[]{c.getName()}); c.disconnect(OfflineCause .create(Messages._SimpleScheduledRetentionStrategy_FinishedUpTime())); } } });
@Override public void run() { if (c.isIdle()) { LOGGER.log(INFO, "Disconnecting computer {0} as it has finished its scheduled uptime", new Object[]{c.getName()}); c.disconnect(OfflineCause .create(Messages._SimpleScheduledRetentionStrategy_FinishedUpTime())); } else { c.setAcceptingTasks(false); } } });