In order to create and run a Jenkins job in cmpute, customer must execute the following steps :-
Step 1 Install Swarm Plugin
Login to Jenkins Master
Select Manage Jenkins -> Manage Plugins
Go to the Available Tab
Search for Swarm (Self-Organizing Swarm Plug-in Modules)
Select the option Install without restart (to get started immediately)
Step 2 Enable Slaves to connect through JNLP (Java Network Launch Protocol)
Login to Jenkins Master
Go to Manage Jenkins ->Configure Global Security
Under Agents, for TCP port for JNLP agents:
Select Fixed and specify a port number. Example:-8085
( or )
Step 3 Open up TCP port(s) on Jenkins Master instance
Login to AWS account
Select the Security Group of Jenkins Master instance
Under the Inbound tab:
If you selected the option Fixed in step 2, then
If you selected the option Random in step 2, then
Step 4 Ensure the Java versions on the Jenkins Master and the Jenkins Slaves are the same
While configuring the Jenkins Job in cmpute:
Specify the correct AMI id for Jenkins Slaves
Specify the Java install commands as part of the Launch Script in cmpute
Below are the steps to create Jenkins Job in cmpute
Step 1: Login to your cmpute Console Application (your-domain.cmpute.io) using registered Email Id and Password.
Step 2: You will be redirected to cmpute Dashboard. Next, click on the App Store located in the header.
Step 3: You will be redirected to the App store which has the apps supported on cmpute. To run Jenkins app, click the Run A Job button.
Step 4: Now, to run Jenkins job, fill all the required given text fields. There are following text fields to be filled:
Account: Select your AWS Account where you want to run the job
Cloud Region: The Cloud region will be selected automatically.
*Job Name: You can give any desired name to your job.*
VPC Information: If the Account has VPC associated with it, then it will get selected automatically.You can also select the desired VPC.
Subnet Information: *You can also select the desired number of subnet(s) out of all.
AMI ID: Specify the AMI ID to be used to launch instances by either providing the AMI ID or selecting an AMI from the list.
Security Groups: Specify the security group(s) to be associated with instances.
Instance Type: Select an EC2 instance type.
Restrict to Selected Instance Type: Select by clicking on the ‘Restrict to Selected Instance Type’ checkbox. If selected, selected instance type will only be launched.
Min On-demand Instance Count: Specify the minimum number of on-demand instances that should run as part of the Jenkins job.
Min Instance Count: Specify the minimum number of spot instances that should run as part of the Jenkins job
Desired Count: Specify the desired number of instances. Auto Scaling ensures that your group has this many instances.
Max Instance Count: Specify the maximum number of instances that should run as part of the Custom AMI environment.
Instance Profile: Select the Instance Profile type.
Key Pair: Select the Key Pair.
Jenkins Master IP/DNS: Specify the IP address of Jenkins master (and port number if required).
Jenkins Master user name: Specify the Jenkins master user name.
Jenkins Master Password: Specify the Jenkins master password.
Launch script: The launch script will be pre-populated by cmpute.
Associate Public IP Address: Select by clicking on the ‘Associate Public IP Address’ checkbox. cmpute will dynamically generate IP’s and associate it to the instances.
Enable Dedicated Placement Tenancy: Select by clicking on the ‘Enable Dedicated Placement Tenancy’ checkbox. If selected, then the instances will be placed in the dedicated infrastructure.
Replace Unhealthy Instances: By default the ‘Replace Unhealthy Instances’ checkbox will be selected. If selected, an unhealthy instance will be replaced with another instance.
Additional Tags: Specify one or more tags that are associated to the instances.
Scaling Rule: Specify the scaling metrics. For example:- Conditions for scaling up or down.
Step 5: Click on the Save button once you are done with filling all the details. This action will save your job and is available to see later on the Jobs page.
Step 6: On successful job addition, you would get a popup where you can either start your job immediately (by clicking Run Now) or schedule your job to run later (by clicking on the button Schedule the Job).
Step 7: You can monitor the job progress using the Job Run Details page.