System Requirements

The CloudBees Jenkins Platform Trial requires the following minimum specifications:

CPU architecture

x86 64-bit

Memory

4 GB (see Note below)

Disk space

20 GB (see Note below)

Operating system

Windows, Mac or Linux

Network connectivity

Must be able to connect to CloudBees servers, either directly or via a proxy

Note
While the minimum specifications above are sufficient for the base install of CloudBees Jenkins Platform, if you are planning to try out the CloudBees Jenkins Analytics, you should have at least 8 GB of memory and 80 GB of disk space in order to run the Embedded Elastic Search instance.
Note
While network connectivity to CloudBees servers is not a general requirement for running CloudBees Jenkins Operations Center, in order to reduce complexity, trial version instructions assume that you have network connectivity when you obtain a trial license.

Installing CloudBees Jenkins Platform Trial

Docker

Docker-machine setup (Windows/Mac Only)

In order to install the CloudBees Jenkins Platform Trial using Docker on Windows/Mac, you must first install the Docker Toolbox, which contains all of the necessary tooling to get started.

Go to the Docker website and download the Docker Toolbox for your operating system. Note: Virtualization must be enabled on the system as specified in the Docker installation instructions.

kitematic 1
Figure 1. Install Docker Toolbox

After installation, start a terminal or command prompt session and run the following command to create a new virtual machine:

docker-machine create --driver=virtualbox --virtualbox-memory=4096 default
Note
The virtualbox-memory parameter in the command sets the virtual machine’s memory to 4096 MB. If you also want to try CloudBees Jenkins Analytics, you should increase the parameter value to at least 8096 MB.
docker 1
Figure 2. Create docker-machine

docker-machine will now provision and start the virtual machine. After the command completes, run

docker-machine env default
docker 2
Figure 3. Set docker-machine environment

You are then prompted to "Run this command to configure your shell". Run that command to set the environment. Note that the command will be specific to your operating system.

docker 3
Figure 4. docker-machine environment

Run the following command to confirm that Docker is running and set up. There should be no error messages displayed.

docker ps
docker 4
Figure 5. Run a docker command

In order to start the CloudBees Jenkins Platform Trial, we need to obtain the IP address of the docker-machine that was just created.

docker-machine ip default
docker 5
Figure 6. Get the IP of the docker-machine

Docker Trial Start

At this point, Docker should be installed on your machine. If Docker is not installed, see the Install Docker Engine page to install Docker specifically for your operating system.

To run the CloudBees Jenkins Platform Trial, enter the following command with the IP address of the Docker host machine.

Note

If using docker-machine, this will be the IP address obtained using the docker-machine ip command. The default IP for docker-machine is 192.168.99.100.

docker run -t -v /var/run/docker.sock:/var/run/docker.sock -e JENKINS_IP={your Docker host or Docker Machine IP} cloudbees/jenkins-platform-trial

At this point, Docker downloads and starts a number of containers. Downloading containers may take some time, but download progress is displayed on the screen.

After the installation is complete, you are presented with a message saying "CloudBees Jenkins Platform Trial is available at http://[ip address]:8080" as shown below.

docker 7
Figure 7. Docker Install Complete

Additionally, more advanced Docker users will notice that the following container names will be visible via docker ps command:

  • cje1

  • cje2

  • cjoc

  • cjptrial_proxy_1

  • slave1

Open a web browser and go to http://[ip_address]:8080 in order to start the CloudBees Jenkins Operations Center UI.

Click Request a trial license to get started with Cloudbees Jenkins Platform.

docker 8
Figure 8. Requesting a Trial

Complete the evaluation request details and click the Submit button.

docker 9
Figure 9. Submit registration details

After a brief wait, you are prompted to restart the instance.

docker 10
Figure 10. Restart the instance
Note

If your server cannot access CloudBees licensing server, then you may be asked to provide details of your proxy server that can be used to connect with the CloudBees licensing server before you are asked to provide evaluation license details.

This trial already has security enabled so enter the following login credentials in the form appearing after the restart:

User: admin
Password: admin
docker 11
Figure 11. Login to the instance

On Premise

Installing CloudBees Jenkins Operations Center

To install the CloudBees Jenkins Platform, we will be downloading and starting a provided java .war file. Normally the easiest way to install CloudBees Jenkins Platform is to use the installer specific to your operating system, but this .war file install method works with all operating systems.

Jenkins requires Oracle JDK/JRE 8 or OpenJDK JDK/JRE 8 to be installed on the machine.

Run the following commands to download CloudBees Jenkins Operations Center (CJOC):

$ mkdir ~/operations-center
$ cd ~/operations-center
$ curl -L -O https://downloads.cloudbees.com/cjoc/rolling/war/2.7.19.1/jenkins-oc.war
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  154M  100  154M    0     0  6873k      0 00:00:23  0:00:23 --:--:-- 8466k
Note

For Windows, create a directory called operations-center and navigate to that directory. Download CJOC from the url displayed above and place it in the operations-center folder.

Note

The URL specified downloads the latest version of CloudBees Jenkins Operations Center server at the time of writing. This should result in the most consistent user experience with respect to this trial.

For production environments, we recommend using the latest release version of CJOC.

At this point, we will start the first instance of our CJOC server cluster.

$ JENKINS_HOME=~/operations-center java -jar jenkins-oc.war --httpPort=8080
Note

For Windows, the command to start CJOC is the same, except that for JENKINS_HOME, you specify the path to the operations-center directory. For example, using a Java option with an argument:

$ java -DJENKINS_HOME=C:\Users\Whatever\operations-center -jar jenkins-oc.war --httpPort=8080
onprem 1
Figure 12. Startup in progress

Startup can take a minute or two but is completed once the line Completed Initialization has been output.

onprem 2
Figure 13. Startup completed

At this point, you should be able to access the registration screen on the external IP, for example http://[ip-address]:8080, which will start the registration screen.

The very first thing you’ll be required to do is to insert the admin password to unlock your instance. You can retrieve it from the Jenkins start-up logs.

onprem 3a
Figure 14. Startup Logs with Admin Password
onprem 3
Figure 15. Administrator password

Click on the Request a trial license button.

docker 8
Figure 16. Requesting a Trial

Complete the evaluation request details and click the Submit button. You can now install the suggested plugins clicking on the left box.

onprem 3b
Figure 17. Install Suggested Plugins
onprem 3c
Figure 18. Installing Suggested Plugins

When the download is finished you will be given the option to create an admin user. Create one (admin/admin) and click on Save and Finish.

onprem 3d
Figure 19. Installing Suggested Plugins

Jenkins Operations Center will need to be restarted.

onprem 3e
Figure 20. Restart the Instance

After a brief wait you will be presented with a registered instance where you can insert your admin credentials created earlier.

Note

If the server cannot access CloudBees licensing server, then you may be asked to provide details of your proxy server that can be used to connect with the CloudBees licensing server before being asked to provide the evaluation license details.

At this point we will ensure that the initial configuration of CloudBees Jenkins Operations Center (CJOC) is correct.

onprem 4
Figure 21. CloudBees Jenkins Operations Center

Select Manage Jenkins » Configure System. Scroll down to the Jenkins Location section.

Ensure that the Jenkins Location » Jenkins URL setting is using the public IP address of the Jenkins server. Click the Save button.

onprem 5
Figure 22. Configure System - Jenkins URL

Now we will configure security. Select Manage Jenkins » Configure Global Security

Select Enable security. Under TCP port for JNLP slave agents, select Fixed and in the textbox enter 5000. Under the Security Realm section select Jenkins' own user database.

onprem sec 1
Figure 23. Applying the Security Realm configuration

Click Save

There should now be a log out link in the top right hand corner of the page.

onprem sec 2
Figure 24. Log Out

Click that link and verify you can now create new accounts using the sign up link on the top right hand corner.

onprem sec 3
Figure 25. Sign Up

Create new accounts for team1admin and developer. The following accounts should be created:

  • user/password: admin/admin

  • user/password: team1admin/team1admin

  • user/password: developer/developer

After creating the accounts, log back in as admin. Go back to Jenkins » Manage Jenkins » Configure Global Security. Under Authorization Strategy select Role-based matrix authorization strategy and under Import strategy select Typical initial setup.

onprem sec 5
Figure 26. Selecting role-based matrix strategy

Select Client master on-master executors » Enforce and set the # of executors to 0. Also, under the Client master security section, for Security Setting Enforcement select Single Sign-On (security realm and authorization strategy).

onprem sec 6
Figure 27. Enforcing no executors by default on client masters

In Access Control for Builds select the Add button and add the Ad-hoc cluster operations authenticator.

onprem sec 7
Figure 28. Adding the Ad-hoc cluster operations authenticator.
Note

The Ad-hoc cluster operations authenticator captures the user who is performing an ad-hoc cluster operation and then allows the operation to run as that user. If you do not have this authenticator installed then ad-hoc cluster operations - that is ones that are not defined as a item/job - will be performed as the ANONYMOUS identity and most likely will not actually do anything as that identity normally does not have any permissions in typical real-world deployments.

Save the configuration.

Configuring a Master

Now that CloudBees Jenkins Operations Center (CJOC) has been installed, a new CloudBees Jenkins Enterprise Master will be created.

Open a new Terminal window and enter the following commands:

$ mkdir ~/jenkins-team-1
$ cd ~/jenkins-team-1
$ curl -L -O http://downloads.cloudbees.com/cje/1.642/war/1.642.1.1/jenkins.war
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  141M  100  164M    0     0  6989k      0  0:00:24  0:00:24 --:--:-- 8388k
$ JENKINS_HOME=~/jenkins-team-1 java -jar jenkins.war --httpPort=8081 --prefix=/jenkins-team-1

Open another a new Terminal window and run the following commands to start another CloudBees Jenkins Enterprise Master:

$ mkdir ~/jenkins-team-2
$ cd ~/jenkins-team-2
$ curl -L -O http://downloads.cloudbees.com/cje/1.642/war/1.642.1.1/jenkins.war
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  141M  100  164M    0     0  6989k      0  0:00:24  0:00:24 --:--:-- 8388k
$ JENKINS_HOME=~/jenkins-team-2 java -jar jenkins.war --httpPort=8082 --prefix=/jenkins-team-2
Note

For Windows, create two directories jenkins-team-1 and jenkins-team-2 then download CloudBees Jenkins Enterprise from the link above and copy it into both folders. The command to run Jenkins will be the same, except that for JENKINS_HOME, you specify the path to the jenkins-team directories that were just created.

In CloudBees Jenkins Operations Center (CJOC) select New Item. Enter jenkins-team-1 as the name, and select Client Master as the type and then click OK

onprem 6
Figure 29. Creating a client master

Select Save

onprem 7
Figure 30. New Master Configuration
onprem 8
Figure 31. Newly created client master

In the Client master URL box enter the externally accessible URL of the Client Master.

  • For On Premises: http://[ip address]:8081/jenkins-team-1/

  • For AWS / Azure: http://[ip address]/

If you TAB out of the box, or otherwise leave the text box, the form validation will be triggered and you should see Jenkins instance supports configuration push from operations center underneath the Push Configuration button

onprem 9
Figure 32. Ready to push configuration

Click the Push configuration button. You should be redirected to the soon-to-be-client master.

You will be asked to insert the administration password that you can retrieve from the Jenkins instance startup logs.

onprem 9a
Figure 33. Insert Administrator Password

When submitting the administrator password you will be asked to confirm the registration to CJOC.

onprem 10
Figure 34. Confirmation for joining a cluster

Select Join Operations Center, behind the scenes the following actions will take place:

  • The connection details will be configured and the operations center connector enabled.

  • The operations center connector will establish a connection to CloudBees Jenkins Operations Center.

  • CJOC will provision a sub-license for the client master.

  • CJOC will push the contextual information to the client master.

  • The security realm and authorization strategy details will be pushed to the client master.

Before you’re able to access the newly created client master, there are a few steps left which will take you to install the suggested plugins and to create and administrator user.

onprem 10a
Figure 35. Install Suggested Plugins
onprem 10b
Figure 36. Installing Suggested Plugins
onprem 10c
Figure 37. Create Administrator User
onprem 11
Figure 38. Joined to the cluster

Configuring a Shared Build Agent

Build agents (formerly called "slaves") need to be configured. In order to configure a shared agent on CloudBees Jenkins Operations Center (CJOC), an ssh connection must be set up to another server. For simplicity’s sake on the trial version, an ssh connection can be set up to the same user on the same machine.

These instructions assume that the ssh connection has already been created using the private/public key exchange method. For more information on this, see Distributed builds

On the shared agent server (formerly called a shared slave server), create a directory called shared-slave-1 (Example could be /shared-slave-1).

In CJOC click Jenkins >> New Item. Enter shared-slave-1 as the name, and select Shared Agent as the type and then click OK

onprem 12
Figure 39. New shared agent
onprem 12a
Figure 40. New shared agent selected

The configuration page for the shared agent is displayed.

onprem 13
Figure 41. Shared agent configuration

Enter the following values:

Cloudbees Jenkins Platform includes the Non-blocking I/O variant of the SSH agent launcher, so we will use it here because it has a faster connection recycling time than the standard SSH launcher.

Table 1. Shared agent configuration
Parameter name Value

# of executors

2

Remote FS root

Location of the shared-slave-1 directory. (Example: /shared-slave-1)

Launch method

Launch slave agents on Unix machines via SSH (Non-blocking I/O)`

Host

IP address of the machine

Note

If the shared agent will be set up on a Windows machine, the Launch Method will be changed to Launch slave agents via Java Web Start. For more information, click here.

Click the Add button next to the empty Credentials drop down

onprem 14
Figure 42. Adding credentials

Change the Kind to SSH Username with private key

Enter the username that will be connecting to the shared agent server and the private key location on CloudBees Jenkins Operations Center. The private key is usually located in ~/.ssh.

Note
We need the Scope to be Global so that the credential will be made available to client masters. A scope of System would restrict the credential to CJOC only.
onprem 15
Figure 43. Adding SSH credentials

If you specified a passphrase when you created the key, you will need to provide it in the options exposed by the Advanced button.

Click Add.

The modal dialog should be removed and the newly-added credentials should be selected in the Credentials drop down.

onprem 16
Figure 44. Credentials defined

Click the Save button.

The agent should be listed as Available for lease

onprem 17
Figure 45. Configured shared agent

Cloud Platforms

Start CloudBees Instances in the Cloud

AWS

Recommended Trial AMI sizes:

  • CloudBees Jenkins Operations Center (CJOC): t2.medium (see Note below)

  • CloudBees Jenkins Enterprise Master: t2.medium

  • Shared Agent: t2.small

Note

If you would like to try out CloudBees Jenkins Analytics, the suggested minimum AWS size for CloudBees Jenkins Operations Center is m4.xlarge in order to support the embedded Elastic Search instance. Normally for a production instance, we recommend using 3 instances of m4.2xlarge for the Elastic Search cluster.

Visit this video tutorial to start the CloudBees Jenkins Operations Center Trial in an AWS Environment. Note: the video suggests a t2.large for the AMI size, but for this trial t2.medium can probably suffice. After completing the video tutorial, you should have a CloudBees Jenkins Operations Center started.

Start up 2 CloudBees Jenkins Enterprise Masters, using the same method as the video above but this time select CloudBees Jenkins Enterprise as the AMI to Launch.

Create another EC2 instance that will be used as a Shared Agent. Note: any Linux EC2 AMI can be used as long as it has Java + SSH installed.

Make sure the appropriate VPC settings are set, including:

  • Port 80 exposed so that you can access the instances created.

  • Port 22 and 5001 for communication between the different instances within the VPC.

Note the Public IP and Private IP for all 4 instances to be used later.

Azure

Recommended Trial Virtual Machine sizes:

  • CloudBees Jenkins Operations Center (CJOC): Standard_A2\Medium [2 Core - 3.5 GB] (see Note below)

  • CloudBees Jenkins Enterprise Master: Standard_A2\Medium [2 Core - 3.5 GB]

  • Shared Agent: Standard_A1\Small [1 Core - 1.75 GB]

Note

If you would like to try CloudBees Jenkins Analytics, the suggested minimum Azure size for CloudBees Jenkins Operations Center is Standard_A4\ExtraLarge [8 core - 14 GB] in order to support the embedded Elastic Search instance. Normally for a production instance, we recommend using 3 Linux instances of an external Elastic Search cluster.

Visit this video tutorial to start the CloudBees Jenkins Operations Center Trial in an Azure Environment. Make sure to select CB Jenkins Ops Center as the Virtual Machine to start.

After completing the video tutorial, you should have a CloudBees Jenkins Operations Center started.

Start up 2 CloudBees Jenkins Enterprise Masters, using the same method as the video above but this time select CB Jenkins Enterprise as the Virtual Machine to Launch.

Create another Azure VM that will be used as a Shared Agent. Any VM can be used as long as it has Java installed.

Make sure the appropriate Network Security Group settings are set including:

  • Port 80 exposed so that you can access the instances created.

  • Port 22 and 5001 for communication between the different instances within the VPC.

Note the Public IP and Private IP for all 4 instances to be used later.

Configure CloudBees Jenkins Operations Center

Open a browser to the IP Address of the CloudBees Jenkins Operations Center instance (http://[ip address]/). The "Welcome to CloudBees Jenkins Operations Center" screen should be visible.

The very first thing you’ll be required to do is to insert the admin password to unlock your instance. You can retrieve it from the Jenkins start-up logs.

onprem 3a
Figure 46. Startup Logs with Admin Password
onprem 3
Figure 47. Administrator password

Click on the Request a trial license button.

docker 8
Figure 48. Requesting a Trial

Complete the evaluation request details and click the Submit button. You can now install the suggested plugins clicking on the left box.

onprem 3b
Figure 49. Install Suggested Plugins
onprem 3c
Figure 50. Installing Suggested Plugins

When the download is finished you will be given the option to create an admin user. Create one (admin/admin) and click on Save and Finish.

onprem 3d
Figure 51. Installing Suggested Plugins

Jenkins Operations Center will need to be restarted.

onprem 3e
Figure 52. Restart the Instance

After a brief wait you will be presented with a registered instance where you can insert your admin credentials created earlier.

Note

If the server cannot access CloudBees licensing server, then you may be asked to provide details of your proxy server that can be used to connect with the CloudBees licensing server before being asked to provide the evaluation license details.

At this point we will ensure that the initial configuration of CloudBees Jenkins Operations Center (CJOC) is correct.

onprem 4
Figure 53. CloudBees Jenkins Operations Center

Select Manage Jenkins » Configure System. Scroll down to the Jenkins Location section.

Ensure that the Jenkins Location » Jenkins URL setting is using the public IP address of the Jenkins server. Click the Save button.

onprem 5
Figure 54. Configure System - Jenkins URL

Now we will configure security. Select Manage Jenkins » Configure Global Security

Select Enable security. Under TCP port for JNLP slave agents, select Fixed and in the textbox enter 5000. Under the Security Realm section select Jenkins' own user database.

onprem sec 1
Figure 55. Applying the Security Realm configuration

Click Save

There should now be a log out link in the top right hand corner of the page.

onprem sec 2
Figure 56. Log Out

Click that link and verify you can now create new accounts using the sign up link on the top right hand corner.

onprem sec 3
Figure 57. Sign Up

Create new accounts for team1admin and developer. The following accounts should be created:

  • user/password: admin/admin

  • user/password: team1admin/team1admin

  • user/password: developer/developer

After creating the accounts, log back in as admin. Go back to Jenkins » Manage Jenkins » Configure Global Security. Under Authorization Strategy select Role-based matrix authorization strategy and under Import strategy select Typical initial setup.

onprem sec 5
Figure 58. Selecting role-based matrix strategy

Select Client master on-master executors » Enforce and set the # of executors to 0. Also, under the Client master security section, for Security Setting Enforcement select Single Sign-On (security realm and authorization strategy).

onprem sec 6
Figure 59. Enforcing no executors by default on client masters

In Access Control for Builds select the Add button and add the Ad-hoc cluster operations authenticator.

onprem sec 7
Figure 60. Adding the Ad-hoc cluster operations authenticator.
Note

The Ad-hoc cluster operations authenticator captures the user who is performing an ad-hoc cluster operation and then allows the operation to run as that user. If you do not have this authenticator installed then ad-hoc cluster operations - that is ones that are not defined as a item/job - will be performed as the ANONYMOUS identity and most likely will not actually do anything as that identity normally does not have any permissions in typical real-world deployments.

Save the configuration.

Configuring a Master

In CloudBees Jenkins Operations Center (CJOC) select New Item. Enter jenkins-team-1 as the name, and select Client Master as the type and then click OK

onprem 6
Figure 61. Creating a client master

Select Save

onprem 7
Figure 62. New Master Configuration
onprem 8
Figure 63. Newly created client master

In the Client master URL box enter the externally accessible URL of the Client Master.

  • For On Premises: http://[ip address]:8081/jenkins-team-1/

  • For AWS / Azure: http://[ip address]/

If you TAB out of the box, or otherwise leave the text box, the form validation will be triggered and you should see Jenkins instance supports configuration push from operations center underneath the Push Configuration button

onprem 9
Figure 64. Ready to push configuration

Click the Push configuration button. You should be redirected to the soon-to-be-client master.

You will be asked to insert the administration password that you can retrieve from the Jenkins instance startup logs.

onprem 9a
Figure 65. Insert Administrator Password

When submitting the administrator password you will be asked to confirm the registration to CJOC.

onprem 10
Figure 66. Confirmation for joining a cluster

Select Join Operations Center, behind the scenes the following actions will take place:

  • The connection details will be configured and the operations center connector enabled.

  • The operations center connector will establish a connection to CloudBees Jenkins Operations Center.

  • CJOC will provision a sub-license for the client master.

  • CJOC will push the contextual information to the client master.

  • The security realm and authorization strategy details will be pushed to the client master.

Before you’re able to access the newly created client master, there are a few steps left which will take you to install the suggested plugins and to create and administrator user.

onprem 10a
Figure 67. Install Suggested Plugins
onprem 10b
Figure 68. Installing Suggested Plugins
onprem 10c
Figure 69. Create Administrator User
onprem 11
Figure 70. Joined to the cluster

Configuring a Shared Build Agent

Build agents (formerly called "slaves") need to be configured. In order to configure a shared agent on CloudBees Jenkins Operations Center (CJOC), an ssh connection must be set up to another server. For simplicity’s sake on the trial version, an ssh connection can be set up to the same user on the same machine.

These instructions assume that the ssh connection has already been created using the private/public key exchange method. For more information on this, see Distributed builds

On the shared agent server (formerly called a shared slave server), create a directory called shared-slave-1 (Example could be /shared-slave-1).

In CJOC click Jenkins >> New Item. Enter shared-slave-1 as the name, and select Shared Agent as the type and then click OK

onprem 12
Figure 71. New shared agent
onprem 12a
Figure 72. New shared agent selected

The configuration page for the shared agent is displayed.

onprem 13
Figure 73. Shared agent configuration

Enter the following values:

Cloudbees Jenkins Platform includes the Non-blocking I/O variant of the SSH agent launcher, so we will use it here because it has a faster connection recycling time than the standard SSH launcher.

Table 2. Shared agent configuration
Parameter name Value

# of executors

2

Remote FS root

Location of the shared-slave-1 directory. (Example: /shared-slave-1)

Launch method

Launch slave agents on Unix machines via SSH (Non-blocking I/O)`

Host

IP address of the machine

Note

If the shared agent will be set up on a Windows machine, the Launch Method will be changed to Launch slave agents via Java Web Start. For more information, click here.

Click the Add button next to the empty Credentials drop down

onprem 14
Figure 74. Adding credentials

Change the Kind to SSH Username with private key

Enter the username that will be connecting to the shared agent server and the private key location on CloudBees Jenkins Operations Center. The private key is usually located in ~/.ssh.

Note
We need the Scope to be Global so that the credential will be made available to client masters. A scope of System would restrict the credential to CJOC only.
onprem 15
Figure 75. Adding SSH credentials

If you specified a passphrase when you created the key, you will need to provide it in the options exposed by the Advanced button.

Click Add.

The modal dialog should be removed and the newly-added credentials should be selected in the Credentials drop down.

onprem 16
Figure 76. Credentials defined

Click the Save button.

The agent should be listed as Available for lease

onprem 17
Figure 77. Configured shared agent

Introduction to the CJP Trial Version

As part of the installation of the CloudBees Jenkins Platform Trial, a number of different components have been installed. The trial package comes with:

  • CloudBees Jenkins Operations Center (CJOC) http://[ip-address]:8080

  • 2 CloudBees Jenkins Enterprise masters

  • 1 Jenkins shared build agent (formerly called a "slave")

The 2 CloudBees Jenkins Masters have the following properties:

  • jenkins-team-1 Master is connected to CJOC by default http://[ip-address]:8081/jenkins-team-1/

  • jenkins-team-2 Master is not connected to CJOC by default http://[ip-address]:8082/jenkins-team-2/

A number of users have also been created by default:

  • user/password: admin/admin

  • user/password: team1admin/team1admin

  • user/password: developer/developer

Login to CloudBees Jenkins Operations Center using the admin credentials.

CloudBees Jenkins Operations Center is an operations console for Jenkins that allows you to manage the multiple Jenkins masters within your organization. The operations console is an application built on top of the Jenkins framework, so its look and feel will be familiar to anyone who is already familiar with Jenkins.

setup 1
Figure 78. Jenkins Operations Center UI

The left panel contains the navigation menus that enable you to create New items and manage CloudBees Jenkins Operations Center. The top pane contains the navigation breadcrumbs that enable you to navigate to different Folders and Masters and then back to CJOC. The main screen contains all of the items created, including the masters and build agents that are currently connected to CJOC.

Configure Security

Role-Based Access Control will now be configured to set up the authorization strategy on the CloudBees Jenkins Operations Center (CJOC), Master, and Project level. As part of the trial, there should be 3 users already created:

  • user/password: admin/admin

  • user/password: team1admin/team1admin

  • user/password: developer/developer

On the left panel of CJOC, select Groups, there should be three groups from when security was enabled:

  • Administrators with the member admin

  • Developers with no members

  • Browsers with no members

security 1a
Figure 79. The initial groups

Select Browsers group.

121
Figure 80. The Browsers group

Under the Members table, click Add user/group and add authenticated as a member of the group

security 1
Figure 81. Users group adding authenticated
security 2
Figure 82. Users group membership

After the authorization strategy has been set for the overall Jenkins Operations Center, specific administrators will be defined for the jenkins-team-1 master. Note that the permissions defined on the Jenkins Operations Center level will by default also be inherited on the specific master level.

Navigate back to the main CJOC screen and click on the down arrow that appears to the right of the jenkins-team-1 client master (the arrow appears when you hover over the item) and select Groups. Another way of navigating to the Groups screen is by clicking jenkins-team-1 and on the left hand panel, clicking Operations Center » Manage » Groups.

security 3
Figure 83. Master Groups

Select the add some? link and create a group called Team 1 Master Administrators

security 4
Figure 84. Create Groups for Master
security 5
Figure 85. Admin Group created

Give the group the administer role.

security 6
Figure 86. Add Role to the Admin Group

Save and click Add user/group and add team1admin as a member

security 7
Figure 87. Add user to Admin group
security 8
Figure 88. Group Membership

Developers will now be set up for a specific project folder in the jenkins-team-1 master. The authorization strategy that is defined on the folder level will also inherit the permissions defined on the Master and Jenkins Operations Center level.

Click on jenkins-team-1 on the top navigation bar to go back to the jenkins-team-1 page and create a new folder by clicking New Item » Folder and entering Project_1 as the Item Name.

security 9
Figure 89. Create Project Folder

Click on the Groups button on the left-hand panel.

security 10
Figure 90. Groups Button

Select the add some? link and create a group called Project 1 Developers

security 11
Figure 91. Create Groups for Project Folder
security 12
Figure 92. Developer Group created

Give the group the develop roles.

security 13
Figure 93. Add role to the Developer Group

Click Add user/group and add developer as a member

security 14
Figure 94. Add user to Developer group
security 15
Figure 95. Add user 'develop' to Developer group
security 16
Figure 96. Group Membership

Now that Role-Based Access Control has been set up, you can logout by clicking the logout button in the top right of the screen, and logging in as these users and checking the appropriate permissions.

Examples:

  • developer should not be able to create anything on the JOC or Master level, but will be able to create a new job in the Project_1 Folder.

  • admin will have full rights throughout the entire cluster

  • team1admin will have admin rights on the jenkins-team-1 master, but not on JOC.

Additional exercises can be done with Role-Based Access Control, including:

  • Creating projects that are completely secret to other users of the system

  • Creating additional users and roles with different permissions and rights. Note that to create additional users, you just sign out and click the sign up button on the top right corner

  • Integrating with LDAP/AD/SSO users and groups

  • Not inheriting permissions on certain levels

    • Having Administrators who have full access to JOC, but limited access to individual masters

For more information on configuring these scenarios, please see the RBAC documentation.

Create an Update Center

In CloudBees Jenkins Operations Center (CJOC), update center’s allow a Jenkins Administrator to define which plugins and versions should be made available to the client masters. This can be useful in standardizing the plugin that can be used across different masters as well as giving an organization the ability to enforce which plugins are "blessed" by them.

In CloudBees Jenkins Operations Center, select New Item. Enter update-center-1 as the name, and select Update Center as the type and then click OK

61
Figure 97. New update center

Configure the following settings

Plugin versioning » Strategy : Select Implicitly publish the latest version unless configured otherwise.

Content » Upstream sources : Add CloudBees Jenkins Enterprise Update Center

62
Figure 98. Configured update center

Select Save

63
Figure 99. Newly created update center

Select the Plugins tab.

NOTE: Depending on your network speed, it may take a couple of minutes for the list of plugins to be displayed in Plugins tab. This also requires internet access to display the available plugins.

64
Figure 100. The plugins tab

Select the AnsiColor plugin.

65
Figure 101. AnsiColor Plugin

Click the Store button.

When the plugin download has completed, refresh the Plugins tab and verify that the downloaded version of the plugin is the promoted version

67
Figure 102. Update center with a promoted plugin

Now that the update center has been configured, we will configure the client master to use the update center.

Select the Info tab: this view will give information about the URL of the newly created update center and a link to download a file called customer-update-center-installer-plugin.hpi which can be uploaded to the client master in order to configure it to use this as update center. However the preferred method today is to let CJOC push the configuration to the client master.

uc 1
Figure 103. Update center installer plugin

Go back to the Jenkins Operations Center home page and click the arrow to the right of the jenkins-team-1 master and select Configure.

uc 2a
Figure 104. Configure Client Master

Select Update center » Specify update center for Master » Update Center hosted on this Jenkins instance and select update-center-1.

uc 2b
Figure 105. Configuring the update center

In the jenkins-team-1 master select Manage Jenkins on the left hand panel and click Manage Plugins. Click on the Advanced tab.

uc 2c
Figure 106. Manage Plugins - Advanced Tab

Under Other Sites you should now see the URL of the update center created on CJOC (you may need to wait a few minutes for the configuration to be propagated)

Click the Check now button to check if there are any plugins available from the configured Update Center.

uc 5
Figure 107. Check Now button

After the page refreshes you should see the Update information obtained set to a couple of seconds ago.

Click on the Available tab. Now that the Update Center has been configured, the only plugin that will be visible is the AnsiColor plugin as was specified when setting up the Update Center.

uc 7
Figure 108. Client Master Available Plugins

Connect another Master

CloudBees Jenkins Operations Center (CJOC) can manage multiple masters from one interface. This guide will add a CloudBees Jenkins Enterprise Master to the CloudBees Jenkins Platform cluster.

In CloudBees Jenkins Operations Center select New Item. Enter jenkins-team-2 as the name, and select Client Master as the type and then click OK.

master2 1
Figure 109. Create new Client Master Item

On the configuration screen of the Client Master click Save.

master2 2
Figure 110. Client Master Configuration Screen

The Manage screen will be visible for the Client Master. We’ll need to copy the connection details in the client master, so leave this page open.

master2 3a
Figure 111. Client Master Configuration Screen

Open a new tab in your browser and navigate to http://[ip-address]:8082/jenkins-team-2/

master2 4a
Figure 112. jenkins-team-2

In your terminal run docker logs jenkins-team-2 to retrieve the administration password asked by the form above.

master2 4b
Figure 113. jenkins-team-2 Admin Password

Copy and insert that information in the box and submit.

Now, you would need to choose the type of license to use for this instance. Since we are connecting the client master to our Jenkins Operations Center we’ll select Join a CloudBees Jenkins Operations Center master where we can insert the connection details we have in the jenkins-team-2 Manage screen on CJOC in the other tab of your browser.

master2 5a
Figure 114. Join CJOC
master2 5b
Figure 115. Insert the Connection Details

Once done you will be asked to install the suggested plugins on your client master. Do so clicking on the left box.

master2 6a
Figure 116. Install Suggested Plugins
master2 6b
Figure 117. Installing Suggested Plugins

When the installation is completed you will be able to start using CloudBees Jenkins Enterprise for your jenkins-team-2 instance.

master2 7a
Figure 118. Start Using CloudBees Jenkins Enterprise
master2 7b
Figure 119. jenkins-team-2 attached to CJOC

The new Jenkins instance is now licensed and connected to CloudBees Jenkins Operations Center. Use the breadcrumb on the top panel in order to navigate back to CloudBees Jenkins Operations Center.

master2 8a
Figure 120. Connected Client Master

Single-Sign On has also been configured between Masters, so the same authentication and authorization strategy has been inherited from CloudBees Jenkins Operations Center.

Create a Pipeline

If you’re using the CloudBees Jenkins Platform Trial docker image you will already see a pipeline job created as example in jenkins-team-1 client master. Otherwise if you’re running a fresh installation you will have to create one yourself.

In a Client Master select Manage JenkinsConfigure System. Scroll down to Maven and select Add Maven. Enter in "M3" as the name and select a version and then click Save. In this case version '3.3.9' was selected.

233
Figure 121. Configuring the Maven tool installer

In Jenkins select New Item. Enter "pipeline-1" as the name, and select Pipeline as the type and then click OK

234
Figure 122. Creating a new Pipeline

On the configuration page, in the Pipeline Definition editor, click on the "try a sample pipeline" choice box and select "Github + Maven".

235
Figure 123. Configuring the Pipeline

Where node is the step that schedules the tasks in the following block on whatever agent with the label specified in its argument. In this case, the block’s tasks will only be run on an agent with the label ‘linux’. The node block is required to tell Jenkins what system to run the commands.

The stage step allows sections of the pipeline to split up into different phases. The Stage View will visualize these different stages when a build is run.

git is the step that specifies what source code repository code should be checked from and does the checkout at this point.

The tool step makes sure a tool with the given name, in this case, a specific version of the Maven build tool, is installed on the current agent. Merely running this step does not do much good; the script needs to know where it was installed, so the tool can be run later. For this, we need a variable.

The def keyword in Groovy is the quickest way to define a new variable, hence the “def mvnHome”. The return value of the tool ‘M3’ check is assigned to the mvnHome variable.

The sh allows the Jenkins server or agent running on Linux or a Unix-like machine to execute a shell script.

Note
If you are using a Windows based system, the sh command will fail. In this case make sure to change the pipeline code to use the the bat command instead.

Click Save.

On the project page, click Build Now and the a build should start with the stages being displayed in the Stage View.

236
Figure 124. Running a Pipeline

Pipeline also allows for the creation of very complex pipelines, with parallel stages, conditional logic gates, and for definitions to be loaded from version control and shared between pipelines. This allows for pipelines and certain standardized scripts to be shared between teams and changes to these scripts to be protected and reviewed by an administrator. More information on complex pipelines can be found in the CloudBees Jenkins Cookbook and in the Pipeline repository.

Another concept introduced with pipeline is the idea of Pipeline as Code. Pipeline as Code allows Jenkins users to define pipelined job processes with code, stored and versioned in a source repository. These features allow Jenkins to discover, manage, and run jobs for multiple source repositories and branches — eliminating the need for manual job creation and management. A tutorial can be found in the Cloudbees Jenkins Cookbook along with more details on the exact features.

An extension of Pipeline as Code is the idea of Organization Folders within CloudBees Jenkins Platform. Organization Folders will scan your SCM for all repositories that contain a Jenkinsfile and will create a Jenkins project for each repository and branch. Organization Folders are currently supported with Github, Github Enterprise, and Bitbucket Online.

Tutorials for CloudBees Pipeline Organization Folders:

Configure Analytics

CloudBees Jenkins Analytics (CJA) provides insight into your usage of Jenkins and the health of your Jenkins cluster.

CloudBees Jenkins Analytics can help answer such questions as:

  • Why is Jenkins running slowly?

  • What is the job failure rate for a label or master?

  • How long are jobs waiting in the queue?

  • How is the number of jobs and builds growing over time?

  • When should I assign more resources to Jenkins?

Note

In production, we generally recommend a 1-3 node Elastic Search cluster of 32GB RAM each in order to not experience any slowness or degraded performance while running CloudBees Jenkins Analytics.

Before proceding any further we need to install Operations Center Analytics Configuration plugin and Operations Center Analytics Reporter plugin on the client masters you have tied to CJOC (jenkins-team-1, jenkins-team-2).

For each instance, go to Manage JenkinsManage Plugins and in the Available tab look for these two plugins and install them.

analytics 1
Figure 125. Configure Remote Elasticsearch Instance

In CloudBees Jenkins Operations Center (CJOC), click Manage JenkinsConfigure Analytics.

Under the Analytics section, for Elasticsearch Configuation select Remote Elastic Search Instance(s).

analytics 1a
Figure 126. Configure Remote Elasticsearch Instance

Configure it with the details of your remote elasticsearch instance and click Save.

After Elastic Search has been enabled, the Client Master should start reporting data to CloudBees Jenkins Analytics.

While restarting CJOC is not required, it is recommended as some functionality will not work until a restart is done.

Go to http://[ip address]:8080/restart and click the Yes button when asked whether to restart Jenkins.

analytics 2
Figure 127. Restart CloudBees Jenkins Operations Center

Any new builds that are executed will be collected and visualized within the CloudBees Analytics Dashboards.

Go back to the Pipeline that was created in the Pipeline section and start the job. In Jenkins Operations Center, click the Build Analytics Tab at the top to view the Analytics on the completed pipeline job.

analytics 3
Figure 128. Build Analytics

CloudBees Jenkins Analytics also has the ability to collect data and visualize data from historical builds before the Analytics was turned on. In order to do this, we must create a Cluster Operation Job to Reindex the Analytics. This will scan all builds within a connected Jenkins Master and submit them for collection.

In CloudBees Jenkins Operations Center select New Item. Enter reindex-cluster-op as the name, select Cluster Operations as the type, and then click OK.

analytics 4
Figure 129. Cluster Operation

Click the Add Operations button and select Masters so that the operation we want to perform will apply to the client masters.

analytics 5
Figure 130. Adding a Masters operation.

We now need to specify which masters the operation(s) will apply to. In our case we want to reindex all masters so select From Operations Center Root in the Source section.

analytics 6
Figure 131. Masters from Operations Center Root

In the steps section click the Add Step button and select Reindex for Analytics.

analytics 7
Figure 132. Adding a Reindex Analytics step

Click Save.

In order to run the Reindex Operation on the masters, click on the Run button. After the Cluster Operation has completed, you will start to see the historical build results as well in the Build Analytics tabs.

analytics 8
Figure 133. Reindex Analytics Job

As part of Jenkins Analytics, there are a number of built-in dashboards that are grouped by function. In Build Analytics or Performance Analytics, click on the tabs at the left hand to view different metrics such as Build Results or Build queue times.

A couple of things to note:

  1. The currently selected Analytics dashboard is indicated at the left sidebar.

  2. Navigation between related reports of the current dashboard is available on the left.

  3. Masters can be filtered by clicking on their names in chart legends

  4. Many panels are clickable and will drill-down (filter) results to only include the given value.

  5. Once a drill-down filter is enabled, Dashboards will display a filters tab allowing to set complex filtering conditions

  6. You can zoom in on a histogram by clicking and dragging to limit the data displayed.

Analytics also provides the functionality to determine the health of connected Jenkins Masters by displaying the JVM information and performance data specific to masters. In Jenkins Operations Center click on the Performance Analytics tab at the top to view the built-in dashboards specific to the health of the connected masters.

analytics 9
Figure 134. Performace Analytics

For more information on Analytics or to create your own custom dashboards based on the data collected see the documentation.

Next Steps

After completing some of the major features presented in this guide, you can now explore the full 80+ features of the CloudBees Jenkins Platform.

Suggestions:

Start your Subscription

To get started with a CloudBees Jenkins Platform subscription contact sales@cloudbees.com