4 The `Release Engineering Project <releng-wiki_>`_ consolidates the Jenkins jobs from
5 project-specific VMs to a single Jenkins server. Each OpenDaylight project
6 has a tab for their jobs on the `jenkins-master`_. The system utilizes
7 `Jenkins Job Builder <jjb-docs_>`_ for the creation and management of the
19 The `jenkins-master`_ is the home for all project's Jenkins jobs. All
20 maintenance and configuration of these jobs must be done via JJB through the
21 `releng-builder-repo`_. Project contributors can no longer edit the Jenkins jobs
22 directly on the server.
27 The Jenkins jobs are run on build slaves (executors) which are created on an
28 as-needed basis. If no idle build slaves are available a new VM is brought
29 up. This process can take up to 2 minutes. Once the build slave has finished a
30 job, it will remain online for 45 minutes before shutting down. Subsequent
31 jobs will use an idle build slave if available.
33 Our Jenkins master supports many types of dynamic build slaves. If you are
34 creating custom jobs then you will need to have an idea of what type of slaves
35 are available. The following are the current slave types and descriptions.
36 Slave Template Names are needed for jobs that take advantage of multiple
37 slaves as they must be specifically called out by template name instead of
40 Adding New Components to the Slaves
41 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
43 If your project needs something added to one of the slaves used during build
44 and test you can help us get things added faster by doing one of the following:
46 * Submit a patch to RelEng/Builder for the `spinup-scripts`_ that
47 configures your new piece of software.
48 * Submit a patch to RelEng/Builder for the Vagrant template's bootstrap.sh in
49 the `vagrant-definitions`_ directory that configures your new piece of
52 Going the first route will be faster in the short term as we can inspect the
53 changes and make test modifications in the sandbox to verify that it works.
55 The second route, however, is better for the community as a whole as it will
56 allow others that utilize our Vagrant setups to replicate our systems more
57 closely. It is, however, more time consuming as an image snapshot needs to be
58 created based on the updated Vagrant definition before it can be attached to
59 the sandbox for validation testing.
61 In either case, the changes must be validated in the sandbox with tests to
62 make sure that we don't break current jobs and that the new software features
63 are operating as intended. Once this is done the changes will be merged and
64 the updates applied to the RelEng Jenkins production silo.
66 Please note that the combination of a Vagrant slave snapshot and a Jenkins
67 spinup script is what defines a given slave. For instance, a slave may be
68 defined by the `vagrant-basic-java-node`_ Vagrant definition
69 and the `spinup-scripts-controller.sh`_ Jenkins spinup script
70 (as the dynamic\_controller slave is). The pair provides the full definition of
71 the realized slave. Jenkins starts a slave using the last-spun Vagrant snapshot
72 for the specified definition. Once the base Vagrant instance is online Jenkins
73 checks out the RelEng/Builder repo on it and executes two scripts. The first is
74 `spinup-scripts-basic_settings.sh`_, which is a baseline for all of the slaves.
76 the specialized spinup script, which handles any system updates, new software
77 installs or extra environment tweaks that don't make sense in a snapshot. After
78 all of these scripts have executed Jenkins will finally attach the slave as an
79 actual slave and start handling jobs on it.
81 Pool: Rackspace - Docker
82 ^^^^^^^^^^^^^^^^^^^^^^^^
88 <td><b>Jenkins Label</b><br/> dynamic_docker</td>
89 <td><b>Slave Template name</b><br/> rk-f20-docker</td>
90 <td><b>Vagrant Definition</b><br/> releng/builder/vagrant/ovsdb-docker</td>
91 <td><b>Spinup Script</b><br/> releng/builder/jenkins-scripts/docker.sh</td>
95 A Fedora 20 system that is configured with OpenJDK 1.7 (aka Java7) and
96 Docker. This system was originally custom built for the test needs of
97 the OVSDB project but other projects have expressed interest in using
110 <td><b>Jenkins Label</b><br/> dynamic_verify</td>
111 <td><b>Slave Template name</b><br/> rk-c-el65-build</td>
112 <td><b>Vagrant Definition</b><br/> releng/builder/vagrant/basic-builder</td>
113 <td><b>Spinup Script</b><br/> releng/builder/jenkins-scripts/builder.sh</td>
117 A CentOS 6 build slave. This system has OpenJDK 1.7 (Java7) and OpenJDK
118 1.8 (Java8) installed on it along with all the other components and
119 libraries needed for building any current OpenDaylight project. This is
120 the label that is used for all basic -verify and -daily- builds for
128 <td><b>Jenkins Label</b><br/> dynamic_merge</td>
129 <td><b>Slave Template name</b><br/> rk-c-el65-build</td>
130 <td><b>Vagrant Definition</b><br/> releng/builder/vagrant/basic-builder</td>
131 <td><b>Spinup Script</b><br/> releng/builder/jenkins-scripts/builder.sh</td>
135 See dynamic_verify (same image on the back side). This is the label that
136 is used for all basic -merge and -integration- builds for projects.
141 Pool: Rackspace DFW - Devstack
142 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
148 <td><b>Jenkins Label</b><br/> dynamic_devstack</td>
149 <td><b>Slave Template name</b><br/> rk-c7-devstack</td>
150 <td><b>Vagrant Definition</b><br/> releng/builder/vagrant/ovsdb-devstack</td>
151 <td><b>Spinup Script</b><br/> releng/builder/jenkins-scripts/devstack.sh</td>
155 A CentOS 7 system purpose built for doing OpenStack testing using
156 DevStack. This slave is primarily targeted at the needs of the OVSDB
157 project. It has OpenJDK 1.7 (aka Java7) and other basic DevStack related
163 Pool: Rackspace DFW - Integration
164 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
170 <td><b>Jenkins Label</b><br/> dynamic_robot</td>
171 <td><b>Slave Template name</b><br/> rk-c-el6-robot</td>
172 <td><b>Vagrant Definition</b><br/> releng/builder/vagrant/integration-robotframework</td>
173 <td><b>Spinup Script</b><br/> releng/builder/jenkins-scripts/robot.sh</td>
177 A CentOS 6 slave that is configured with OpenJDK 1.7 (Java7) and all the
178 current packages used by the integration project for doing robot driven
179 jobs. If you are executing robot framework jobs then your job should be
180 using this as the slave that you are tied to. This image does not
181 contain the needed libraries for building components of OpenDaylight,
182 only for executing robot tests.
187 Pool: Rackspace DFW - Integration Dynamic Lab
188 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
194 <td><b>Jenkins Label</b><br/> dynamic_controller</td>
195 <td><b>Slave Template name</b><br/> rk-c-el6-java</td>
196 <td><b>Vagrant Definition</b><br/> releng/builder/vagrant/basic-java-node</td>
197 <td><b>Spinup Script</b><br/> releng/builder/jenkins-scripts/controller.sh</td>
201 A CentOS 6 slave that has the basic OpenJDK 1.7 (Java7) installed and is
202 capable of running the controller, not building.
209 <td><b>Jenkins Label</b><br/> dynamic_java</td>
210 <td><b>Slave Template name</b><br/> rk-c-el6-java</td>
211 <td><b>Vagrant Definition</b><br/> releng/builder/vagrant/basic-java-node</td>
212 <td><b>Spinup Script</b><br/> releng/builder/jenkins-scripts/controller.sh</td>
216 See dynamic_controller as it is currently the same image.
223 <td><b>Jenkins Label</b><br/> dynamic_mininet</td>
224 <td><b>Slave Template name</b><br/> rk-c-el6-mininet</td>
225 <td><b>Vagrant Definition</b><br/> releng/builder/vagrant/basic-mininet-node</td>
226 <td><b>Spinup Script</b><br/> releng/builder/jenkins-scripts/mininet.sh</td>
230 A CentOS 6 image that has mininet, openvswitch v2.0.x, netopeer and
231 PostgreSQL 9.3 installed. This system is targeted at playing the role of
232 a mininet system for integration tests. Netopeer is installed as it is
233 needed for various tests by Integration. PostgreSQL 9.3 is installed as
234 the system is also capable of being used as a VTN project controller and
235 VTN requires PostgreSQL 9.3.
242 <td><b>Jenkins Label</b><br/> dynamic_mininet_fedora</td>
243 <td><b>Slave Template name</b><br/> rk-f21-mininet</td>
244 <td><b>Vagrant Definition</b><br/> releng/builder/vagrant/basic-mininet-fedora-node</td>
245 <td><b>Spinup Script</b><br/> releng/builder/jenkins-scripts/mininet-fedora.sh</td>
249 Basic Fedora 21 system with ovs v2.3.x and mininet 2.2.1
256 <td><b>Jenkins Label</b><br/> ubuntu_mininet</td>
257 <td><b>Slave Template name</b><br/> ubuntu-trusty-mininet</td>
258 <td><b>Vagrant Definition</b><br/> releng/builder/vagrant/ubuntu-mininet</td>
259 <td><b>Spinup Script</b><br/> releng/builder/jenkins-scripts/mininet-ubuntu.sh</td>
263 Basic Ubuntu system with ovs 2.0.2 and mininet 2.1.0
270 <td><b>Jenkins Label</b><br/> ubuntu_mininet_ovs_23</td>
271 <td><b>Slave Template name</b><br/> ubuntu-trusty-mininet-ovs-23</td>
272 <td><b>Vagrant Definition</b><br/> releng/builder/vagrant/ubuntu-mininet-ovs-23</td>
273 <td><b>Spinup Script</b><br/> releng/builder/jenkins-scripts/mininet-ubuntu.sh</td>
277 Basic Ubuntu system with ovs 2.3 and mininet 2.2.1
282 Pool: Rackspace DFW - Matrix
283 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
289 <td><b>Jenkins Label</b><br/> matrix_master</td>
290 <td><b>Slave Template name</b><br/> rk-c-el6-matrix</td>
291 <td><b>Vagrant Definition</b><br/> releng/builder/vagrant/basic-java-node</td>
292 <td><b>Spinup Script</b><br/> releng/builder/jenkins-scripts/matrix.sh</td>
296 This is a very minimal system that is designed to spin up with 2 build
297 instances on it. The purpose is to have a location that is not the
298 Jenkins master itself for jobs that are executing matrix operations
299 since they need a director location. This image should not be used for
300 anything but tying matrix jobs before the matrx defined label ties.
305 Creating Jenkins Jobs
306 ---------------------
308 Jenkins Job Builder takes simple descriptions of Jenkins jobs in YAML format
309 and uses them to configure Jenkins.
311 * `Jenkins Job Builder (JJB) documentation <jjb-docs_>`_
312 * `RelEng/Builder Gerrit <releng-builder-gerrit_>`_
313 * `RelEng/Builder Git repository <releng-builder-repo_>`_
315 Getting Jenkins Job Builder
316 ---------------------------
318 OpenDaylight uses Jenkins Job Builder to translate our in-repo YAML job
319 configuration into job descriptions suitable for consumption by Jenkins.
320 When testing new Jenkins Jobs in the `Jenkins Sandbox`_, you'll
321 need to use the `jenkins-jobs` executable to translate a set of jobs into
322 their XML descriptions and upload them to the sandbox Jenkins server.
324 We document `installing <Installing Jenkins Job Builder_>`_ `jenkins-jobs`
325 below. We also provide
326 a `pre-built Docker image <jjb-docker_>`_ with `jenkins-jobs` already installed.
328 Installing Jenkins Job Builder
329 ------------------------------
331 For users who aren't already experienced with Docker or otherwise don't want
332 to use our `pre-built JJB Docker image <jjb-docker_>`_, installing JJB into a
333 virtual environment is an equally good option.
335 We recommend using `pip <Installing JJB using pip_>`_ to assist with JJB
337 also document `installing from a git repository manually
338 <Installing JJB Manually_>`_.
339 For both, we recommend using Python `Virtual Environments`_
340 to isolate JJB and its dependencies.
342 The `builder/jjb/requirements.txt <odl-jjb-requirements.txt_>`_ file contains the currently
343 recommended JJB version. Because JJB is fairly unstable, it may be necessary
344 to debug things by installing different versions. This is documented for both
345 `pip-assisted <Installing JJB using pip_>`_ and `manual
346 <Installing JJB Manually_>`_ installs.
351 For both `pip-assisted <Installing JJB using pip_>`_ and `manual
352 <Installing JJB Manually_>`_ JJB
353 installs, we recommend using `Python Virtual Environments <python-virtualenv_>`_
354 to manage JJB and its
355 Python dependencies. The `python-virtualenvwrapper`_ tool can help you do so.
357 There are good docs for installing `python-virtualenvwrapper`_. On Linux systems
358 with pip (typical), they amount to:
362 sudo pip install virtualenvwrapper
364 A virtual environment is simply a directory that you install Python programs
365 into and then append to the front of your path, causing those copies to be
366 found before any system-wide versions.
368 Create a new virtual environment for JJB.
372 # Virtaulenvwrapper uses this dir for virtual environments
374 /home/daniel/.virtualenvs
375 # Make a new virtual environment
377 # A new venv dir was created
378 (jjb)$ ls -rc $WORKON_HOME | tail -n 1
380 # The new venv was added to the front of this shell's path
382 /home/daniel/.virtualenvs/jjb/bin:<my normal path>
383 # Software installed to venv, like pip, is found before system-wide copies
384 (jjb)$ command -v pip
385 /home/daniel/.virtualenvs/jjb/bin/pip
387 With your virtual environment active, you should install JJB. Your install will
388 be isolated to that virtual environment's directory and only visible when the
389 virtual environment is active.
391 You can easily leave and return to your venv. Make sure you activate it before
397 $ command -v jenkins-jobs
398 # No jenkins-jobs executable found
400 (jjb)$ command -v jenkins-jobs
401 $WORKON_HOME/jjb/bin/jenkins-jobs
403 Installing JJB using pip
404 ------------------------
406 The recommended way to install JJB is via pip.
408 First, clone the latest version of the `releng-builder-repo`_.
412 $ git clone https://git.opendaylight.org/gerrit/p/releng/builder.git
414 Before actually installing JJB and its dependencies, make sure you've `created
415 and activated <Virtual Environments_>`_ a virtual environment for JJB.
421 The recommended version of JJB to install is the version specified in the
422 `builder/jjb/requirements.txt <odl-jjb-requirements.txt_>`_ file.
426 # From the root of the releng/builder repo
427 (jjb)$ pip install -r jjb/requirements.txt
429 To validate that JJB was successfully installed you can run this command:
433 (jjb)$ jenkins-jobs --version
435 To change the version of JJB specified by `builder/jjb/requirements.txt
436 <odl-jjb-requirements.txt_>`_
437 to install from the latest commit to the master branch of JJB's git repository:
441 $ cat jjb/requirements.txt
442 -e git+https://git.openstack.org/openstack-infra/jenkins-job-builder#egg=jenkins-job-builder
444 To install from a tag, like 1.4.0:
448 $ cat jjb/requirements.txt
449 -e git+https://git.openstack.org/openstack-infra/jenkins-job-builder@1.4.0#egg=jenkins-job-builder
451 Installing JJB Manually
452 -----------------------
454 This section documents installing JJB from its manually cloned repository.
456 Note that `installing via pip <Installing JJB using pip_>`_ is typically simpler.
458 Checkout the version of JJB's source you'd like to build.
460 For example, using master:
464 $ git clone https://git.openstack.org/openstack-infra/jenkins-job-builder
466 Using a tag, like 1.4.0:
470 $ git clone https://git.openstack.org/openstack-infra/jenkins-job-builder
471 $ cd jenkins-job-builder
472 $ git checkout tags/1.4.0
474 Before actually installing JJB and its dependencies, make sure you've `created
475 and activated <Virtual Environments_>`_ a virtual environment for JJB.
481 You can then use JJB's `requirements.txt <jjb-requirements.txt_>`_ file to
483 dependencies. Note that we're not using `sudo` to install as root, since we want
484 to make use of the venv we've configured for our current user.
488 # In the cloned JJB repo, with the desired version of the code checked out
489 (jjb)$ pip install -r requirements.txt
491 Then install JJB from the repo with:
497 To validate that JJB was successfully installed you can run this command:
501 (jjb)$ jenkins-jobs --version
506 `Docker <docker-docs_>`_ is an open platform used to create virtualized Linux containers
507 for shipping self-contained applications. Docker leverages LinuX Containers
508 \(LXC\) running on the same operating system as the host machine, whereas a
509 traditional VM runs an operating system over the host.
513 docker pull zxiiro/jjb-docker
514 docker run --rm -v ${PWD}:/jjb jjb-docker
516 This `Dockerfile <jjb-dockerfile_>`_ created the
517 `zxiiro/jjb-docker image <jjb-docker_>`_.
518 By default it will run:
524 You'll need to use the `-v/--volume=[]` parameter to mount a directory
525 containing your YAML files, as well as a configured `jenkins.ini` file if you
526 wish to upload your jobs to the `Jenkins Sandbox`_.
528 Jenkins Job Templates
529 ---------------------
531 The OpenDaylight `RelEng/Builder <releng-builder-wiki_>`_ project provides
532 `jjb-templates`_ that can be used to define basic jobs.
539 The Verify job template creates a Gerrit Trigger job that will trigger when a
540 new patch is submitted to Gerrit.
542 Verify jobs can be retriggered in Gerrit by leaving a comment that says
550 The Merge job template is similar to the Verify Job Template except it will
551 trigger once a Gerrit patch is merged into the repo. It also automatically
552 runs the Maven goals **source:jar** and **javadoc:jar**.
554 This job will upload artifacts to `OpenDaylight's Nexus <odl-nexus_>`_ on completion.
556 Merge jobs can be retriggered in Gerrit by leaving a comment that says
562 The Daily (or Nightly) Job Template creates a job which will run on a build on
563 a Daily basis as a sanity check to ensure the build is still working day to
569 Trigger: **run-sonar**
571 This job runs Sonar analysis and reports the results to `OpenDaylight's Sonar
572 dashboard <odl-sonar_>`_.
574 The Sonar Job Template creates a job which will run against the master branch,
575 or if BRANCHES are specified in the CFG file it will create a job for the
576 **First** branch listed.
578 .. note:: Running the "run-sonar" trigger will cause Jenkins to remove its
579 existing vote if it's already -1'd or +1'd a comment. You will need to
580 re-run your verify job (recheck) after running this to get Jenkins to
583 Integration Job Template
584 ^^^^^^^^^^^^^^^^^^^^^^^^
586 The Integration Job Template creates a job which runs when a project that your
587 project depends on is successfully built. This job type is basically the same
588 as a verify job except that it triggers from other Jenkins jobs instead of via
589 Gerrit review updates. The dependencies that triger integration jobs are listed
590 in your project.cfg file under the **DEPENDENCIES** variable.
592 If no dependencies are listed then this job type is disabled by default.
594 Distribution Test Job
595 ^^^^^^^^^^^^^^^^^^^^^
597 Trigger: **test-distribution**
599 This job builds a distrbution against your patch, passes distribution sanity test
600 and reports back the results to Gerrit. Leave a comment with trigger keyword above
601 to activate it for a particular patch.
603 This job is maintained by the Integration/Test (`integration-test-wiki`_) project.
605 .. note:: Running the "test-distribution" trigger will cause Jenkins to remove
606 it's existing vote if it's already -1 or +1'd a comment. You will need
607 to re-run your verify job (recheck) after running this to get Jenkins
608 to put back the correct vote.
613 Trigger: **test-integration**
615 This job runs a full integration test suite against your patch and reports
616 back the results to Gerrit. Leave a comment with trigger keyword above to activate it
617 for a particular patch.
619 This job is maintained by the Integration/Test (`integration-test-wiki`_) project.
621 .. note:: Running the "test-integration" trigger will cause Jenkins to remove
622 it's existing vote if it's already -1 or +1'd a comment. You will need
623 to re-run your verify job (recheck) after running this to get Jenkins
624 to put back the correct vote.
626 Some considerations when using this job:
628 * The patch test verification takes some time (~2 hours) + consumes a lot of
629 resources so it is not meant to be used for every patch.
630 * The system tests for master patches will fail most of the times because both
631 code and test are unstable during the release cycle (should be good by the
633 * Because of the above, patch test results typically have to be interpreted by
634 system test experts. The Integration/Test (`integration-test-wiki`_) project
638 Autorelease Validate Job
639 ^^^^^^^^^^^^^^^^^^^^^^^^
641 Trigger: **revalidate**
643 This job runs the PROJECT-validate-autorelease-BRANCH job which is used as a
644 quick sanity test to ensure that a patch does not depend on features that do
645 not exist in the current release.
647 The **revalidate** trigger is useful in cases where a project's verify job
648 passed however validate failed due to infra problems or intermittent issues.
649 It will retrigger just the validate-autorelease job.
651 Basic Job Configuration
652 -----------------------
654 To create jobs based on existing `templates <Jenkins Job Templates_>`_, use the
655 `jjb-init-project.py`_ helper script. When run from the root of
656 `RelEng/Builder's repo <releng-builder-repo_>`_, it will produce a file in
657 `jjb/<project>/<project>.yaml` containing your project's base template.
661 $ python scripts/jjb-init-project.py --help
662 usage: jjb-init-project.py [-h] [-c CONF] [-d DEPENDENCIES] [-t TEMPLATES]
663 [-s STREAMS] [-p POM] [-g MVN_GOALS] [-o MVN_OPTS]
664 [-a ARCHIVE_ARTIFACTS]
667 positional arguments:
671 -h, --help show this help message and exit
672 -c CONF, --conf CONF Config file
673 -d DEPENDENCIES, --dependencies DEPENDENCIES
674 Project dependencies A comma-seperated (no spaces)
675 list of projects your project depends on. This is used
676 to create an integration job that will trigger when a
677 dependent project-merge job is built successfully.
678 Example: aaa,controller,yangtools
679 -t TEMPLATES, --templates TEMPLATES
681 -s STREAMS, --streams STREAMS
682 Release streams to fill with default options
683 -p POM, --pom POM Path to pom.xml to use in Maven build (Default:
685 -g MVN_GOALS, --mvn-goals MVN_GOALS
687 -o MVN_OPTS, --mvn-opts MVN_OPTS
689 -a ARCHIVE_ARTIFACTS, --archive-artifacts ARCHIVE_ARTIFACTS
690 Comma-seperated list of patterns of artifacts to
691 archive on build completion. See:
692 http://ant.apache.org/manual/Types/fileset.html
694 If all your project requires is the basic verify, merge, and daily jobs then
695 using the job template should be all you need to configure for your jobs.
697 Auto-Update Job Templates
698 ^^^^^^^^^^^^^^^^^^^^^^^^^
700 The first line of the job YAML file produced by the `jjb-init-project.py`_ script will
701 contain the words `# REMOVE THIS LINE IF...`. Leaving this line will allow the
702 RelEng/Builder `jjb-autoupdate-project.py`_ script to maintain this file for your project,
703 should the base templates ever change. It is a good idea to leave this line if
704 you do not plan to create any complex jobs outside of the provided template.
706 However, if your project needs more control over your jobs or if you have any
707 additional configuration outside of the standard configuration provided by the
708 template, then this line should be removed.
713 Allowing the auto-updated to manage your templates doesn't prevent you from
714 doing some configuration changes. Parameters can be passed to templates via
715 a `<project>.cfg` in your `builder/jjb/<project>` directory. An example is
716 provided below, others can be found in the repos of other projects. Tune as
717 necessary. Unnecessary paramaters can be removed or commented out with a "#"
722 JOB_TEMPLATES: verify,merge,sonar
726 jdks: openjdk7,openjdk8
729 branch: stable/lithium
732 MVN_GOALS: clean install javadoc:aggregate -DrepoBuild -Dmaven.repo.local=$WORKSPACE/.m2repo -Dorg.ops4j.pax.url.mvn.localRepository=$WORKSPACE/.m2repo
733 MVN_OPTS: -Xmx1024m -XX:MaxPermSize=256m
734 DEPENDENCIES: aaa,controller,yangtools
735 ARCHIVE_ARTIFACTS: *.logs, *.patches
737 .. note:: `STREAMS <streams-design-background_>`_ is a list of branches you want
738 JJB to generate jobs for.
739 The first branch will be the branch that reports Sonar analysis. Each
740 branch must define a "jdks:" section listing the JDKs the verify jobs
741 should run tests against for the branch. The first JDK listed will be
742 used as the default JDK for non-verify type jobs.
744 .. note:: Projects that are participating in the simultanious release should set
745 "autorelease: true" under the streams they are participating in
746 autorelease for. This enables a new job type validate-autorelease
747 which is used to help identify if Gerrit patches might break
753 It is also possible to take advantage of both the auto-updater and creating
754 your own jobs. To do this, create a YAML file in your project's sub-directory
755 with any name other than \<project\>.yaml. The auto-update script will only
756 search for files with the name \<project\>.yaml. The normal \<project\>.yaml
757 file can then be left in tact with the "# REMOVE THIS LINE IF..." comment so
758 it will be automatically updated.
763 We provide a properties which your job can take advantage of if you want to do
764 something different depending on the job type that is run. If you create a
765 profile that activates on a property listed blow. The JJB templated jobs will
766 be able to activate the profile during the build to run any custom code you
767 wish to run in your project.
771 -Dmerge : This flag is passed in our Merge job and is equivalent to the
774 -Dsonar : This flag is passed in our Sonar job and is equivalent to the
781 The `jenkins-sandbox`_ instance's purpose is to allow projects to test their JJB
782 setups before merging their code over to the RelEng master silo. It is
783 configured similarly to the master instance, although it cannot publish
784 artifacts or vote in Gerrit.
786 If your project requires access to the sandbox please open an OpenDaylight
787 Helpdesk ticket (<helpdesk@opendaylight.org>) and provide your ODL ID.
789 Notes Regarding the Sandbox
790 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
792 * Jobs are automatically deleted every Saturday at 08:00 UTC
793 * Committers can login and configure Jenkins jobs in the sandbox directly
794 (unlike with the master silo)
795 * Sandbox configuration mirrors the master silo when possible
796 * Sandbox jobs can NOT upload artifacts to Nexus
797 * Sandbox jobs can NOT vote on Gerrit
802 Make sure you have Jenkins Job Builder [properly installed](#jjb_install).
804 If you do not already have access, open an OpenDaylight Helpdesk ticket
805 (<helpdesk@opendaylight.org>) to request access to ODL's sandbox instance.
806 Integration/Test (`integration-test-wiki`_) committers have access by default.
808 JJB reads user-specific configuration from a `jenkins.ini`_. An
809 example is provided by releng/builder at `example-jenkins.ini`_.
813 # If you don't have RelEng/Builder's repo, clone it
814 $ git clone https://git.opendaylight.org/gerrit/p/releng/builder.git
815 # Make a copy of the example JJB config file (in the builder/ directory)
816 $ cp jenkins.ini.example jenkins.ini
817 # Edit jenkins.ini with your username, API token and ODL's sandbox URL
821 user=<your ODL username>
822 password=<your ODL Jenkins sandbox API token>
823 url=https://jenkins.opendaylight.org/sandbox
826 To get your API token, `login to the Jenkins **sandbox** instance
827 <jenkins-sandbox-login_>`_ (_not
828 the main master Jenkins instance, different tokens_), go to your user page (by
829 clicking on your username, for example), click "Configure" and then "Show API
835 If you `installed JJB locally into a virtual environment
836 <Installing Jenkins Job Builder_>`_,
837 you should now activate that virtual environment to access the `jenkins-jobs`
845 You'll want to work from the root of the RelEng/Builder repo, and you should
846 have your `jenkins.ini` file [properly configured](#sandbox_config).
851 It's good practice to use the `test` command to validate your JJB files before
856 jenkins-jobs --conf jenkins.ini test jjb/ <job-name>
858 If the job you'd like to test is a template with variables in its name, it
859 must be manually expanded before use. For example, the commonly used template
860 `{project}-csit-verify-1node-{functionality}` might expand to
861 `ovsdb-csit-verify-1node-netvirt`.
865 jenkins-jobs --conf jenkins.ini test jjb/ ovsdb-csit-verify-1node-netvirt
867 Successful tests output the XML description of the Jenkins job described by
868 the specified JJB job name.
873 Once you've `configured your \`jenkins.ini\` <Configuration_>`_ and `verified your
874 JJB jobs <Testing Jobs_>`_ produce valid XML descriptions of Jenkins jobs you
875 can push them to the Jenkins sandbox.
879 When pushing with `jenkins-jobs`, a log message with the number
880 of jobs you're pushing will be issued, typically to stdout.
881 **If the number is greater than 1** (or the number of jobs you
882 passed to the command to push) then you are pushing too many
883 jobs and should **`ctrl+c` to cancel the upload**. Else you will
884 flood the system with jobs.
888 INFO:jenkins_jobs.builder:Number of jobs generated: 1
890 **Failing to provide the final `<job-name>` param will push all
895 # Don't push all jobs by omitting the final param! (ctrl+c to abort)
896 jenkins-jobs --conf jenkins.ini update jjb/ <job-name>
901 Once you have your Jenkins job configuration `pushed to the
902 Sandbox <Pushing Jobs_>`_ you can trigger it to run.
904 Find your newly-pushed job on the `Sandbox's web UI <jenkins-sandbox_>`_. Click
905 on its name to see the job's details.
907 Make sure you're `logged in <jenkins-sandbox-login_>`_ to the Sandbox.
909 Click "Build with Parameters" and then "Build".
911 Wait for your job to be scheduled and run. Click on the job number to see
912 details, including console output.
914 Make changes to your JJB configuration, re-test, re-push and re-run until
920 If `using Docker <JJB Docker image_>`_:
925 docker run --rm -v ${PWD}:/jjb zxiiro/jjb-docker
929 When pushing with `jenkins-jobs`, a log message with
930 the number of jobs you're pushing will be issued, typically to stdout.
931 **If the number is greater than 1** (or the number of jobs you passed to
932 the command to push) then you are pushing too many jobs and should **`ctrl+c`
933 to cancel the upload**. Else you will flood the system with jobs.
937 INFO:jenkins_jobs.builder:Number of jobs generated: 1
939 **Failing to provide the final `<job-name>` param will push all jobs!**
943 # To upload jobs to the sandbox
944 # Please ensure that you include a configured jenkins.ini in your volume mount
945 # Making sure not to push more jobs than expected, ctrl+c to abort
946 docker run --rm -v ${PWD}:/jjb zxiiro/jjb-docker jenkins-jobs --conf jenkins.ini update . openflowplugin-csit-periodic-1node-cds-longevity-only-master
948 .. _docker-docs: https://www.docker.com/whatisdocker/
949 .. _example-jenkins.ini: https://git.opendaylight.org/gerrit/gitweb?p=releng/builder.git;a=blob;f=jenkins.ini.example
950 .. _integration-test-wiki: https://wiki.opendaylight.org/view/Integration/Test
951 .. _jenkins-master: https://jenkins.opendaylight.org/releng
952 .. _jenkins-sandbox: https://jenkins.opendaylight.org/sandbox
953 .. _jenkins-sandbox-login: https://jenkins.opendaylight.org/sandbox/login
954 .. _jenkins.ini: http://docs.openstack.org/infra/jenkins-job-builder/execution.html#configuration-file
955 .. _jjb-autoupdate-project.py: https://git.opendaylight.org/gerrit/gitweb?p=releng/builder.git;a=blob;f=scripts/jjb-autoupdate-project.py
956 .. _jjb-docker: https://hub.docker.com/r/zxiiro/jjb-docker/
957 .. _jjb-dockerfile: https://github.com/zxiiro/jjb-docker/blob/master/Dockerfile
958 .. _jjb-docs: http://ci.openstack.org/jenkins-job-builder/
959 .. _jjb-init-project.py: https://git.opendaylight.org/gerrit/gitweb?p=releng/builder.git;a=blob;f=scripts/jjb-init-project.py
960 .. _jjb-repo: https://github.com/openstack-infra/jenkins-job-builder
961 .. _jjb-requirements.txt: https://github.com/openstack-infra/jenkins-job-builder/blob/master/requirements.txt
962 .. _jjb-templates: https://git.opendaylight.org/gerrit/gitweb?p=releng/builder.git;a=tree;f=jjb
963 .. _odl-jjb-requirements.txt: https://git.opendaylight.org/gerrit/gitweb?p=releng/builder.git;a=blob;f=jjb/requirements.txt
964 .. _odl-nexus: https://nexus.opendaylight.org
965 .. _odl-sonar: https://sonar.opendaylight.org
966 .. _python-virtualenv: https://virtualenv.readthedocs.org/en/latest/
967 .. _python-virtualenvwrapper: https://virtualenvwrapper.readthedocs.org/en/latest/
968 .. _releng-wiki: https://wiki.opendaylight.org/view/RelEng:Main
969 .. _releng-builder-gerrit: https://git.opendaylight.org/gerrit/#/admin/projects/releng/builder
970 .. _releng-builder-repo: https://git.opendaylight.org/gerrit/gitweb?p=releng%2Fbuilder.git;a=summary
971 .. _releng-builder-wiki: https://wiki.opendaylight.org/view/RelEng/Builder
972 .. _streams-design-background: https://lists.opendaylight.org/pipermail/release/2015-July/003139.html
973 .. _spinup-scripts: https://git.opendaylight.org/gerrit/gitweb?p=releng/builder.git;a=tree;f=jenkins-scripts
974 .. _spinup-scripts-basic_settings.sh: https://git.opendaylight.org/gerrit/gitweb?p=releng/builder.git;a=blob;f=jenkins-scripts/basic_settings.sh
975 .. _spinup-scripts-controller.sh: https://git.opendaylight.org/gerrit/gitweb?p=releng/builder.git;a=blob;f=jenkins-scripts/controller.sh
976 .. _vagrant-basic-java-node: https://git.opendaylight.org/gerrit/gitweb?p=releng/builder.git;a=tree;f=vagrant/basic-java-node
977 .. _vagrant-definitions: https://git.opendaylight.org/gerrit/gitweb?p=releng/builder.git;a=tree;f=vagrant