e3231b747e2e3072f4e4992796cdb44719f5498e
[integration/packaging.git] / docs / rpms.rst
1 RPMs
2 ====
3
4 OpenDaylight has a mature RPM Continuous Delivery pipeline. Every autorelease
5 build is automatically packaged as an RPM, and even if autorelease is broken
6 a daily job builds the latest distribution snapshot build into an RPM.
7
8 RPMs can be passed to test jobs that install them, start OpenDaylight with its
9 systemd service, connect to the Karaf shell and verify basic functionality.
10
11 RPMs are hosted on the CentOS Community Build system repositories. Some repos
12 are updated very frequently with the latest builds, while others are permanent
13 homes of official releases.
14
15 Developers can build custom RPMs with pre-merge patches for testing by first
16 creating a custom distribution with the integration-multipatch-test job and
17 then feeding the resulting artifact to the packaging-build-rpm job.
18
19 Build Jobs
20 ----------
21
22 OpenDaylight Integration/Packaging has added support for many variations of
23 fully automated RPM builds.
24
25 packaging-build-rpm
26 ^^^^^^^^^^^^^^^^^^^
27
28 The `packaging-build-rpm job`_ is the primary way to build an RPM from an
29 OpenDaylight distribution (built by `autorelease <autorelease-builds.html>`_
30 or the `snapshot distribution <distribution-job-builds.html>` job). It accepts
31 a set of `parameters`_ that can be used to configure the build and passes them
32 to the `RPM build logic in Integration/Packaging's repo`_. The job produces
33 both a noarch RPM and source RPM. The noarch RPM can be passed to test jobs for
34 validation. The source RPM can be downloaded to a system with the required
35 credentials and then pushed to the CentOS Community Build system to be built
36 into a noarch RPM on their servers and hosted in their repos.
37
38 The RPM and SRPM artifacts of the job are handled differently depending on the
39 Jenkins silo the job is executing in.
40
41 When running in production (releng silo), artifacts are hosted on Nexus. There
42 are RPM repos for each active branch (`oxygen-devel`_). New builds are
43 automatically added to the appropriate devel for their branch.
44
45 When running in the sandbox, artifacts are thrown away by default. To keep an
46 artifact for further testing, add a path regex that matches it to the Archive
47 Artifacts param of the job (`ARCHIVE_ARTIFACTS=/home/jenkins/rpmbuild/RPMS/
48 noarch/opendaylight*.rpm`). The files matched will be stored in OpenDaylight's
49 log archive along with the other job logs.
50
51 packaging-build-rpm-snap
52 ^^^^^^^^^^^^^^^^^^^^^^^^
53
54 The `packaging-build-rpm-snap job`_ packages the most recent `snapshot
55 distribution <distribution-job-builds.html>` build from a given branch as an
56 RPM. This could be used by a developer to test code that was just merged, but
57 which has not been included in an `autorelease build
58 <autorelease-builds.html>`_ yet. The job is also triggered daily, to ensure
59 that OpenDaylight's Continuous Delivery pipeline is fed new builds even if
60 autorelease is broken.
61
62 Test Jobs
63 ---------
64
65 packaging-test-rpm
66 ^^^^^^^^^^^^^^^^^^
67
68 The `packaging-test-rpm job`_ accepts a link to an RPM and validates it. It
69 installs the package with the system's package manager, starts OpenDaylight's
70 systemd service, verifies that it's reported as active, connects to the Karaf
71 shell and checks that some key bundles are present.
72
73 Repositories
74 ------------
75
76 OpenDaylight Nexus
77 ^^^^^^^^^^^^^^^^^^
78
79 Packages resulting from build jobs running on OpenDaylight's infrastructure are
80 automatically hosted on OpenDaylight's Nexus repositories.
81
82 Continious Delivery Repositories
83 ................................
84
85 OpenDaylight provides fully-automated Continuous Delivery pipelines for RPMs.
86
87 Every RPM built in the production RelEng Jenkins silo is pushed to the devel
88 repo appropriate for its branch. Builds are triggered for every successful
89 autorelase job, as well as daily using the latest available snapshot build.
90
91
92 Continuous Delivery repos for Carbon, Nitrogen and Oxygen:
93
94 - `opendaylight-carbon-epel-7-x86_64-devel`_
95 - `opendaylight-nitrogen-epel-7-x86_64-devel`_
96 - `opendaylight-oxygen-epel-7-x86_64-devel`_
97
98 CentOS Community Build System
99 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
100
101 While most RPM builds are triggered automatically in OpenDaylight's Jenkins,
102 some RPMs are promoted to be hosted in OpenDaylight's CentOS repositories.
103 There are a series of repos that are updated at varying frequencies, from
104 testing repos that are updated with pre-release versions very frequently to
105 release repos that are the permanent home of official OpenDaylight releases.
106
107 Testing Repositories
108 ....................
109
110 Repositories with the -testing suffix are updated very frequently with
111 pre-release versions of OpenDaylight from the appropriate branch. New RPMs
112 replace the old ones, so installing from these repos will always provide the
113 most recent versions.
114
115 Testing repos for Carbon, Nitrogen and Oxygen:
116
117 - `nfv7-opendaylight-6-testing`_
118 - `nfv7-opendaylight-7-testing`_
119 - `nfv7-opendaylight-8-testing`_
120
121 Release Repositories
122 ....................
123
124 Repositories with the -release suffix host official OpenDaylight releases. They
125 are updated infrequently to never, and will host their release artifacts
126 forever. Release repos are subdivided into two groups based version numbers.
127 Repositories with both a major and minor version number (62, 70, 71) are pinned
128 to a specific OpenDaylight release or service release (Carbon SR2 6.2.0, Nitrogen
129 7.0.0, Nitrogen SR1 7.1.0). Repositories with only a major version (6, 7) will
130 always host the latest service release from that major release. If a new SR
131 comes out, the repo will get the update (Nitrogen 2 will replace Nitrogen SR1).
132
133 Release repos for the latest Carbon and Nitrogen service releases:
134
135 - `nfv7-opendaylight-6-release`_
136 - `nfv7-opendaylight-7-release`_
137
138 Release repos that will permanently host specific Carbon and Nitrogen releases:
139
140 - `nfv7-opendaylight-60-release`_
141 - `nfv7-opendaylight-61-release`_
142 - `nfv7-opendaylight-62-release`_
143 - `nfv7-opendaylight-70-release`_
144 - `nfv7-opendaylight-71-release`_
145
146 Repository Configuration Files
147 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
148
149 While it's possible to install RPMs directly (`dnf install -y <URL>`), it's
150 often easier to use a repository configuration file to install whatever the
151 latest RPM is in a given repo.
152
153 The OpenDaylight Integration/Packaging project provides `example repo config
154 files for each official repository`_.
155
156 Package managers like Yum and DNF will automatically find repo configuration
157 files placed in the /etc/yum.repos.d/ directory. Curl them into place with
158 something like:
159
160     sudo curl -o /etc/yum.repos.d/opendaylight-7-testing.repo \
161       "https://git.opendaylight.org/gerrit/gitweb?p=integration/packaging.git;a=blob_plain;f=packages/rpm/example_repo_configs/opendaylight-8-devel.repo"
162
163 Standard install commands will now find the repository as expected.
164
165     sudo dnf install -y opendaylight
166
167 Custom RPMs
168 -----------
169
170 It's possible for developers to build custom RPMs, typically with unmerged
171 patches that need system testing. First, use the `integration-multipatch-test`_
172 job to create a custom distribution that includes the set of unmerged patches.
173 See the `Custom Distributions <distribution-job-builds.html#custom-
174 distributions>`_ section for extensive docs. Once you have a custom
175 distribution artifact, pass it to the `packaging-build-rpm job`_ to package it
176 as an RPM. See the `packaging-build-rpm`_ section for docs.
177
178
179 .. _packaging-build-rpm job: https://jenkins.opendaylight.org/releng/job/packaging-build-rpm-master/
180 .. _parameters: https://jenkins.opendaylight.org/releng/job/packaging-build-rpm-master/build
181 .. _RPM build logic in Integration/Packaging's repo: https://github.com/opendaylight/integration-packaging/blob/master/rpm/build.py
182 .. _packaging-build-rpm-snap job: https://jenkins.opendaylight.org/releng/job/packaging-build-rpm-snap-master/
183 .. _packaging-test-rpm job: https://jenkins.opendaylight.org/releng/job/packaging-test-rpm-master/
184 .. _opendaylight-carbon-epel-7-x86_64-devel: https://nexus.opendaylight.org/content/repositories/opendaylight-carbon-epel-7-x86_64-devel/org/opendaylight/integration-packaging/opendaylight/
185 .. _opendaylight-nitrogen-epel-7-x86_64-devel: https://nexus.opendaylight.org/content/repositories/opendaylight-nitrogen-epel-7-x86_64-devel/org/opendaylight/integration-packaging/opendaylight/
186 .. _opendaylight-oxygen-epel-7-x86_64-devel: https://nexus.opendaylight.org/content/repositories/opendaylight-oxygen-epel-7-x86_64-devel/org/opendaylight/integration-packaging/opendaylight/
187 .. _nfv7-opendaylight-6-testing: http://cbs.centos.org/repos/nfv7-opendaylight-6-testing/x86_64/os/Packages/
188 .. _nfv7-opendaylight-7-testing: http://cbs.centos.org/repos/nfv7-opendaylight-7-testing/x86_64/os/Packages/
189 .. _nfv7-opendaylight-8-testing: http://cbs.centos.org/repos/nfv7-opendaylight-8-testing/x86_64/os/Packages/
190 .. _nfv7-opendaylight-6-release: http://cbs.centos.org/repos/nfv7-opendaylight-6-release/x86_64/os/Packages/
191 .. _nfv7-opendaylight-60-release: http://cbs.centos.org/repos/nfv7-opendaylight-60-release/x86_64/os/Packages/
192 .. _nfv7-opendaylight-61-release: http://cbs.centos.org/repos/nfv7-opendaylight-61-release/x86_64/os/Packages/
193 .. _nfv7-opendaylight-62-release: http://cbs.centos.org/repos/nfv7-opendaylight-62-release/x86_64/os/Packages/
194 .. _nfv7-opendaylight-7-release: http://cbs.centos.org/repos/nfv7-opendaylight-7-release/x86_64/os/Packages/
195 .. _nfv7-opendaylight-70-release: http://cbs.centos.org/repos/nfv7-opendaylight-70-release/x86_64/os/Packages/
196 .. _nfv7-opendaylight-71-release: http://cbs.centos.org/repos/nfv7-opendaylight-71-release/x86_64/os/Packages/
197 .. _example repo config files for each official repository: https://git.opendaylight.org/gerrit/gitweb?p=integration/packaging.git;a=tree;f=packages/rpm/example_repo_configs;hb=refs/heads/master
198 .. _integration-multipatch-test: https://jenkins.opendaylight.org/releng/search/?q=integration-multipatch-test
199 .. _oxygen-devel: https://nexus.opendaylight.org/content/repositories/opendaylight-oxygen-epel-7-x86_64-devel/org/opendaylight/integration-packaging/opendaylight/