Difference between revisions of "Jenkins"

From Software Heritage Wiki
Jump to: navigation, search
m (Jobs)
(Install redirect to docs page)
(Tag: New redirect)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
= Jenkins =
+
#REDIRECT [[swhdocs:sysadm/deployment/jenkins.html]]
 
 
The CI is run by [https://jenkins.io/ Jenkins] on jenkins.softwareheritage.org
 
 
 
== Authentication ==
 
 
 
Software Heritage staffers can login via the Jenkins Web user interface using the same personal *nix credentials they use to login into other machines.
 
 
 
== Jobs ==
 
 
 
There are 2 categories of job:
 
 
 
* jobs related to jenkins itself, like running Jenkins Job Builder, updating and managing docker images. These are found in the [https://jenkins.softwareheritage.org/job/jenkins-tools/ jenkins-tools] directory.
 
* jobs dedicated to testing/building swh packages.
 
 
 
=== Jobs definition ===
 
 
 
Most of the jobs are created using [https://docs.openstack.org/infra/jenkins-job-builder/ Jenkins Job Builder] (aka JJB).
 
 
 
The source repository is https://forge.softwareheritage.org/source/swh-jenkins-jobs/
 
 
 
Each time a new revision is pushed on this repo, the [https://jenkins.softwareheritage.org/job/jenkins-tools/job/swh-jenkins-job-builder/ JJB job] is executed. This job updates already existing jobs or create new ones (if any). Beware not to break the JJB job!
 
 
 
=== Job execution environments ===
 
 
 
Jenkins job execution may occur either on the Jenkins master node directly (typically for [https://jenkins.softwareheritage.org/job/jenkins-tools/ jenkins-tools] jobs), or in a docker jenkins slave.
 
 
 
Docker images used by Jenkins are created and updated using the Dockerfiles in 
 
https://forge.softwareheritage.org/source/swh-jenkins-dockerfiles/
 
 
 
For now, there are 2 different images:
 
 
 
* swh-jenkins/tox: a Debian stretch with python3 and tox installed; used to run unit tests; it's available in Jenkins under the label [https://jenkins.softwareheritage.org/label/swh-tox/ swh-tox]
 
* swh-jenkins/sphinx: based on the former tox image, it adds everything needed to compile the documentation with sphinx; it's available in Jenkins under the label [https://jenkins.softwareheritage.org/label/swh-sphinx/ swh-sphinx].
 
 
 
=== swh packages ===
 
 
 
Each swh package has a Jenkins [https://plugins.jenkins.io/cloudbees-folder Folder] in which are all the jobs dedicated to this package.
 
 
 
There are two jenkins jobs for each swh package:
 
 
 
* [https://jenkins.softwareheritage.org/job/DCORE/job/tox/ Phab. Diff] (here for [https://forge.softwareheritage.org/source/swh-core/ swh-core]): these jobs are executed each time a Phabricator Diff is created or updated,
 
* [https://jenkins.softwareheritage.org/job/DCORE/job/pipeline/ master branch] (here for [https://forge.softwareheritage.org/source/swh-core/ swh-core]): these jobs are executed when git revisions are pushed on the master branch.
 
 
 
When these jobs are started by Phabricator, the job's end status is pushed back on the Phabricator object that triggered the build (ie. the Diff object or the Revision object). As a result, the build status for a given Diff or git revision will be displayed in the forge.
 
 
 
The Diff in Phabricator will typically look like:
 
 
 
[[File:JenkinsDiffReport.png]]
 
 
 
The Diffusion view of a git repository will look like:
 
 
 
[[File:JenkinsRevisionReport.png]]
 
 
 
where the green "checks" in each revision means the CI passed OK on this revision.
 
 
 
=== Dashboards and metrics ===
 
 
 
The [https://jenkins.softwareheritage.org/view/swh%20dashboard/ swh dashboard] gives a global view on the CI status of swh packages. It shows all the "master branch" job status for all swh packages, as well as a few metrics for these builds (%success, code coverage, execution time, etc.)
 
 
 
=== Starting a job manually ===
 
 
 
[[File:JenkinsBuildButton.png|frameless|left]]
 
You should be able to execute any job by hand. When logged in, on the job's description page (eg. [https://jenkins.softwareheritage.org/view/swh%20dashboard/job/DCORE/job/tests/ swh-core master]) you should be able to push the "Build with Parameters" button which opens a form where you can specify the job's input parameters.
 
 
 
[[File:JenkinsRestartFromStage.png|frameless|left]]
 
[[File:JenkinsReplay.png|frameless|left]]
 
Note that you can also restart a (generally failed) job. From the job execution summary (eg. [https://jenkins.softwareheritage.org/view/swh%20dashboard/job/DCORE/job/tests/50/ this execution]) you may find a "Restart from Stage"  button (on "master branch" jobs only) or a "Replay"  button that will allow you to recreate a job with the same parameters as the original job execution.
 
 
 
== Phabricator ==
 
 
 
TODO
 
 
 
 
 
[[Category:Software development]]
 

Latest revision as of 10:03, 27 October 2021