Skip to content
Permalink
Browse files
[JENKINS-48686] Switch to calling the agent 'agent' (#244)
  • Loading branch information
jsoref authored and oleg-nenashev committed Dec 26, 2017
1 parent 6a528dd commit 3ce2e9866bdcb74536cffe4f86a96513982e2000
@@ -76,7 +76,7 @@
import org.jenkinsci.remoting.util.KeyUtils;

/**
* Slave agent engine that proactively connects to Jenkins master.
* Agent engine that proactively connects to Jenkins master.
*
* @author Kohsuke Kawaguchi
*/
@@ -122,7 +122,7 @@ public void run() {
private List<X509Certificate> candidateCertificates;

/**
* URL that points to Jenkins's tcp slave agent listener, like <tt>http://myhost/hudson/</tt>
* URL that points to Jenkins's tcp agent listener, like <tt>http://myhost/hudson/</tt>
*
* <p>
* This value is determined from {@link #candidateUrls} after a successful connection.
@@ -672,7 +672,7 @@ private void onConnectionRejected(String greeting) throws InterruptedException {
}

/**
* Connects to TCP slave host:port, with a few retries.
* Connects to TCP agent host:port, with a few retries.
* @param endpoint Connection endpoint
* @throws IOException Connection failure or invalid parameter specification
*/
@@ -34,7 +34,7 @@ public boolean accept(File dir, String name) {
public static void main(String[] argv) throws Exception {
if (argv.length != 2) {
throw new IllegalArgumentException(
"Usage: java -cp slave.jar hudson.remoting.InitializeJarCacheMain " +
"Usage: java -cp agent.jar hudson.remoting.InitializeJarCacheMain " +
"<source jar dir> <jar cache dir>");
}

@@ -128,7 +128,7 @@
public File slaveLog = null;

@Option(name="-text",usage="encode communication with the master with base64. " +
"Useful for running slave over 8-bit unsafe protocol like telnet")
"Useful for running agent over 8-bit unsafe protocol like telnet")
public void setTextMode(boolean b) {
mode = b?Mode.TEXT:Mode.BINARY;
System.out.println("Running in "+mode.name().toLowerCase(Locale.ENGLISH)+" mode");
@@ -142,7 +142,7 @@ public void setTextMode(boolean b) {
@Option(name="-jnlpCredentials",metaVar="USER:PASSWORD",usage="HTTP BASIC AUTH header to pass in for making HTTP requests.")
public String slaveJnlpCredentials = null;

@Option(name="-secret", metaVar="HEX_SECRET", usage="Slave connection secret to use instead of -jnlpCredentials.")
@Option(name="-secret", metaVar="HEX_SECRET", usage="Agent connection secret to use instead of -jnlpCredentials.")
public String secret;

@Option(name="-proxyCredentials",metaVar="USER:PASSWORD",usage="HTTP BASIC AUTH header to pass in for making HTTP authenticated proxy requests.")
@@ -283,7 +283,7 @@ public static void main(String... args) throws Exception {
launcher.run();
} catch (CmdLineException e) {
System.err.println(e.getMessage());
System.err.println("java -jar slave.jar [options...]");
System.err.println("java -jar agent.jar [options...]");
parser.printUsage(System.err);
System.err.println();
}
@@ -585,9 +585,9 @@ private SSLSocketFactory getSSLSocketFactory()
return r;
}

private static Document loadDom(URL slaveJnlpURL, InputStream is) throws ParserConfigurationException, SAXException, IOException {
private static Document loadDom(URL agentJnlpURL, InputStream is) throws ParserConfigurationException, SAXException, IOException {
DocumentBuilder db = DocumentBuilderFactory.newInstance().newDocumentBuilder();
return db.parse(is, slaveJnlpURL.toExternalForm());
return db.parse(is, agentJnlpURL.toExternalForm());
}

/**
@@ -701,9 +701,9 @@ private static void ttyCheck() {
// we seem to be running from interactive console. issue a warning.
// but since this diagnosis could be wrong, go on and do what we normally do anyway. Don't exit.
System.out.println(
"WARNING: Are you running slave agent from an interactive console?\n" +
"WARNING: Are you running agent from an interactive console?\n" +
"If so, you are probably using it incorrectly.\n" +
"See http://wiki.jenkins-ci.org/display/JENKINS/Launching+slave.jar+from+from+console");
"See https://wiki.jenkins.io/display/JENKINS/Launching+agent+from+console");
}
}

@@ -801,7 +801,7 @@ private static void closeWithLogOnly(Closeable stream, String name) {
}

/**
* Version number of Hudson this slave.jar is from.
* Version number of Hudson this agent.jar is from.
*/
public static final String VERSION = computeVersion();

@@ -58,7 +58,7 @@
import javax.annotation.Nonnull;

/**
* Entry point to JNLP slave agent.
* Entry point to JNLP agent.
*
* <p>
* See also <tt>slave-agent.jnlp.jelly</tt> in the core.
@@ -179,7 +179,7 @@

/**
* 4 mandatory parameters.
* Host name (deprecated), Jenkins URL, secret key, and slave name.
* Host name (deprecated), Jenkins URL, secret key, and agent name.
*/
@Argument
public final List<String> args = new ArrayList<String>();
@@ -189,7 +189,7 @@ public static void main(String[] args) throws IOException, InterruptedException
_main(args);
} catch (CmdLineException e) {
System.err.println(e.getMessage());
System.err.println("java -jar slave.jar [options...] <secret key> <slave name>");
System.err.println("java -jar agent.jar [options...] <secret key> <agent name>");
new CmdLineParser(new Main()).printUsage(System.err);
}
}
@@ -238,11 +238,11 @@ public void main() throws IOException, InterruptedException {
}

public Engine createEngine() {
String slaveName = args.get(1);
LOGGER.log(INFO, "Setting up slave: {0}", slaveName);
String agentName = args.get(1);
LOGGER.log(INFO, "Setting up agent: {0}", agentName);
Engine engine = new Engine(
headlessMode ? new CuiListener() : new GuiListener(),
urls, args.get(0), slaveName);
urls, args.get(0), agentName);
if(tunnel!=null)
engine.setTunnel(tunnel);
if(credentials!=null)
@@ -260,7 +260,7 @@ public Engine createEngine() {
engine.setDisableHttpsCertValidation(disableHttpsCertValidation);


// TODO: ideally logging should be initialized before the "Setting up slave" entry
// TODO: ideally logging should be initialized before the "Setting up agent" entry
if (agentLog != null) {
try {
engine.setAgentLog(PathUtils.fileToPath(agentLog));
@@ -31,7 +31,7 @@
import javax.annotation.CheckForNull;

/**
* Main window for JNLP slave agent.
* Main window for JNLP agent.
*
* @author Kohsuke Kawaguchi
*/
@@ -43,7 +43,7 @@
@SuppressFBWarnings(value = "UI_INHERITANCE_UNSAFE_GETRESOURCE",
justification = "We allow overriding this resource. Just in case")
public MainDialog() throws HeadlessException {
super("Jenkins slave agent");
super("Jenkins agent");

ImageIcon background = new ImageIcon(getClass().getResource("title.png"));

@@ -93,7 +93,7 @@ public void status(String msg) {
}

/**
* If the current JVM runs a {@link MainDialog} as a JNLP slave agent,
* If the current JVM runs a {@link MainDialog} as a JNLP agent,
* return its reference, otherwise {@code null}.
*/
@CheckForNull
@@ -25,7 +25,7 @@
* Remoting infrastructure for Hudson.
*
* <p>
* Code in this package is used for running a part of a program in slaves.
* Code in this package is used for running a part of a program in agents.
* If you are new to this package, start from {@link hudson.remoting.Channel}.
*/
package hudson.remoting;

0 comments on commit 3ce2e98

Please sign in to comment.