Performance plots for CPS in Jenkins
Things to know:
Jenkins Job project name is onap-cps-performance-tests-plots (https://jenkins.nordix.org/job/onap-cps-performance-tests-plots/)
To amend the job configuration which is managed by Jenkins Job Builder, you will need to download the infra/cicd repo and commit the changes.
Relevant files in the repo:
jjb/onap/cps/cps-performance-test-jobs.yaml
Initializes the creation of the project/job
jjb/onap/cps/prepare-performance-tests-data.sh
Contains the bash script that is run by the job
jjb/onap/global-templates-onap-java.yaml
Defines the job
Configures the HTML publisher to be added to the job as a post-build
Configures the performance tests job (onap-cps-master-performance-test-java, https://jenkins.nordix.org/job/onap-cps-master-performance-test-java/) to trigger the job 'onap-cps-performance-tests-plots' after stable build
The plot is created via the HTML publisher plugin in Jenkins
Jenkins does not allow the use of CSS and Javascript by default (unless security configurations for the server are changed)
IMPORTANT: Since the performance plot job is 'Managed by Jenkins Job Builder', all changes you create manually on the Jenkins API and not via Jenkins Job Builder will be discarded and set back to the default once the job is called via the defined trigger. Therefore, all modifications in the configuration must be made via modifying the repo files in order to update it via the Jenkins Job Builder.
Creating the performance plots via the HTML publisher plugin
The job runs by executing a shell script which follows the following steps:
After the job has executed the defined shell script, post-build actions are executed which are defined to run the HTML publisher plugin ('Publish HTML reports')
In Jenkins API, the following configuration shows:
HTML directory archive
"." - current workspace
Index pages
all html files that exists that must be included in the report
Report title
"Performance Review" - the report title to show in the Jenkins Job main page
The following configuration above corresponds to the configuration on the following file:
jjb/onap/global-templates-onap-java.yaml
The given file names must always already exist, these files are not created by the HTML publisher plugin.
Additional Information:
Setting up Jenkins locally:
Install Docker
Run Jenkins via docker image
bash: docker run -d -p 8080:8080 -p 50000:50000 --name jenkins jenkins/jenkins:lts
Access jenkins through your web browser via
Jenkins will ask for initial admin password and you can retrieve this by running the following on your terminal:
docker exec -it jenkins cat /var/jenkins_home/secrets/initialAdminPassword
On set up
Install suggested plugins
Create username and password for yourself
If you would like to test configurations on a Job you would like to modify wherein the Job is "Managed by Jenkins Job Builder", install Jenkins Job Builder locally.