CloudBees Documentation » Space Index » Customer Provided Executors

Customer Provided Executors

Last modified by Ben Walding on 2013/01/17 02:58

Customer provided executors is a feature of DEV@cloud that allows customers to connect a slave from Linux, Mac OSX or Windows using the Jenkins CLI.  

There are several reasons why you might want to provide your own executor (slave):

  • You require access to internal network resources such as private databases or source control systems
  • You need a specific operating system or libraries which aren't provided on DEV@Cloud
  • You need to run performance tests on tuned hardware/software stacks

BETA

This is a beta/preview feature which should not be considered stable. It may disappear or significantly change without notice. Please fill out the survey to let us know what you think.

Getting started

First of all, the jenkins-cli.jar is needed. A cli jar of at least version 1.460 is needed (Note that DEV@cloud is currently using Jenkins 1.447 but the latest versions of the CLI are needed to work well). Also create a workspace directory for the jobs to be executed in.

Next, you will need an SSH keypair for authentication. It is recommended that one is generated specifically for this purpose, especially if the slave will be connected from a server. The public key needs to be added to your user account on GrandCentral

Connecting the slave

Below is the basic usage of the cli.
$ java -jar jenkins-cli.jar -s https://<myaccount>.ci.cloudbees.com -i ~/.ssh/id_rsa customer-managed-slave -help:
"-help" is not a valid option
java -jar jenkins-cli.jar customer-managed-slave args...
Connects a customer managed slave
-description VAL : Description to be put on the slave
-executors N     : Number of executors
-fsroot VAL      : Directory where Jenkins places files
-labels VAL      : Whitespace-separated list of labels to be assigned for this
                    slave. Multiple options are allowed.
-name VAL        : Name of the slave. If unspecified, one is generated for you

-s specifies the address of your jenkins instance.
-i is optional if the key you want to use is /.ssh/id_rsa or /.ssh/id_dsa. For other key-files a path will need to be specified. Note the SSH key must be an openssh key.

A full command is something like:

$ java -jar jenkins-cli.jar -s https://jenkins.ci.cloudbees.com customer-managed-slave -fsroot /path/to/root -labels osx -name osx-server-2

An important piece is the label. Labels allow you to connect multiple slaves, and have jobs choose any slave that matches the label.

Configuring a job to run on the provided slave

Currently to make a job run on the provided slave, you need to select  "Restrict where this project can be run" in the job configuration page, and input your label you want the job to run on.

Jobs configured to run on provided slaves will not run on the CloudBees elastic slaves, and jobs with no label set, will not run on provided slaves.

Configuring the slaves environment [linux, osx only]

Because of how the masters are configured at the moment,  to use some tools like maven you may need to provide the tool in the location Jenkins expects it to be, either directly, or with a symlink. Below are the paths that are used for the JDK's and Maven's. You can inspect /opt on DEV@cloud slaves with a job to find other provided tools if needed.

Java parent path: /opt/jdk

Java versions under the parent path:

  • ibmjdk6 
  • jdk1.5.0_22
  • jdk1.6.0_20
  • jdk1.6.0_24
  • dk1.6.0_30 
  • jdk1.7.0
  • jdk1.7.0_04

Maven parent path: /opt/maven

Maven versions under the parent:

  • apache-maven-2.0.11
  • apache-maven-2.2.1
  • apache-maven-3.0.1
  • apache-maven-3.0.3
  • apache-maven-3.0.4

Known Issues

  • You must provide an absolute path for the -fsroot parameter.
  • If you receive an error such as "FATAL: Null value not allowed as an environment variable: M2_HOME", make sure that you have configured a valid installer for the Maven you are using. You can do this by navigating to /configure (Manage Jenkins -> Configure System) and click "Install Automatically" underneath the Maven job you are using. You can then choose "Install from Apache" and select the appropriate version.

Security

All users on your account are allowed to connect slaves using their registered public/private keypair.

All communication to and from your slave is secured by HTTPS.

Give us your feedback

If you have tried (or not tried) the feature - fill in a short poll for us (takes about 30 secs).

Tags:
Created by Ivan Meredith on 2012/05/31 06:49