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
16 New Project Quick Start
17 -----------------------
19 This section attempts to provide details on how to get going as a new project
20 quickly with minimal steps. The rest of the guide should be read and understood
21 by those who need to create and contribute new job types that is not already
22 covered by the existing job templates provided by OpenDaylight's JJB repo.
24 As a new project you will be mainly interested in getting your jobs to appear
25 in the jenkins-master_ silo and this can be achieved by simply creating a
26 <project>.yaml in the releng/builder project's jjb directory.
30 git clone https://git.opendaylight.org/gerrit/releng/builder
32 mkdir jjb/<new-project>
34 Where <new-project> should be the same name as your project's git repo in
35 Gerrit. So if your project is called "aaa" then create a new jjb/aaa directory.
37 Next we will create <new-project>.yaml as follows:
42 name: <NEW_PROJECT>-carbon
44 - '{project-name}-clm-{stream}'
45 - '{project-name}-distribution-{stream}'
46 - '{project-name}-integration-{stream}'
47 - '{project-name}-merge-{stream}'
48 - '{project-name}-periodic-{stream}'
49 - '{project-name}-verify-{stream}-{maven}-{jdks}'
51 project: '<NEW_PROJECT>'
52 project-name: '<NEW_PROJECT>'
60 mvn-version: '{mvn33}'
61 mvn-settings: '<NEW_PROJECT>-settings'
62 mvn-goals: 'clean install -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
63 mvn-opts: '-Xmx1024m -XX:MaxPermSize=256m'
64 dependencies: 'odlparent-merge-{stream},yangtools-merge-{stream},controller-merge-{stream}'
65 email-upstream: '[<NEW_PROJECT>] [odlparent] [yangtools] [controller]'
69 name: <NEW_PROJECT>-sonar
71 - '{project-name}-sonar'
73 project: '<NEW_PROJECT>'
74 project-name: '<NEW_PROJECT>'
76 mvn-settings: '<NEW_PROJECT>-settings'
77 mvn-goals: 'clean install -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
78 mvn-opts: '-Xmx1024m -XX:MaxPermSize=256m'
80 Replace all instances of <new-project> with the name of your project. This will
81 create the jobs with the default job types we recommend for Java projects. If
82 your project is participating in the simultanious-release and ultimately will
83 be included in the final distribution. We recommend adding the following job
84 types into the job list for the release you are participating.
89 - '{project-name}-distribution-check-{stream}'
90 - '{project-name}-validate-autorelease-{stream}'
92 If you'd like to explore the additional tweaking options available
93 please refer to the `Jenkins Job Templates`_ section.
95 Finally we need to push these files to Gerrit for review by the releng/builder
96 team to push your jobs to Jenkins.
100 git add jjb/<new-project>
101 git commit -sm "Add <new-project> jobs to Jenkins"
104 This will push the jobs to Gerrit and your jobs will appear in Jenkins once the
105 releng/builder team has reviewed and merged your patch.
110 The `jenkins-master`_ is the home for all project's Jenkins jobs. All
111 maintenance and configuration of these jobs must be done via JJB through the
112 `releng-builder-repo`_. Project contributors can no longer edit the Jenkins jobs
113 directly on the server.
118 The Jenkins jobs are run on build minions (executors) which are created on an
119 as-needed basis. If no idle build minions are available a new VM is brought
120 up. This process can take up to 2 minutes. Once the build minion has finished a
121 job, it will remain online for 45 minutes before shutting down. Subsequent
122 jobs will use an idle build minion if available.
124 Our Jenkins master supports many types of dynamic build minions. If you are
125 creating custom jobs then you will need to have an idea of what type of minions
126 are available. The following are the current minion types and descriptions.
127 Minion Template Names are needed for jobs that take advantage of multiple
128 minions as they must be specifically called out by template name instead of
131 Adding New Components to the Minions
132 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
134 If your project needs something added to one of the minions used during build
135 and test you can help us get things added faster by doing one of the following:
137 * Submit a patch to RelEng/Builder for the `spinup-scripts`_ that
138 configures your new piece of software.
139 * Submit a patch to RelEng/Builder for the Vagrant template's bootstrap.sh in
140 the `vagrant-definitions`_ directory that configures your new piece of
143 Going the first route will be faster in the short term as we can inspect the
144 changes and make test modifications in the sandbox to verify that it works.
146 The second route, however, is better for the community as a whole as it will
147 allow others that utilize our Vagrant setups to replicate our systems more
148 closely. It is, however, more time consuming as an image snapshot needs to be
149 created based on the updated Vagrant definition before it can be attached to
150 the sandbox for validation testing.
152 In either case, the changes must be validated in the sandbox with tests to
153 make sure that we don't break current jobs and that the new software features
154 are operating as intended. Once this is done the changes will be merged and
155 the updates applied to the RelEng Jenkins production silo.
157 Please note that the combination of a Vagrant minion snapshot and a Jenkins
158 spinup script is what defines a given minion. For instance, a minion may be
159 defined by the `vagrant-basic-java-node`_ Vagrant definition
160 and the `spinup-scripts-controller.sh`_ Jenkins spinup script
161 (as the dynamic\_controller minion is). The pair provides the full definition of
162 the realized minion. Jenkins starts a minion using the last-spun Vagrant snapshot
163 for the specified definition. Once the base Vagrant instance is online Jenkins
164 checks out the RelEng/Builder repo on it and executes two scripts. The first is
165 `spinup-scripts-basic_settings.sh`_, which is a baseline for all of the minions.
167 the specialized spinup script, which handles any system updates, new software
168 installs or extra environment tweaks that don't make sense in a snapshot. After
169 all of these scripts have executed Jenkins will finally attach the minion as an
170 actual minion and start handling jobs on it.
177 <table class="table table-bordered">
179 <td><b>Jenkins Label</b><br/> dynamic_verify</td>
180 <td><b>Minion Template name</b><br/> centos7-builder</td>
181 <td><b>Vagrant Definition</b><br/> releng/builder/vagrant/basic-builder</td>
182 <td><b>Spinup Script</b><br/> releng/builder/jenkins-scripts/builder.sh</td>
186 A CentOS 7 huild minion. This system has OpenJDK 1.7 (Java7) and OpenJDK
187 1.8 (Java8) installed on it along with all the other components and
188 libraries needed for building any current OpenDaylight project. This is
189 the label that is used for all basic -verify and -daily- builds for
195 <td><b>Jenkins Label</b><br/> dynamic_merge</td>
196 <td><b>Minion Template name</b><br/> centos7-builder</td>
197 <td><b>Vagrant Definition</b><br/> releng/builder/vagrant/basic-builder</td>
198 <td><b>Spinup Script</b><br/> releng/builder/jenkins-scripts/builder.sh</td>
202 See dynamic_verify (same image on the back side). This is the label that
203 is used for all basic -merge and -integration- builds for projects.
208 <td><b>Jenkins Label</b><br/> matrix_master</td>
209 <td><b>Minion Template name</b><br/> centos7-matrix</td>
210 <td><b>Vagrant Definition</b><br/> releng/builder/vagrant/basic-java-node</td>
211 <td><b>Spinup Script</b><br/> releng/builder/jenkins-scripts/matrix.sh</td>
215 This is a very minimal system that is designed to spin up with 2 build
216 instances on it. The purpose is to have a location that is not the
217 Jenkins master itself for jobs that are executing matrix operations
218 since they need a director location. This image should not be used for
219 anything but tying matrix jobs before the matrx defined label ties.
224 <td><b>Jenkins Label</b><br/> dynamic_robot</td>
225 <td><b>Minion Template name</b><br/> centos7-robot</td>
226 <td><b>Vagrant Definition</b><br/> releng/builder/vagrant/integration-robotframework</td>
227 <td><b>Spinup Script</b><br/> releng/builder/jenkins-scripts/robot.sh</td>
231 A CentOS 7 minion that is configured with OpenJDK 1.7 (Java7), OpenJDK
232 1.8 (Java8) and all the current packages used by the integration
233 project for doing robot driven jobs. If you are executing robot
234 framework jobs then your job should be using this as the minion that
235 you are tied to. This image does not contain the needed libraries for
236 building components of OpenDaylight, only for executing robot tests.
241 <td><b>Jenkins Label</b><br/> ubuntu_mininet</td>
242 <td><b>Minion Template name</b><br/> ubuntu-trusty-mininet</td>
243 <td><b>Vagrant Definition</b><br/> releng/builder/vagrant/ubuntu-mininet</td>
244 <td><b>Spinup Script</b><br/> releng/builder/jenkins-scripts/mininet-ubuntu.sh</td>
248 Basic Ubuntu system with ovs 2.0.2 and mininet 2.1.0
253 <td><b>Jenkins Label</b><br/> ubuntu_mininet_ovs_23</td>
254 <td><b>Minion Template name</b><br/> ubuntu-trusty-mininet-ovs-23</td>
255 <td><b>Vagrant Definition</b><br/> releng/builder/vagrant/ubuntu-mininet-ovs-23</td>
256 <td><b>Spinup Script</b><br/> releng/builder/jenkins-scripts/mininet-ubuntu.sh</td>
260 Basic Ubuntu system with ovs 2.3 and mininet 2.2.1
265 <td><b>Jenkins Label</b><br/> ubuntu_mininet_ovs_25</td>
266 <td><b>Minion Template name</b><br/> ubuntu-trusty-mininet-ovs-25</td>
267 <td><b>Vagrant Definition</b><br/> releng/builder/vagrant/ubuntu-mininet-ovs-25</td>
268 <td><b>Spinup Script</b><br/> releng/builder/jenkins-scripts/mininet-ubuntu.sh</td>
272 Basic Ubuntu system with ovs 2.5 and mininet 2.2.2
277 <td><b>Jenkins Label</b><br/> dynamic_controller</td>
278 <td><b>Minion Template name</b><br/> centos7-java</td>
279 <td><b>Vagrant Definition</b><br/> releng/builder/vagrant/basic-java-node</td>
280 <td><b>Spinup Script</b><br/> releng/builder/jenkins-scripts/controller.sh</td>
284 A CentOS 7 minion that has the basic OpenJDK 1.7 (Java7) and OpenJDK
285 1.8 (Java8) installed and is capable of running the controller, not
291 <td><b>Jenkins Label</b><br/> dynamic_java</td>
292 <td><b>Minion Template name</b><br/> centos7-java</td>
293 <td><b>Vagrant Definition</b><br/> releng/builder/vagrant/basic-java-node</td>
294 <td><b>Spinup Script</b><br/> releng/builder/jenkins-scripts/controller.sh</td>
298 See dynamic_controller as it is currently the same image.
303 <td><b>Jenkins Label</b><br/> dynamic_java_8g</td>
304 <td><b>Minion Template name</b><br/> centos7-java-8g</td>
305 <td><b>Vagrant Definition</b><br/> releng/builder/vagrant/basic-java-node</td>
306 <td><b>Spinup Script</b><br/> releng/builder/jenkins-scripts/controller.sh</td>
310 See dynamic_controller as it is currently the same image but with 8G of RAM.
315 <td><b>Jenkins Label</b><br/> dynamic_devstack</td>
316 <td><b>Minion Template name</b><br/> centos7-devstack</td>
317 <td><b>Vagrant Definition</b><br/> releng/builder/vagrant/ovsdb-devstack</td>
318 <td><b>Spinup Script</b><br/> releng/builder/jenkins-scripts/devstack.sh</td>
322 A CentOS 7 system purpose built for doing OpenStack testing using
323 DevStack. This minion is primarily targeted at the needs of the OVSDB
324 project. It has OpenJDK 1.7 (aka Java7) and OpenJDK 1.8 (Java8) and
325 other basic DevStack related bits installed.
330 <td><b>Jenkins Label</b><br/> dynamic_docker</td>
331 <td><b>Minion Template name</b><br/> centos7-docker</td>
332 <td><b>Vagrant Definition</b><br/> releng/builder/vagrant/ovsdb-docker</td>
333 <td><b>Spinup Script</b><br/> releng/builder/jenkins-scripts/docker.sh</td>
337 A CentOS 7 system that is configured with OpenJDK 1.7 (aka Java7),
338 OpenJDK 1.8 (Java8) and Docker. This system was originally custom
339 built for the test needs of the OVSDB project but other projects have
340 expressed interest in using it.
345 <td><b>Jenkins Label</b><br/> gbp_trusty</td>
346 <td><b>Minion Template name</b><br/> gbp_trusty</td>
347 <td><b>Vagrant Definition</b><br/> releng/builder/vagrant/gbp-ubuntu-docker-ovs-node</td>
348 <td><b>Spinup Script</b><br/> releng/builder/jenkins-scripts/ubuntu-docker-ovs.sh</td>
352 A basic Ubuntu node with latest OVS and docker installed. Used by Group Based Policy.
357 Creating Jenkins Jobs
358 ---------------------
360 Jenkins Job Builder takes simple descriptions of Jenkins jobs in YAML format
361 and uses them to configure Jenkins.
363 * `Jenkins Job Builder (JJB) documentation <jjb-docs_>`_
364 * `RelEng/Builder Gerrit <releng-builder-gerrit_>`_
365 * `RelEng/Builder Git repository <releng-builder-repo_>`_
367 Getting Jenkins Job Builder
368 ---------------------------
370 OpenDaylight uses Jenkins Job Builder to translate our in-repo YAML job
371 configuration into job descriptions suitable for consumption by Jenkins.
372 When testing new Jenkins Jobs in the `Jenkins Sandbox`_, you'll
373 need to use the `jenkins-jobs` executable to translate a set of jobs into
374 their XML descriptions and upload them to the sandbox Jenkins server.
376 We document `installing <Installing Jenkins Job Builder_>`_ `jenkins-jobs`
377 below. We also provide
378 a `pre-built Docker image <jjb-docker_>`_ with `jenkins-jobs` already installed.
380 Installing Jenkins Job Builder
381 ------------------------------
383 For users who aren't already experienced with Docker or otherwise don't want
384 to use our `pre-built JJB Docker image <jjb-docker_>`_, installing JJB into a
385 virtual environment is an equally good option.
387 We recommend using `pip <Installing JJB using pip_>`_ to assist with JJB
389 also document `installing from a git repository manually
390 <Installing JJB Manually_>`_.
391 For both, we recommend using Python `Virtual Environments`_
392 to isolate JJB and its dependencies.
394 The `builder/jjb/requirements.txt <odl-jjb-requirements.txt_>`_ file contains the currently
395 recommended JJB version. Because JJB is fairly unstable, it may be necessary
396 to debug things by installing different versions. This is documented for both
397 `pip-assisted <Installing JJB using pip_>`_ and `manual
398 <Installing JJB Manually_>`_ installs.
403 For both `pip-assisted <Installing JJB using pip_>`_ and `manual
404 <Installing JJB Manually_>`_ JJB
405 installs, we recommend using `Python Virtual Environments <python-virtualenv_>`_
406 to manage JJB and its
407 Python dependencies. The `python-virtualenvwrapper`_ tool can help you do so.
409 There are good docs for installing `python-virtualenvwrapper`_. On Linux systems
410 with pip (typical), they amount to:
414 sudo pip install virtualenvwrapper
416 A virtual environment is simply a directory that you install Python programs
417 into and then append to the front of your path, causing those copies to be
418 found before any system-wide versions.
420 Create a new virtual environment for JJB.
424 # Virtaulenvwrapper uses this dir for virtual environments
426 /home/daniel/.virtualenvs
427 # Make a new virtual environment
429 # A new venv dir was created
430 (jjb)$ ls -rc $WORKON_HOME | tail -n 1
432 # The new venv was added to the front of this shell's path
434 /home/daniel/.virtualenvs/jjb/bin:<my normal path>
435 # Software installed to venv, like pip, is found before system-wide copies
436 (jjb)$ command -v pip
437 /home/daniel/.virtualenvs/jjb/bin/pip
439 With your virtual environment active, you should install JJB. Your install will
440 be isolated to that virtual environment's directory and only visible when the
441 virtual environment is active.
443 You can easily leave and return to your venv. Make sure you activate it before
449 $ command -v jenkins-jobs
450 # No jenkins-jobs executable found
452 (jjb)$ command -v jenkins-jobs
453 $WORKON_HOME/jjb/bin/jenkins-jobs
455 Installing JJB using pip
456 ------------------------
458 The recommended way to install JJB is via pip.
460 First, clone the latest version of the `releng-builder-repo`_.
464 $ git clone https://git.opendaylight.org/gerrit/p/releng/builder.git
466 Before actually installing JJB and its dependencies, make sure you've `created
467 and activated <Virtual Environments_>`_ a virtual environment for JJB.
473 The recommended version of JJB to install is the version specified in the
474 `builder/jjb/requirements.txt <odl-jjb-requirements.txt_>`_ file.
478 # From the root of the releng/builder repo
479 (jjb)$ pip install -r jjb/requirements.txt
481 To validate that JJB was successfully installed you can run this command:
485 (jjb)$ jenkins-jobs --version
487 To change the version of JJB specified by `builder/jjb/requirements.txt
488 <odl-jjb-requirements.txt_>`_
489 to install from the latest commit to the master branch of JJB's git repository:
493 $ cat jjb/requirements.txt
494 -e git+https://git.openstack.org/openstack-infra/jenkins-job-builder#egg=jenkins-job-builder
496 To install from a tag, like 1.4.0:
500 $ cat jjb/requirements.txt
501 -e git+https://git.openstack.org/openstack-infra/jenkins-job-builder@1.4.0#egg=jenkins-job-builder
503 Installing JJB Manually
504 -----------------------
506 This section documents installing JJB from its manually cloned repository.
508 Note that `installing via pip <Installing JJB using pip_>`_ is typically simpler.
510 Checkout the version of JJB's source you'd like to build.
512 For example, using master:
516 $ git clone https://git.openstack.org/openstack-infra/jenkins-job-builder
518 Using a tag, like 1.4.0:
522 $ git clone https://git.openstack.org/openstack-infra/jenkins-job-builder
523 $ cd jenkins-job-builder
524 $ git checkout tags/1.4.0
526 Before actually installing JJB and its dependencies, make sure you've `created
527 and activated <Virtual Environments_>`_ a virtual environment for JJB.
533 You can then use JJB's `requirements.txt <jjb-requirements.txt_>`_ file to
535 dependencies. Note that we're not using `sudo` to install as root, since we want
536 to make use of the venv we've configured for our current user.
540 # In the cloned JJB repo, with the desired version of the code checked out
541 (jjb)$ pip install -r requirements.txt
543 Then install JJB from the repo with:
549 To validate that JJB was successfully installed you can run this command:
553 (jjb)$ jenkins-jobs --version
558 `Docker <docker-docs_>`_ is an open platform used to create virtualized Linux containers
559 for shipping self-contained applications. Docker leverages LinuX Containers
560 \(LXC\) running on the same operating system as the host machine, whereas a
561 traditional VM runs an operating system over the host.
565 docker pull zxiiro/jjb-docker
566 docker run --rm -v ${PWD}:/jjb jjb-docker
568 This `Dockerfile <jjb-dockerfile_>`_ created the
569 `zxiiro/jjb-docker image <jjb-docker_>`_.
570 By default it will run:
576 You'll need to use the `-v/--volume=[]` parameter to mount a directory
577 containing your YAML files, as well as a configured `jenkins.ini` file if you
578 wish to upload your jobs to the `Jenkins Sandbox`_.
580 Jenkins Job Templates
581 ---------------------
583 The OpenDaylight `RelEng/Builder <releng-builder-wiki_>`_ project provides
584 `jjb-templates`_ that can be used to define basic jobs.
586 The *Gerrit Trigger* listed in the jobs are keywords that can be used to
587 trigger the job to run manually by simply leaving a comment in Gerrit for the
588 patch you wish to trigger against.
590 All jobs have a default build-timeout value of 360 minutes (6 hrs) but can be
591 overrided via the opendaylight-infra-wrappers' build-timeout property.
595 <table class="table table-bordered">
597 <td><b>Job Template</b><br/>{project}-distribution-{stream}</td>
598 <td><b>Gerrit Trigger</b><br/>test-distribution</td>
602 This job builds a distrbution against your patch, passes distribution sanity test
603 and reports back the results to Gerrit. Leave a comment with trigger keyword above
604 to activate it for a particular patch.
606 This job is maintained by the <a href="https://wiki.opendaylight.org/view/Integration/Test">Integration/Test</a>
609 <div class="admonition note">
610 <p class="first admonition-title">Note</p>
612 Running the "test-distribution" trigger will cause Jenkins to
613 remove it's existing vote if it's already -1 or +1'd a comment.
614 You will need to re-run your verify job (recheck) after running
615 this to get Jenkins to put back the correct vote.
622 <td><b>Job Template</b><br/>{project}-integration-{stream}</td>
627 The Integration Job Template creates a job which runs when a project that your
628 project depends on is successfully built. This job type is basically the same
629 as a verify job except that it triggers from other Jenkins jobs instead of via
630 Gerrit review updates. The dependencies that triger integration jobs are listed
631 in your project.cfg file under the <b>DEPENDENCIES</b> variable.
633 If no dependencies are listed then this job type is disabled by default.
638 <td><b>Job Template</b><br/>{project}-merge-{stream}</td>
639 <td><b>Gerrit Trigger</b><br/>remerge</td>
643 The Merge job template is similar to the Verify Job Template except
644 it will trigger once a Gerrit patch is merged into the repo. It
645 also automatically runs the Maven goals <b>source:jar</b> and
648 This job will upload artifacts to OpenDaylight's
649 <a href="https://nexus.opendaylight.org">Nexus</a> on completion.
654 <td><b>Job Template</b><br/>{project}-sonar</td>
655 <td><b>Gerrit Trigger</b><br/>run-sonar</td>
659 This job runs Sonar analysis and reports the results to
660 OpenDaylight's <a href="https://sonar.opendaylight.org">Sonar</a>
663 The Sonar Job Template creates a job which will run against the
664 master branch, or if BRANCHES are specified in the CFG file it will
665 create a job for the <b>First</b> branch listed.
667 <div class="admonition note">
668 <p class="first admonition-title">Note</p>
670 Running the "run-sonar" trigger will cause Jenkins to remove
671 its existing vote if it's already -1'd or +1'd a comment. You
672 will need to re-run your verify job (recheck) after running
673 this to get Jenkins to re-vote.
680 <td><b>Job Template</b><br/>{project}-validate-autorelease-{stream}</td>
681 <td><b>Gerrit Trigger</b><br/>recheck | reverify</td>
685 This job runs the PROJECT-validate-autorelease-BRANCH job which is
686 used as a quick sanity test to ensure that a patch does not depend on
687 features that do not exist in the current release.
689 The <b>revalidate</b> trigger is useful in cases where a project's
690 verify job passed however validate failed due to infra problems or
691 intermittent issues. It will retrigger just the validate-autorelease
697 <td><b>Job Template</b><br/>{project}-verify-{stream}-{maven}-{jdks}</td>
698 <td><b>Gerrit Trigger</b><br/>recheck | reverify</td>
702 The Verify job template creates a Gerrit Trigger job that will
703 trigger when a new patch is submitted to Gerrit.
708 <td><b>Job Template</b><br/>{project}-verify-node-{stream}</td>
709 <td><b>Gerrit Trigger</b><br/>recheck | reverify</td>
713 This job template can be used by a project that is NodeJS based. It
714 simply installs a python virtualenv and uses that to install nodeenv
715 which is then used to install another virtualenv for nodejs. It then
716 calls <b>npm install</b> and <b>npm test</b> to run the unit tests.
717 When using this template you need to provide a {nodedir} and
718 {nodever} containing the directory relative to the project root
719 containing the nodejs package.json and version of node you wish to
725 <td><b>Job Template</b><br/>{project}-verify-python-{stream}</td>
726 <td><b>Gerrit Trigger</b><br/>recheck | reverify</td>
730 This job template can be used by a project that contains Python. It
731 simply installs a Python virtualenv and uses tox to run the tests
732 defined in the project's tox.ini file. If the tox.ini is anywhere
733 other than the project's repo root, the path to its directory
734 relative to the project's repo root should be passed as {toxdir}.
739 <td><b>Job Template</b><br/>integration-patch-test-{stream}</td>
740 <td><b>Gerrit Trigger</b><br/>test-integration</td>
744 This job runs a full integration test suite against your patch and
745 reports back the results to Gerrit. Leave a comment with trigger
746 keyword above to activate it for a particular patch.
748 It then spawns the list of jobs in csit-list defined
749 <a href="https://git.opendaylight.org/gerrit/gitweb?p=releng/builder.git;a=blob;f=jjb/integration/integration-test-jobs.yaml">here</a>.
751 This job is maintained by the <a href="https://wiki.opendaylight.org/view/Integration/Test">Integration/Test</a>
754 <div class="admonition note">
755 <p class="first admonition-title">Note</p>
757 Running the "test-integration" trigger will cause Jenkins to remove
758 it's existing vote if it's already -1 or +1'd a comment. You will need
759 to re-run your verify job (recheck) after running this to get Jenkins
760 to put back the correct vote.
764 Some considerations when using this job:
767 The patch test verification takes some time (~2 hours) + consumes a lot of
768 resources so it is not meant to be used for every patch.
771 The system tests for master patches will fail most of the times because both
772 code and test are unstable during the release cycle (should be good by the
776 Because of the above, patch test results typically have to be interpreted by
777 system test experts. The <a href="https://wiki.opendaylight.org/view/Integration/Test">Integration/Test</a>
778 project can help with that.
787 We provide a properties which your job can take advantage of if you want to do
788 something different depending on the job type that is run. If you create a
789 profile that activates on a property listed blow. The JJB templated jobs will
790 be able to activate the profile during the build to run any custom code you
791 wish to run in your project.
795 -Dmerge : This flag is passed in our Merge job and is equivalent to the
798 -Dsonar : This flag is passed in our Sonar job and is equivalent to the
805 The `jenkins-sandbox`_ instance's purpose is to allow projects to test their JJB
806 setups before merging their code over to the RelEng master silo. It is
807 configured similarly to the master instance, although it cannot publish
808 artifacts or vote in Gerrit.
810 If your project requires access to the sandbox please open an OpenDaylight
811 Helpdesk ticket (<helpdesk@opendaylight.org>) and provide your ODL ID.
813 Notes Regarding the Sandbox
814 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
816 * Jobs are automatically deleted every Saturday at 08:00 UTC
817 * Committers can login and configure Jenkins jobs in the sandbox directly
818 (unlike with the master silo)
819 * Sandbox configuration mirrors the master silo when possible
820 * Sandbox jobs can NOT upload artifacts to Nexus
821 * Sandbox jobs can NOT vote on Gerrit
826 Make sure you have Jenkins Job Builder [properly installed](#jjb_install).
828 If you do not already have access, open an OpenDaylight Helpdesk ticket
829 (<helpdesk@opendaylight.org>) to request access to ODL's sandbox instance.
830 Integration/Test (`integration-test-wiki`_) committers have access by default.
832 JJB reads user-specific configuration from a `jenkins.ini`_. An
833 example is provided by releng/builder at `example-jenkins.ini`_.
837 # If you don't have RelEng/Builder's repo, clone it
838 $ git clone https://git.opendaylight.org/gerrit/p/releng/builder.git
839 # Make a copy of the example JJB config file (in the builder/ directory)
840 $ cp jenkins.ini.example jenkins.ini
841 # Edit jenkins.ini with your username, API token and ODL's sandbox URL
845 user=<your ODL username>
846 password=<your ODL Jenkins sandbox API token>
847 url=https://jenkins.opendaylight.org/sandbox
850 To get your API token, `login to the Jenkins **sandbox** instance
851 <jenkins-sandbox-login_>`_ (*not
852 the main master Jenkins instance, different tokens*), go to your user page (by
853 clicking on your username, for example), click "Configure" and then "Show API
859 If you `installed JJB locally into a virtual environment
860 <Installing Jenkins Job Builder_>`_,
861 you should now activate that virtual environment to access the `jenkins-jobs`
869 You'll want to work from the root of the RelEng/Builder repo, and you should
870 have your `jenkins.ini` file [properly configured](#sandbox_config).
875 It's good practice to use the `test` command to validate your JJB files before
880 jenkins-jobs --conf jenkins.ini test jjb/ <job-name>
882 If the job you'd like to test is a template with variables in its name, it
883 must be manually expanded before use. For example, the commonly used template
884 `{project}-csit-verify-1node-{functionality}` might expand to
885 `ovsdb-csit-verify-1node-netvirt`.
889 jenkins-jobs --conf jenkins.ini test jjb/ ovsdb-csit-verify-1node-netvirt
891 Successful tests output the XML description of the Jenkins job described by
892 the specified JJB job name.
897 Once you've `configured your \`jenkins.ini\` <Configuration_>`_ and `verified your
898 JJB jobs <Testing Jobs_>`_ produce valid XML descriptions of Jenkins jobs you
899 can push them to the Jenkins sandbox.
903 When pushing with `jenkins-jobs`, a log message with the number
904 of jobs you're pushing will be issued, typically to stdout.
905 **If the number is greater than 1** (or the number of jobs you
906 passed to the command to push) then you are pushing too many
907 jobs and should **`ctrl+c` to cancel the upload**. Else you will
908 flood the system with jobs.
912 INFO:jenkins_jobs.builder:Number of jobs generated: 1
914 **Failing to provide the final `<job-name>` param will push all
919 # Don't push all jobs by omitting the final param! (ctrl+c to abort)
920 jenkins-jobs --conf jenkins.ini update jjb/ <job-name>
925 Once you have your Jenkins job configuration `pushed to the
926 Sandbox <Pushing Jobs_>`_ you can trigger it to run.
928 Find your newly-pushed job on the `Sandbox's web UI <jenkins-sandbox_>`_. Click
929 on its name to see the job's details.
931 Make sure you're `logged in <jenkins-sandbox-login_>`_ to the Sandbox.
933 Click "Build with Parameters" and then "Build".
935 Wait for your job to be scheduled and run. Click on the job number to see
936 details, including console output.
938 Make changes to your JJB configuration, re-test, re-push and re-run until
944 If `using Docker <JJB Docker image_>`_:
949 docker run --rm -v ${PWD}:/jjb zxiiro/jjb-docker
953 When pushing with `jenkins-jobs`, a log message with
954 the number of jobs you're pushing will be issued, typically to stdout.
955 **If the number is greater than 1** (or the number of jobs you passed to
956 the command to push) then you are pushing too many jobs and should **`ctrl+c`
957 to cancel the upload**. Else you will flood the system with jobs.
961 INFO:jenkins_jobs.builder:Number of jobs generated: 1
963 **Failing to provide the final `<job-name>` param will push all jobs!**
967 # To upload jobs to the sandbox
968 # Please ensure that you include a configured jenkins.ini in your volume mount
969 # Making sure not to push more jobs than expected, ctrl+c to abort
970 docker run --rm -v ${PWD}:/jjb zxiiro/jjb-docker jenkins-jobs --conf jenkins.ini update . openflowplugin-csit-periodic-1node-cds-longevity-only-master
972 .. _docker-docs: https://www.docker.com/whatisdocker/
973 .. _example-jenkins.ini: https://git.opendaylight.org/gerrit/gitweb?p=releng/builder.git;a=blob;f=jenkins.ini.example
974 .. _integration-test-wiki: https://wiki.opendaylight.org/view/Integration/Test
975 .. _jenkins-master: https://jenkins.opendaylight.org/releng
976 .. _jenkins-sandbox: https://jenkins.opendaylight.org/sandbox
977 .. _jenkins-sandbox-login: https://jenkins.opendaylight.org/sandbox/login
978 .. _jenkins.ini: http://docs.openstack.org/infra/jenkins-job-builder/execution.html#configuration-file
979 .. _jjb-autoupdate-project.py: https://git.opendaylight.org/gerrit/gitweb?p=releng/builder.git;a=blob;f=scripts/jjb-autoupdate-project.py
980 .. _jjb-docker: https://hub.docker.com/r/zxiiro/jjb-docker/
981 .. _jjb-dockerfile: https://github.com/zxiiro/jjb-docker/blob/master/Dockerfile
982 .. _jjb-docs: http://ci.openstack.org/jenkins-job-builder/
983 .. _jjb-init-project.py: https://git.opendaylight.org/gerrit/gitweb?p=releng/builder.git;a=blob;f=scripts/jjb-init-project.py
984 .. _jjb-repo: https://github.com/openstack-infra/jenkins-job-builder
985 .. _jjb-requirements.txt: https://github.com/openstack-infra/jenkins-job-builder/blob/master/requirements.txt
986 .. _jjb-templates: https://git.opendaylight.org/gerrit/gitweb?p=releng/builder.git;a=tree;f=jjb
987 .. _odl-jjb-requirements.txt: https://git.opendaylight.org/gerrit/gitweb?p=releng/builder.git;a=blob;f=jjb/requirements.txt
988 .. _odl-nexus: https://nexus.opendaylight.org
989 .. _odl-sonar: https://sonar.opendaylight.org
990 .. _python-virtualenv: https://virtualenv.readthedocs.org/en/latest/
991 .. _python-virtualenvwrapper: https://virtualenvwrapper.readthedocs.org/en/latest/
992 .. _releng-wiki: https://wiki.opendaylight.org/view/RelEng:Main
993 .. _releng-builder-gerrit: https://git.opendaylight.org/gerrit/#/admin/projects/releng/builder
994 .. _releng-builder-repo: https://git.opendaylight.org/gerrit/gitweb?p=releng%2Fbuilder.git;a=summary
995 .. _releng-builder-wiki: https://wiki.opendaylight.org/view/RelEng/Builder
996 .. _streams-design-background: https://lists.opendaylight.org/pipermail/release/2015-July/003139.html
997 .. _spinup-scripts: https://git.opendaylight.org/gerrit/gitweb?p=releng/builder.git;a=tree;f=jenkins-scripts
998 .. _spinup-scripts-basic_settings.sh: https://git.opendaylight.org/gerrit/gitweb?p=releng/builder.git;a=blob;f=jenkins-scripts/basic_settings.sh
999 .. _spinup-scripts-controller.sh: https://git.opendaylight.org/gerrit/gitweb?p=releng/builder.git;a=blob;f=jenkins-scripts/controller.sh
1000 .. _vagrant-basic-java-node: https://git.opendaylight.org/gerrit/gitweb?p=releng/builder.git;a=tree;f=vagrant/basic-java-node
1001 .. _vagrant-definitions: https://git.opendaylight.org/gerrit/gitweb?p=releng/builder.git;a=tree;f=vagrant