diff --git a/README.md b/README.md index 8803e2a38..bf31e13a0 100644 --- a/README.md +++ b/README.md @@ -6,12 +6,12 @@ Jenkins on Mesos ---------------- -The `jenkins-mesos` plugin allows Jenkins to dynamically launch Jenkins slaves on a +The `jenkins-mesos` plugin allows Jenkins to dynamically launch Jenkins agents on a Mesos cluster depending on the workload! Put simply, whenever the Jenkins `Build Queue` starts getting bigger, this plugin automatically spins up additional Jenkins agent(s) on Mesos so that jobs can be -immediately scheduled! Similarly, when a Jenkins slave is idle for a long time it +immediately scheduled! Similarly, when a Jenkins agent is idle for a long time it is automatically shut down. ## Table of Contents @@ -25,7 +25,7 @@ is automatically shut down. - __[Docker Containers](#docker-containers)__ - __[Docker Configuration](#docker-configuration)__ - __[Over provisioning flags](#over-provisioning-flags)__ -- __[Single-Use Slave](#single-use-slave)__ +- __[Single-Use Agent](#single-use-agent)__ - __[Freestyle jobs](#freestyle-jobs)__ - __[Pipeline jobs](#pipeline-jobs)__ - __[Plugin Development](#plugin-development)__ @@ -82,26 +82,26 @@ Simply run the environment variables `DCOS_SERVICE_ACCOUNT` containing the servi ### Configuring Jenkins Jobs ### -Finally, just add the label name you have configured in Mesos cloud configuration -> Advanced -> Slave Info -> Label String (default is `mesos`) -to the jobs (configure -> Restrict where this project can run checkbox) that you want to run on a specific slave type inside Mesos cluster. +Finally, just add the label name you have configured in Mesos cloud configuration -> Advanced -> Agent Info -> Label String (default is `mesos`) +to the jobs (configure -> Restrict where this project can run checkbox) that you want to run on a specific agent type inside Mesos cluster. ### Docker Containers ### -By default, the Jenkins slaves are run in the default Mesos container. To run the Jenkins agent inside a Docker container, there are two options. +By default, the Jenkins agents are run in the default Mesos container. To run the Jenkins agent inside a Docker container, there are two options. - 1) "Use Native Docker Containerizer" : Select this option if Mesos slave(s) are configured with "--containerizers=docker" (recommended). + 1) "Use Native Docker Containerizer" : Select this option if Mesos agent(s) are configured with "--containerizers=docker" (recommended). - 2) "Use External Containerizer" : Select this option if Mesos slave(s) are configured with "--containerizers=external". + 2) "Use External Containerizer" : Select this option if Mesos agent(s) are configured with "--containerizers=external". ### Docker Configuration ### #### Volumes #### -At a minimum, a container path must be entered to mount the volume. A host path can also be specified to bind mount the container path to the host path. This will allow persistence of data between slaves on the same node. The default setting is read-write, but an option is provided for read-only use. +At a minimum, a container path must be entered to mount the volume. A host path can also be specified to bind mount the container path to the host path. This will allow persistence of data between agents on the same node. The default setting is read-write, but an option is provided for read-only use. #### Parameters #### -Additional parameters are available for the `docker run` command, but there are too many and they change too often to list all separately. This section allows you to provide any parameter you want. Ensure that your Docker version on your Mesos slaves is compatible with the parameters you add and that the values are correctly formatted. Use the full-word parameter and not the shortcut version, as these may not work properly. Also, exclude the preceding double-dash on the parameter name. For example, enter `volumes-from` and `my_container_name` to recieve the volumes from `my_container_name`. Of course `my_container_name` must already be on the Mesos slave where the Jenkins slave will run. This shouldn't cause problems in a homogenous environment where Jenkins slaves only run on particular Mesos slaves. +Additional parameters are available for the `docker run` command, but there are too many and they change too often to list all separately. This section allows you to provide any parameter you want. Ensure that your Docker version on your Mesos agents is compatible with the parameters you add and that the values are correctly formatted. Use the full-word parameter and not the shortcut version, as these may not work properly. Also, exclude the preceding double-dash on the parameter name. For example, enter `volumes-from` and `my_container_name` to recieve the volumes from `my_container_name`. Of course `my_container_name` must already be on the Mesos agent where the Jenkins agent will run. This shouldn't cause problems in a homogenous environment where Jenkins agents only run on particular Mesos agents. ### Over provisioning flags ### @@ -109,15 +109,15 @@ By default, Jenkins spawns slaves conservatively. Say, if there are 2 builds in If you want to override this behaviour and spawn an executor for each build in queue immediately without waiting, you can use these flags during Jenkins startup: `-Dhudson.slaves.NodeProvisioner.MARGIN=50 -Dhudson.slaves.NodeProvisioner.MARGIN0=0.85` -## Single-Use Slave ## +## Single-Use Agent ## ### Freestyle jobs ### -In the Build Environment settings, you may select "Mesos Single-Use Slave" to schedule disposal of the slave after the build finishes. +In the Build Environment settings, you may select "Mesos Single-Use Agent" to schedule disposal of the agent after the build finishes. ### Pipeline jobs ### -To schedule slave disposal from a Pipeline job: +To schedule agent disposal from a Pipeline job: node('mylabel') { wrap([$class: 'MesosSingleUseSlave']) { @@ -162,4 +162,3 @@ To release this plugin 1. Set the version in `build.gradle`. 2. Publish the plugin with `./gradlew publish`. - diff --git a/dcos-testing/README.md b/dcos-testing/README.md index 8aa247477..1639989fd 100644 --- a/dcos-testing/README.md +++ b/dcos-testing/README.md @@ -17,7 +17,7 @@ The `Dockerfile` defines a Docker image that supports DC/OS strict mode. It shou ``` dcos security org service-accounts create -p jenkins.pub.pem -d "Jenkins Service Account" jenkins ``` -3. Store private key as secret so that the Jenkins master can access it +3. Store private key as secret so that the Jenkins controller can access it ``` dcos security secrets create -f ./jenkins.private.pem jenkins/private_key ``` diff --git a/src/main/java/org/jenkinsci/plugins/mesos/MesosAgentSpecTemplate.java b/src/main/java/org/jenkinsci/plugins/mesos/MesosAgentSpecTemplate.java index 65f477caf..20af40f2e 100644 --- a/src/main/java/org/jenkinsci/plugins/mesos/MesosAgentSpecTemplate.java +++ b/src/main/java/org/jenkinsci/plugins/mesos/MesosAgentSpecTemplate.java @@ -119,7 +119,7 @@ public FormValidation doCheckCpus(@QueryParameter String cpus) { /** * Creates a LaunchPod command to to create a new Jenkins agent via USI * - * @param jenkinsUrl the URL of the jenkins master. + * @param jenkinsUrl the URL of the Jenkins controller. * @param name The name of the node to launch. * @param role The Mesos role for the task. * @return a LaunchPod command to be passed to USI. diff --git a/src/main/java/org/jenkinsci/plugins/mesos/MesosCloud.java b/src/main/java/org/jenkinsci/plugins/mesos/MesosCloud.java index 23a0a9ba8..008caf35a 100644 --- a/src/main/java/org/jenkinsci/plugins/mesos/MesosCloud.java +++ b/src/main/java/org/jenkinsci/plugins/mesos/MesosCloud.java @@ -296,8 +296,8 @@ public Future startAgent(String name, MesosAgentSpecTemplate spec) } /** - * Checks whether the Jenkins master itself is running as a Mesos task and thus has the env var - * MESOS_SANDBOX defined. + * Checks whether the Jenkins controller itself is running as a Mesos task and thus has the env + * var MESOS_SANDBOX defined. * * @return */ diff --git a/src/main/java/org/jenkinsci/plugins/mesos/MesosJenkinsAgent.java b/src/main/java/org/jenkinsci/plugins/mesos/MesosJenkinsAgent.java index 671c6999b..8ca4b8c2f 100644 --- a/src/main/java/org/jenkinsci/plugins/mesos/MesosJenkinsAgent.java +++ b/src/main/java/org/jenkinsci/plugins/mesos/MesosJenkinsAgent.java @@ -150,7 +150,7 @@ public synchronized boolean isPending() { } /** - * Updates the state of the slave and takes action on certain events. + * Updates the state of the agent and takes action on certain events. * * @param event The state event from USI which informs about the task status. */ @@ -194,7 +194,7 @@ protected void _terminate(TaskListener listener) { } public boolean getReusable() { - // TODO: implement reusable slaves DCOS_OSS-5048 + // TODO: implement reusable agents DCOS_OSS-5048 return reusable; } diff --git a/src/main/java/org/jenkinsci/plugins/mesos/MesosSlaveInfo.java b/src/main/java/org/jenkinsci/plugins/mesos/MesosSlaveInfo.java index e81ac0383..526307431 100644 --- a/src/main/java/org/jenkinsci/plugins/mesos/MesosSlaveInfo.java +++ b/src/main/java/org/jenkinsci/plugins/mesos/MesosSlaveInfo.java @@ -58,7 +58,7 @@ public class MesosSlaveInfo { private transient boolean defaultSlave; @SuppressFBWarnings("UUF_UNUSED_FIELD") - private transient String slaveAttributesString; // Slave attributes JSON representation. + private transient String slaveAttributesString; // Agent attributes JSON representation. /** * Resolves the old agent configuration after deserialization. @@ -94,7 +94,7 @@ JSONObject parseSlaveAttributes(String slaveAttributes) { return (JSONObject) JSONSerializer.toJSON(slaveAttributes); } catch (JSONException e) { logger.warn( - "Ignoring Mesos slave attributes JSON due to parsing error : " + slaveAttributes); + "Ignoring Mesos agent attributes JSON due to parsing error : " + slaveAttributes); } } diff --git a/src/main/java/org/jenkinsci/plugins/mesos/api/LaunchCommandBuilder.java b/src/main/java/org/jenkinsci/plugins/mesos/api/LaunchCommandBuilder.java index 0f649f55f..5a9458122 100644 --- a/src/main/java/org/jenkinsci/plugins/mesos/api/LaunchCommandBuilder.java +++ b/src/main/java/org/jenkinsci/plugins/mesos/api/LaunchCommandBuilder.java @@ -217,7 +217,9 @@ private Iterable buildAgentAttributeFilters() { } } - /** @return the Jnlp url for the agent: http://[master]/computer/[slaveName]/slave-agent.jnlp */ + /** + * @return the Jnlp url for the agent: http://[controller]/computer/[agentName]/slave-agent.jnlp + */ private URL buildJnlpUrl() throws MalformedURLException { final String path = Paths.get("computer", this.id.value(), "slave-agent.jnlp").toString(); return new URL(this.jenkinsMaster, path); diff --git a/src/main/resources/index.jelly b/src/main/resources/index.jelly index 3afcb118e..9ea8ececd 100644 --- a/src/main/resources/index.jelly +++ b/src/main/resources/index.jelly @@ -4,5 +4,5 @@ -->
This plugin can be used to connect Jenkins to a Mesos cluster - and dynamically launch Jenkins slaves based on the work load. + and dynamically launch Jenkins agents based on the work load.
diff --git a/src/main/resources/org/jenkinsci/plugins/mesos/MesosCloud/help-jenkinsURL.html b/src/main/resources/org/jenkinsci/plugins/mesos/MesosCloud/help-jenkinsURL.html index 90c25663c..36b585c9f 100644 --- a/src/main/resources/org/jenkinsci/plugins/mesos/MesosCloud/help-jenkinsURL.html +++ b/src/main/resources/org/jenkinsci/plugins/mesos/MesosCloud/help-jenkinsURL.html @@ -2,5 +2,5 @@ http://host:post where Jenkins is actually running. For ex: http://myjenkinshost:8080. Jenkins URL provided in Jenkins location configuration could be a reverse proxy URL. In that case you can override it by specifying actual Jenkins URL here. - This URL would be used by Jenkins agents spawned by Mesos plugin to talk to Jenkins Master. + This URL would be used by Jenkins agents spawned by Mesos plugin to talk to Jenkins Controller. \ No newline at end of file diff --git a/src/test/java/org/jenkinsci/plugins/mesos/integration/DockerAgentTest.java b/src/test/java/org/jenkinsci/plugins/mesos/integration/DockerAgentTest.java index 6966d7140..72f47a9b4 100644 --- a/src/test/java/org/jenkinsci/plugins/mesos/integration/DockerAgentTest.java +++ b/src/test/java/org/jenkinsci/plugins/mesos/integration/DockerAgentTest.java @@ -74,7 +74,7 @@ public void testJenkinsAgentWithDockerImage(TestUtils.JenkinsRule j) throws Exce MesosJenkinsAgent agent = (MesosJenkinsAgent) cloud.startAgent(name, spec).get(); - // verify slave is running when the future completes; + // verify agent is running when the future completes; await().atMost(5, TimeUnit.MINUTES).until(agent::isRunning); assertThat(agent.isRunning(), is(true)); }