diff --git a/.cvsignore b/.cvsignore index acc422a34f..bf18d64869 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1,5 +1,5 @@ target .svn pom.ipr -pom.iml +pom.iml pom.iws diff --git a/core/src/main/java/hudson/Functions.java b/core/src/main/java/hudson/Functions.java index 034bca9a52..9aa4100fbe 100644 --- a/core/src/main/java/hudson/Functions.java +++ b/core/src/main/java/hudson/Functions.java @@ -1,21 +1,7 @@ package hudson; import hudson.maven.ExecutedMojo; -import hudson.model.AbstractProject; -import hudson.model.Action; -import hudson.model.Descriptor; -import hudson.model.Hudson; -import hudson.model.Item; -import hudson.model.ItemGroup; -import hudson.model.Items; -import hudson.model.Job; -import hudson.model.JobPropertyDescriptor; -import hudson.model.ModelObject; -import hudson.model.Node; -import hudson.model.Project; -import hudson.model.Run; -import hudson.model.TopLevelItem; -import hudson.model.View; +import hudson.model.*; import hudson.search.SearchableModelObject; import hudson.tasks.BuildStep; import hudson.tasks.BuildStepDescriptor; @@ -261,6 +247,10 @@ public class Functions { return Node.Mode.values(); } + public static Node.Availability[] getNodeAvailabilities() { + return Node.Availability.values(); + } + public static String getProjectListString(List projects) { return Items.toNameList(projects); } @@ -507,6 +497,10 @@ public class Functions { return BuildStepDescriptor.filter(BuildStep.PUBLISHERS, project.getClass()); } + public static List> getSlaveStartMethodDescriptors() { + return SlaveStartMethod.LIST; + } + /** * Computes the path to the icon of the given action * from the context path. diff --git a/core/src/main/java/hudson/model/Computer.java b/core/src/main/java/hudson/model/Computer.java index e2abbcd3ec..3933c2e631 100644 --- a/core/src/main/java/hudson/model/Computer.java +++ b/core/src/main/java/hudson/model/Computer.java @@ -125,12 +125,22 @@ public abstract class Computer extends AbstractModelObject { /** * Returns true if this computer is supposed to be launched via JNLP. + * @deprecated see {@linkplain #isStartSupported()} and {@linkplain hudson.model.SlaveStartMethod} */ @Exported + @Deprecated public boolean isJnlpAgent() { return false; } + /** + * Returns true if this computer can be launched by Hudson. + */ + @Exported + public boolean isStartSupported() { + return true; + } + /** * Returns true if this node is marked temporarily offline by the user. * @@ -181,7 +191,7 @@ public abstract class Computer extends AbstractModelObject { public List getTiedJobs() { return getNode().getSelfLabel().getTiedJobs(); } - + public RunList getBuilds() { return new RunList(Hudson.getInstance().getAllItems(Job.class)).node(getNode()); } diff --git a/core/src/main/java/hudson/model/ComputerSet.java b/core/src/main/java/hudson/model/ComputerSet.java index 1eeae9f5fd..796f5374a8 100644 --- a/core/src/main/java/hudson/model/ComputerSet.java +++ b/core/src/main/java/hudson/model/ComputerSet.java @@ -16,7 +16,7 @@ import org.kohsuke.stapler.export.Exported; * Serves as the top of {@link Computer}s in the URL hierarchy. *

* Getter methods are prefixed with '_' to avoid collision with computer names. - * + * * @author Kohsuke Kawaguchi */ @ExportedBean @@ -43,13 +43,13 @@ public final class ComputerSet implements ModelObject { public void do_launchAll(StaplerRequest req, StaplerResponse rsp) throws IOException { for(Computer c : get_all()) { - if(c.isJnlpAgent()) + if(c.isStartSupported()) continue; c.launch(); } rsp.sendRedirect("."); } - + public Api getApi() { return new Api(this); } diff --git a/core/src/main/java/hudson/model/Hudson.java b/core/src/main/java/hudson/model/Hudson.java index dbb9383222..ddcbb3f6c2 100644 --- a/core/src/main/java/hudson/model/Hudson.java +++ b/core/src/main/java/hudson/model/Hudson.java @@ -65,6 +65,7 @@ import hudson.util.TextFile; import hudson.util.XStream2; import hudson.widgets.Widget; import net.sf.json.JSONObject; +import net.sf.json.JSONArray; import org.acegisecurity.AccessDeniedException; import org.acegisecurity.Authentication; import org.acegisecurity.GrantedAuthority; @@ -178,7 +179,7 @@ public final class Hudson extends View implements ItemGroup, Node, *

* Intuitively, this corresponds to the user database. * - * See {@link HudsonFilter} for the concrete authentication protocol. + * See {@link HudsonFilter} for the concrete authentication protocol. * * Never null. Always use {@link #setSecurityRealm(SecurityRealm)} to * update this field. @@ -394,7 +395,7 @@ public final class Hudson extends View implements ItemGroup, Node, /** * Returns a secret key that survives across container start/stop. *

- * This value is useful for implementing some of the security features. + * This value is useful for implementing some of the security features. */ public String getSecretKey() { return secretKey; @@ -1310,7 +1311,7 @@ public final class Hudson extends View implements ItemGroup, Node, authorizationStrategy = AuthorizationStrategy.UNSECURED; setSecurityRealm(SecurityRealm.NO_AUTHENTICATION); } - + LOGGER.info(String.format("Took %s ms to load",System.currentTimeMillis()-startTime)); } @@ -1417,30 +1418,10 @@ public final class Hudson extends View implements ItemGroup, Node, } } - numExecutors = Integer.parseInt(req.getParameter("numExecutors")); quietPeriod = Integer.parseInt(req.getParameter("quiet_period")); systemMessage = Util.nullify(req.getParameter("system_message")); - {// update slave list - List newSlaves = new ArrayList(); - String[] names = req.getParameterValues("slave.name"); - if(names!=null) { - for(int i=0;i< names.length;i++) { - newSlaves.add(req.bindParameters(Slave.class,"slave.",i)); - } - } - this.slaves = newSlaves; - updateComputerList(); - - // label trim off - for (Label l : labels.values()) { - l.reset(); - if(l.getNodes().isEmpty()) - labels.remove(l); - } - } - {// update JDK installations jdks.clear(); String[] names = req.getParameterValues("jdk_name"); @@ -1483,6 +1464,84 @@ public final class Hudson extends View implements ItemGroup, Node, } } + /** + * Accepts submission from the configuration page. + */ + public synchronized void doConfigExecutorsSubmit( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException { + try { + checkPermission(ADMINISTER); + + req.setCharacterEncoding("UTF-8"); + + JSONObject json = StructuredForm.get(req); + + numExecutors = Integer.parseInt(req.getParameter("numExecutors")); + + { + // update slave list + Object src = json.get("slaves"); + ArrayList r = new ArrayList(); + if (src instanceof JSONObject) { + JSONObject j = (JSONObject) src; + final Slave slave = req.bindJSON(Slave.class, j); + String clazz = j.get("startMethodClass").toString(); + for (Descriptor d: SlaveStartMethod.LIST) { + if (d.getClass().getName().equals(clazz)) { + slave.setStartMethod(d.newInstance(req, j.getJSONObject("startMethod"))); + break; + } + } + r.add(slave); + } + if (src instanceof JSONArray) { + JSONArray a = (JSONArray) src; + for (Object o : a) { + if (o instanceof JSONObject) { + JSONObject j = (JSONObject) o; + String clazz = j.get("startMethodClass").toString(); + SlaveStartMethod startMethod = null; + for (Descriptor d: SlaveStartMethod.LIST) { + if (d.getClass().getName().equals(clazz)) { + startMethod = d.newInstance(req, j.getJSONObject("startMethod")); + break; + } + } + + j.remove("startMethod"); + j.remove("startMethodClass"); + + System.out.println("j = " + j); + + final Slave slave = req.bindJSON(Slave.class, j); + slave.setStartMethod(startMethod); + r.add(slave); + } + } + } + this.slaves = r; + updateComputerList(); + + // label trim off + for (Label l : labels.values()) { + l.reset(); + if(l.getNodes().isEmpty()) + labels.remove(l); + } + } + + boolean result = true; + + save(); + + if(result) + rsp.sendRedirect(req.getContextPath()+'/'); // go to the top page + else + rsp.sendRedirect("configure"); // back to config + } catch (FormException e) { + sendError(e,req,rsp); + } + } + /** * Accepts the new description. */ @@ -1920,7 +1979,7 @@ public final class Hudson extends View implements ItemGroup, Node, PrintWriter w = rsp.getWriter(); w.println("Shutting down"); w.close(); - + System.exit(0); } @@ -2384,7 +2443,7 @@ public final class Hudson extends View implements ItemGroup, Node, /** * Prefix to static resources like images and javascripts in the war file. * Either "" or strings like "/static/VERSION", which avoids Hudson to pick up - * stale cache when the user upgrades to a different version. + * stale cache when the user upgrades to a different version. */ public static String RESOURCE_PATH; diff --git a/core/src/main/java/hudson/model/Node.java b/core/src/main/java/hudson/model/Node.java index 27fb3d4e83..752160d02e 100644 --- a/core/src/main/java/hudson/model/Node.java +++ b/core/src/main/java/hudson/model/Node.java @@ -6,6 +6,10 @@ import hudson.node_monitors.NodeMonitor; import hudson.util.EnumConverter; import hudson.util.ClockDifference; import org.kohsuke.stapler.Stapler; +import org.kohsuke.stapler.StaplerRequest; +import org.kohsuke.stapler.StaplerResponse; +import org.kohsuke.stapler.Stapler; +import org.acegisecurity.ui.AbstractProcessingFilter; import java.util.Set; import java.io.IOException; @@ -131,7 +135,39 @@ public interface Node { } static { - Stapler.CONVERT_UTILS.register(new EnumConverter(),Mode.class); + Stapler.CONVERT_UTILS.register(new EnumConverter(), Mode.class); + Stapler.CONVERT_UTILS.register(new EnumConverter(), Availability.class); } } + + public enum Availability { + ALWAYS("Keep this slave on-line as much as possible", "configPageAlways"), +// SCHEDULED("Take this slave on-line and off-line at specific times", "configPageScheduled"), +// DEMAND("Take this slave on-line and off-line as needed", "configPageDemand"), + ; + + private final String configPage; + + private final String description; + + public String getDescription() { + return description; + } + + public String getName() { + return name(); + } + + Availability(String description, String configPage) { + this.description = description; + this.configPage = configPage; + } + + + public void doConfigPage( StaplerRequest req, StaplerResponse rsp ) throws IOException { + rsp.sendRedirect2(configPage); + } + + + } } diff --git a/core/src/main/java/hudson/model/Slave.java b/core/src/main/java/hudson/model/Slave.java index ff891227d8..31b3ccc524 100644 --- a/core/src/main/java/hudson/model/Slave.java +++ b/core/src/main/java/hudson/model/Slave.java @@ -23,6 +23,7 @@ import hudson.util.StreamCopyThread; import hudson.util.StreamTaskListener; import org.kohsuke.stapler.StaplerRequest; import org.kohsuke.stapler.StaplerResponse; +import org.kohsuke.stapler.DataBoundConstructor; import javax.servlet.ServletException; import javax.servlet.http.HttpServletResponse; @@ -36,16 +37,13 @@ import java.io.PrintWriter; import java.io.Serializable; import java.net.URL; import java.net.URLConnection; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Date; -import java.util.HashSet; -import java.util.List; -import java.util.Set; +import java.util.*; import java.util.logging.Level; import java.util.logging.LogRecord; import java.util.logging.Logger; +import net.sf.json.JSONObject; + /** * Information about a Hudson slave node. * @@ -79,10 +77,38 @@ public final class Slave implements Node, Serializable { private Mode mode; /** - * Command line to launch the agent, like - * "ssh myslave java -jar /path/to/hudson-remoting.jar" + * Slave availablility strategy. */ - private String agentCommand; + private Availability onlineAvailability; + + /** + * Number of minutes when the slave is required to be on-line before bringing the slave on-line. + * Only used with {@link #onlineAvailability} == {@link hudson.model.Node.Availability#DEMAND} + */ + private int demandPeriod = 5; + + /** + * Number of minutes when the slave is idle before bringing the slave off-line. + * Only used with {@link #onlineAvailability} == {@link hudson.model.Node.Availability#DEMAND} + */ + private int idlePeriod = 10; + + /** + * Cron spec for starting up the slave. + * Only used with {@link #onlineAvailability} == {@link hudson.model.Node.Availability#SCHEDULED} + */ + private String startupSpec = ""; + + /** + * Cron spec for shutting down the slave. + * Only used with {@link #onlineAvailability} == {@link hudson.model.Node.Availability#SCHEDULED} + */ + private String shutdownSpec = ""; + + /** + * The starter that will startup this slave. + */ + private SlaveStartMethod startMethod; /** * Whitespace-separated labels. @@ -100,15 +126,19 @@ public final class Slave implements Node, Serializable { /** * @stapler-constructor */ - public Slave(String name, String description, String command, String remoteFS, String numExecutors, Mode mode, - String label) throws FormException { + public Slave(String name, String description, String remoteFS, String numExecutors, + Mode mode, String label, Availability onlineAvailability) throws FormException { this.name = name; this.description = description; this.numExecutors = Util.tryParseNumber(numExecutors, 1).intValue(); this.mode = mode; - this.agentCommand = command; this.remoteFS = remoteFS; this.label = Util.fixNull(label).trim(); + this.onlineAvailability = onlineAvailability; + this.demandPeriod = demandPeriod; + this.idlePeriod = idlePeriod; + this.startupSpec = startupSpec; + this.shutdownSpec = shutdownSpec; getAssignedLabels(); // compute labels now if (name.equals("")) @@ -126,8 +156,12 @@ public final class Slave implements Node, Serializable { throw new FormException(Messages.Slave_InvalidConfig_Executors(name), null); } - public String getCommand() { - return agentCommand; + public SlaveStartMethod getStartMethod() { + return startMethod == null ? new JNLPStartMethod() : startMethod; + } + + public void setStartMethod(SlaveStartMethod startMethod) { + this.startMethod = startMethod; } public String getRemoteFS() { @@ -150,6 +184,26 @@ public final class Slave implements Node, Serializable { return mode; } + public Availability getOnlineAvailability() { + return onlineAvailability; + } + + public int getDemandPeriod() { + return demandPeriod; + } + + public int getIdlePeriod() { + return idlePeriod; + } + + public String getStartupSpec() { + return startupSpec; + } + + public String getShutdownSpec() { + return shutdownSpec; + } + public String getLabelString() { return Util.fixNull(label).trim(); } @@ -299,15 +353,14 @@ public final class Slave implements Node, Serializable { } @Override + @Deprecated public boolean isJnlpAgent() { - return getNode().getCommand().length()==0; + return getNode().getStartMethod() instanceof JNLPStartMethod; } - /** - * Gets the formatted current time stamp. - */ - private static String getTimestamp() { - return String.format("[%1$tD %1$tT]",new Date()); + @Override + public boolean isStartSupported() { + return getNode().getStartMethod().isStartSupported(); } /** @@ -317,53 +370,7 @@ public final class Slave implements Node, Serializable { closeChannel(); final OutputStream launchLog = openLogFile(); - - if(slave.agentCommand.length()>0) { - // launch the slave agent asynchronously - threadPoolForRemoting.execute(new Runnable() { - // TODO: do this only for nodes that are so configured. - // TODO: support passive connection via JNLP - public void run() { - final StreamTaskListener listener = new StreamTaskListener(launchLog); - try { - listener.getLogger().println(Messages.Slave_Launching(getTimestamp())); - listener.getLogger().println("$ "+slave.agentCommand); - - ProcessBuilder pb = new ProcessBuilder(Util.tokenize(slave.agentCommand)); - final EnvVars cookie = ProcessTreeKiller.createCookie(); - pb.environment().putAll(cookie); - final Process proc = pb.start(); - - // capture error information from stderr. this will terminate itself - // when the process is killed. - new StreamCopyThread("stderr copier for remote agent on "+slave.getNodeName(), - proc.getErrorStream(), launchLog).start(); - - setChannel(proc.getInputStream(),proc.getOutputStream(),launchLog,new Listener() { - public void onClosed(Channel channel, IOException cause) { - if(cause!=null) - cause.printStackTrace(listener.error(Messages.Slave_Terminated(getTimestamp()))); - ProcessTreeKiller.get().kill(proc,cookie); - } - }); - - logger.info("slave agent launched for "+slave.getNodeName()); - numRetryAttempt=0; - } catch (InterruptedException e) { - e.printStackTrace(listener.error("aborted")); - } catch (IOException e) { - Util.displayIOException(e,listener); - - String msg = Util.getWin32ErrorMessage(e); - if(msg==null) msg=""; - else msg=" : "+msg; - msg = Messages.Slave_UnableToLaunch(slave.getNodeName(),msg); - logger.log(Level.SEVERE,msg,e); - e.printStackTrace(listener.error(msg)); - } - } - }); - } + slave.startMethod.start(this, slave, launchLog, logger); } public OutputStream openLogFile() { @@ -387,7 +394,7 @@ public final class Slave implements Node, Serializable { if(this.channel!=null) throw new IllegalStateException("Already connected"); - Channel channel = new Channel(nodeName,threadPoolForRemoting, Channel.Mode.NEGOTIATE, + Channel channel = new Channel(nodeName,threadPoolForRemoting, Channel.Mode.NEGOTIATE, in,out, launchLog); channel.addListener(new Listener() { public void onClosed(Channel c,IOException cause) { @@ -588,6 +595,11 @@ public final class Slave implements Node, Serializable { if(command.length()>0) command += ' '; agentCommand = command+"java -jar ~/bin/slave.jar"; } + if (startMethod == null) { + startMethod = (agentCommand == null || agentCommand.trim().length() == 0) + ? new JNLPStartMethod() + : new CommandStartMethod(agentCommand); + } return this; } @@ -607,6 +619,126 @@ public final class Slave implements Node, Serializable { private static final long serialVersionUID = 1L; } + public static class JNLPStartMethod extends SlaveStartMethod { + + @Override + public boolean isStartSupported() { + return false; + } + + public void start(ComputerImpl computer, Slave slave, OutputStream launchLog, Logger logger) { + // do nothing as we cannot self start + } + + //@DataBoundConstructor + public JNLPStartMethod() { + } + + public Descriptor getDescriptor() { + return DESCRIPTOR; + } + + public static final Descriptor DESCRIPTOR = new Descriptor(JNLPStartMethod.class) { + public String getDisplayName() { + return "Launch slave agents via JNLP"; + } + + public SlaveStartMethod newInstance(StaplerRequest req, JSONObject formData) throws FormException { + return new JNLPStartMethod(); + } + }; + } + + public static class CommandStartMethod extends SlaveStartMethod { + + /** + * Command line to launch the agent, like + * "ssh myslave java -jar /path/to/hudson-remoting.jar" + */ + private String agentCommand; + + @DataBoundConstructor + public CommandStartMethod(String command) { + this.agentCommand = command; + } + + public String getCommand() { + return agentCommand; + } + + public Descriptor getDescriptor() { + return DESCRIPTOR; + } + + public static final Descriptor DESCRIPTOR = new Descriptor(CommandStartMethod.class) { + public String getDisplayName() { + return "Launch slave via execution of command on the Master"; + } + + }; + + /** + * Gets the formatted current time stamp. + */ + private static String getTimestamp() { + return String.format("[%1$tD %1$tT]", new Date()); + } + + public void start(final ComputerImpl computer, final Slave slave, final OutputStream launchLog, + final Logger logger) { + final CommandStartMethod method = (CommandStartMethod) slave.startMethod; + // launch the slave agent asynchronously + Computer.threadPoolForRemoting.execute(new Runnable() { + // TODO: do this only for nodes that are so configured. + // TODO: support passive connection via JNLP + public void run() { + final StreamTaskListener listener = new StreamTaskListener(launchLog); + try { + listener.getLogger().println(Messages.Slave_Launching(getTimestamp())); + listener.getLogger().println("$ " + method.getCommand()); + + ProcessBuilder pb = new ProcessBuilder(Util.tokenize(method.getCommand())); + final EnvVars cookie = ProcessTreeKiller.createCookie(); + pb.environment().putAll(cookie); + final Process proc = pb.start(); + + // capture error information from stderr. this will terminate itself + // when the process is killed. + new StreamCopyThread("stderr copier for remote agent on " + slave.getNodeName(), + proc.getErrorStream(), launchLog).start(); + + computer.setChannel(proc.getInputStream(), proc.getOutputStream(), launchLog, new Listener() { + public void onClosed(Channel channel, IOException cause) { + if (cause != null) { + cause.printStackTrace( + listener.error(Messages.Slave_Terminated(getTimestamp()))); + } + ProcessTreeKiller.get().kill(proc, cookie); + } + }); + + logger.info("slave agent launched for " + slave.getNodeName()); + computer.numRetryAttempt = 0; + } catch (InterruptedException e) { + e.printStackTrace(listener.error("aborted")); + } catch (IOException e) { + Util.displayIOException(e, listener); + + String msg = Util.getWin32ErrorMessage(e); + if (msg == null) { + msg = ""; + } else { + msg = " : " + msg; + } + msg = Messages.Slave_UnableToLaunch(slave.getNodeName(), msg); + logger.log(Level.SEVERE, msg, e); + e.printStackTrace(listener.error(msg)); + } + } + }); + } + } + // // backwrad compatibility // @@ -626,4 +758,28 @@ public final class Slave implements Node, Serializable { * @deprecated */ private transient String command; + /** + * Command line to launch the agent, like + * "ssh myslave java -jar /path/to/hudson-remoting.jar" + */ + private transient String agentCommand; + + static { + SlaveStartMethod.LIST.add(Slave.JNLPStartMethod.DESCRIPTOR); + SlaveStartMethod.LIST.add(Slave.CommandStartMethod.DESCRIPTOR); + } + + +// static { +// ConvertUtils.register(new Converter(){ +// public Object convert(Class type, Object value) { +// if (value != null) { +// System.out.println("CVT: " + type + " from (" + value.getClass() + ") " + value); +// } else { +// System.out.println("CVT: " + type + " from " + value); +// } +// return null; //To change body of implemented methods use File | Settings | File Templates. +// } +// }, SlaveStartMethod.class); +// } } diff --git a/core/src/main/java/hudson/model/SlaveReconnectionWork.java b/core/src/main/java/hudson/model/SlaveReconnectionWork.java index 3e3f562cee..9d98480e89 100644 --- a/core/src/main/java/hudson/model/SlaveReconnectionWork.java +++ b/core/src/main/java/hudson/model/SlaveReconnectionWork.java @@ -5,7 +5,7 @@ import hudson.triggers.SafeTimerTask; /** * Periodically checks the slaves and try to reconnect dead slaves. - * + * * @author Kohsuke Kawaguchi */ public class SlaveReconnectionWork extends SafeTimerTask { @@ -14,7 +14,7 @@ public class SlaveReconnectionWork extends SafeTimerTask { ComputerImpl c = s.getComputer(); if(c==null) // shouldn't happen, but let's be defensive continue; - if(c.isOffline() && !c.isJnlpAgent()) + if(c.isOffline() && c.isStartSupported()) c.tryReconnect(); } } diff --git a/core/src/main/java/hudson/model/SlaveStartMethod.java b/core/src/main/java/hudson/model/SlaveStartMethod.java new file mode 100644 index 0000000000..49ff035c8d --- /dev/null +++ b/core/src/main/java/hudson/model/SlaveStartMethod.java @@ -0,0 +1,28 @@ +package hudson.model; + +import hudson.ExtensionPoint; + +import java.util.List; +import java.util.ArrayList; +import java.util.logging.Logger; +import java.io.OutputStream; + +import org.apache.commons.beanutils.ConvertUtils; +import org.apache.commons.beanutils.Converter; + +/** + * Extension point to allow control over how Slaves are started. + * + * @author Stephen Connolly + * @since 24-Apr-2008 22:12:35 + */ +public abstract class SlaveStartMethod implements Describable, ExtensionPoint { + + public boolean isStartSupported() { + return true; + } + + public abstract void start(Slave.ComputerImpl computer, Slave slave, OutputStream launchLog, Logger logger); + + public static final List> LIST = new ArrayList>(); +} diff --git a/core/src/main/resources/hudson/model/Computer/index.jelly b/core/src/main/resources/hudson/model/Computer/index.jelly index 2bcaf39dfb..7565a97a2f 100644 --- a/core/src/main/resources/hudson/model/Computer/index.jelly +++ b/core/src/main/resources/hudson/model/Computer/index.jelly @@ -25,7 +25,7 @@

- TCP port for JNLP slave agentsis is disabled. + TCP port for JNLP slave agents is disabled. Go to system config screen and change it.
diff --git a/core/src/main/resources/hudson/model/Hudson/configure.jelly b/core/src/main/resources/hudson/model/Hudson/configure.jelly index 3cd623ff31..f282fd3424 100644 --- a/core/src/main/resources/hudson/model/Hudson/configure.jelly +++ b/core/src/main/resources/hudson/model/Hudson/configure.jelly @@ -12,10 +12,6 @@ - - - @@ -56,55 +52,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
-
-
-
-
-
- diff --git a/core/src/main/resources/hudson/model/Hudson/configureExecutors.jelly b/core/src/main/resources/hudson/model/Hudson/configureExecutors.jelly new file mode 100644 index 0000000000..d8bbf09da4 --- /dev/null +++ b/core/src/main/resources/hudson/model/Hudson/configureExecutors.jelly @@ -0,0 +1,121 @@ + + + + + + + + + + + ${%Master} + + + ${%This Hudson server} + + + + + + ${it.rootDir} + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ + +

${d}, ${d.class.name}, ${d == null}

+ + + + + + + + + + + + +
+
+
+
+
+ + +
+ +
+
+ +
+
+
+ + + + +
+
+
+
diff --git a/core/src/main/resources/hudson/model/Hudson/manage.jelly b/core/src/main/resources/hudson/model/Hudson/manage.jelly index 36172c4449..83272b6267 100644 --- a/core/src/main/resources/hudson/model/Hudson/manage.jelly +++ b/core/src/main/resources/hudson/model/Hudson/manage.jelly @@ -20,7 +20,8 @@

${%Manage Hudson}

- + + ${%Discard all the loaded data in memory and reload everything from file system.} ${%Useful when you modified config files directly on disk.} diff --git a/core/src/main/resources/hudson/model/Node/Availability/ALWAYS.jelly b/core/src/main/resources/hudson/model/Node/Availability/ALWAYS.jelly new file mode 100644 index 0000000000..d70f1e97a8 --- /dev/null +++ b/core/src/main/resources/hudson/model/Node/Availability/ALWAYS.jelly @@ -0,0 +1,3 @@ + + \ No newline at end of file diff --git a/core/src/main/resources/hudson/model/Node/Availability/DEMAND.jelly b/core/src/main/resources/hudson/model/Node/Availability/DEMAND.jelly new file mode 100644 index 0000000000..68e9de9c10 --- /dev/null +++ b/core/src/main/resources/hudson/model/Node/Availability/DEMAND.jelly @@ -0,0 +1,11 @@ + + + + + + + + \ No newline at end of file diff --git a/core/src/main/resources/hudson/model/Node/Availability/SCHEDULED.jelly b/core/src/main/resources/hudson/model/Node/Availability/SCHEDULED.jelly new file mode 100644 index 0000000000..5f4b51dcfe --- /dev/null +++ b/core/src/main/resources/hudson/model/Node/Availability/SCHEDULED.jelly @@ -0,0 +1,9 @@ + + + + + + + + \ No newline at end of file diff --git a/core/src/main/resources/hudson/model/Slave/CommandStartMethod/config.jelly b/core/src/main/resources/hudson/model/Slave/CommandStartMethod/config.jelly new file mode 100644 index 0000000000..96ac592652 --- /dev/null +++ b/core/src/main/resources/hudson/model/Slave/CommandStartMethod/config.jelly @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/core/src/main/resources/hudson/model/Slave/JNLPStartMethod/config.jelly b/core/src/main/resources/hudson/model/Slave/JNLPStartMethod/config.jelly new file mode 100644 index 0000000000..969ce5e50d --- /dev/null +++ b/core/src/main/resources/hudson/model/Slave/JNLPStartMethod/config.jelly @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/core/src/main/resources/lib/form/dropdownList.jelly b/core/src/main/resources/lib/form/dropdownList.jelly index 01ec3b2a10..e273f953d2 100644 --- a/core/src/main/resources/lib/form/dropdownList.jelly +++ b/core/src/main/resources/lib/form/dropdownList.jelly @@ -4,30 +4,51 @@ @name (mandatory) name of the drop-down list. --> - + - - - - + + + + + + + + + + + + +
+ ${attrs.title} + + + + + + Help for feature: ${title} +
+ + +
+ + + - - - - - - - -
-
- - - + + + ${description} + + + + + diff --git a/war/resources/help/system-config/master-slave/availability.html b/war/resources/help/system-config/master-slave/availability.html new file mode 100644 index 0000000000..491b0bbe6b --- /dev/null +++ b/war/resources/help/system-config/master-slave/availability.html @@ -0,0 +1,46 @@ +
+ Controls when Hudson starts and stops the slave. + +
+
+ Keep this slave on-line as much as possible +
+
+ This is the default and normal setting. + In this mode, Hudson uses tries to keep the slave on-line. + If Hudson can start the slave without user assistance, it will periodically + attempt to restart the slave if it is unavailable. + Hudson will not take the slave off-line. +
+ +
+ Take this slave on-line and off-line at specific times +
+
+ In this mode, Hudson will keep the slave on-line according to the configured schedule. + If Hudson can start the slave without user assistance, it will periodically + attempt to start the slave if it is unavailable during an on-line window. + + During an off-line window, the slave will only be taken off-line if there are no active + jobs running on the slave. +
+ +
+ Take this slave on-line and off-line as needed +
+
+ In this mode, if Hudson can start the slave without user assistance, it will periodically + attempt to start the slave while there are unexecuted jobs which meet the following criteria: +
    +
  • They have been in the queue for at least the specified startup demand period
  • +
  • They can execute on this slave
  • +
+ + The slave will be taken off-line if: +
    +
  • There are no active jobs running on the slave
  • +
  • The slave has been idle for at least the specified idle period
  • +
+
+
+
\ No newline at end of file diff --git a/war/resources/help/system-config/master-slave/startMethod.html b/war/resources/help/system-config/master-slave/startMethod.html new file mode 100644 index 0000000000..b4082d11b7 --- /dev/null +++ b/war/resources/help/system-config/master-slave/startMethod.html @@ -0,0 +1,3 @@ +
+ Controls how Hudson starts the slave. +
\ No newline at end of file