Jenkins Master/Slave Configuration.
Taking our jenkins setup in concern.
We have a Jenkins instance installed on a Ubuntu 10.04 LTS machine. This machine is good enough to build Android projects through Ant build script. But in order to build iOS Application and Windows application where the build has dependencies with the OS. We cannot build these application on our Linux
i.e we need to have a Mac and Windows machines resp to build their application.
So we would need to have separate slave machines which will help the master machine to build specific tied projects at their end.
To configure the master/slave configuration.
1. Create a new node
Home page->Manage Jenkins->Manage Nodes->New Node
New node configuration:
a. enter name
b. select dump slave and click ok.
c. enter slave name
d. enter number of executors on the slave machine.
e. usage : for ties jobs.
f. Launch method : Java web start.
g. Availibility : online as much as possible.
Now on the home page you will see a new node with the given name at the left side pane with a offline symbol. Now that you have a new node, all you need to do is to connect this new node.
2. Connect the slave machie :
a. Go to the slave machine for example a Mac if you want to make slave machine for building iOS apps.
b. open the jenkins in browser.
c. click on the new node that is showing offline.
d. Click on the "Launch" java web start icon.
NOTE: Initially you would get error as the .jnlp file you have downloaded doesn't contain the correct jenkins server instance path. So you would need to edit it and then again run it by double clicking the file.
e. It will open up a little popup showing "connected" text.
f. After the slave has been connected you could actually see the slave machine online which was showing offline with the defined number of executors you set in its configuration.
g. in windows machine you could also install this java application as a service so that in case of a reboot of windows slave machine the slave can run this application and again connect itself.
h. to install as service just go to the java web application: file->install as service.
and you are done. To double check do to start->services->search "jenkins" -> openup the service and configure it if required.
Double check the connect mode is set to automatic.
3. Jobs Configuration to run on the slave:
As our slave machines are configured to run only tied jobs. Now we need to specifically tie to jobs to always execute on the slave machines. For that.
a. create a new job or go to the configuration page of a existing job
b. Below the description section there is a check box saying "Restrict where this project can be run". So check it and enter the name of the slave machine where the job should run.
c. click save.
From now onwards the job will be executed on the slave machine.
That's it!!
We have a Jenkins instance installed on a Ubuntu 10.04 LTS machine. This machine is good enough to build Android projects through Ant build script. But in order to build iOS Application and Windows application where the build has dependencies with the OS. We cannot build these application on our Linux
i.e we need to have a Mac and Windows machines resp to build their application.
So we would need to have separate slave machines which will help the master machine to build specific tied projects at their end.
To configure the master/slave configuration.
1. Create a new node
Home page->Manage Jenkins->Manage Nodes->New Node
New node configuration:
a. enter name
b. select dump slave and click ok.
c. enter slave name
d. enter number of executors on the slave machine.
e. usage : for ties jobs.
f. Launch method : Java web start.
g. Availibility : online as much as possible.
Now on the home page you will see a new node with the given name at the left side pane with a offline symbol. Now that you have a new node, all you need to do is to connect this new node.
2. Connect the slave machie :
a. Go to the slave machine for example a Mac if you want to make slave machine for building iOS apps.
b. open the jenkins in browser.
c. click on the new node that is showing offline.
d. Click on the "Launch" java web start icon.
NOTE: Initially you would get error as the .jnlp file you have downloaded doesn't contain the correct jenkins server instance path. So you would need to edit it and then again run it by double clicking the file.
e. It will open up a little popup showing "connected" text.
f. After the slave has been connected you could actually see the slave machine online which was showing offline with the defined number of executors you set in its configuration.
g. in windows machine you could also install this java application as a service so that in case of a reboot of windows slave machine the slave can run this application and again connect itself.
h. to install as service just go to the java web application: file->install as service.
and you are done. To double check do to start->services->search "jenkins" -> openup the service and configure it if required.
Double check the connect mode is set to automatic.
3. Jobs Configuration to run on the slave:
As our slave machines are configured to run only tied jobs. Now we need to specifically tie to jobs to always execute on the slave machines. For that.
a. create a new job or go to the configuration page of a existing job
b. Below the description section there is a check box saying "Restrict where this project can be run". So check it and enter the name of the slave machine where the job should run.
c. click save.
From now onwards the job will be executed on the slave machine.
That's it!!