1 ============================================================================
2 OPNFV Build instruction for the Fuel deployment tool
3 ============================================================================
5 .. contents:: Table of Contents
11 This document describes how to build the Fuel deployment tool for the
12 B release of OPNFV - the build system, dependencies and required
18 Brahmaputra release of OPNFV when using Fuel as a deployment tool DOCs (c) by Jonas Bjurel (Ericsson AB) and others.
20 Brahmaputra release of OPNFV when using Fuel as a deployment tool DOCs (c) are licensed under a Creative Commons Attribution 4.0 International License. You should have received a copy of the license along with this. If not, see <http://creativecommons.org/licenses/by/4.0/>.
27 +--------------------+--------------------+--------------------+----------------------+
28 | **Date** | **Ver.** | **Author** | **Comment** |
30 +--------------------+--------------------+--------------------+----------------------+
31 | 2015-06-03 | 1.0.0 | Jonas Bjurel | Instruction for |
32 | | | (Ericsson AB) | the Arno release |
33 +--------------------+--------------------+--------------------+----------------------+
34 | 2015-09-24 | 1.1.0 | Jonas Bjurel | Instruction for |
35 | | | (Ericsson AB) | the Arno SR1 release |
36 +--------------------+--------------------+--------------------+----------------------+
37 | 2015-10-23 | 1.1.1 | Stefan Berg | Added instruction |
38 | | | (Ericsson AB) | for proxy builds |
39 +--------------------+--------------------+--------------------+----------------------+
40 | 2015-12-03 | 1.2.0 | Stefan Berg | Added instruction |
41 | | | (Ericsson AB) | for plugin build |
43 +--------------------+--------------------+--------------------+----------------------+
44 | 2016-01-20 | 1.2.1 | Daniel Smith | Minor updates for |
45 | | | (Ericsson AB) | docker requirements |
46 +--------------------+--------------------+--------------------+----------------------+
51 This document describes the build system used to build the Fuel
52 deployment tool for the Brahmaputra release of OPNFV, required
53 dependencies and minimum requirements on the host to be used for the
56 The Fuel build system is desigened around Docker containers such that
57 dependencies outside of the build system can be kept to a minimum. It
58 also shields the host from any potential dangerous operations
59 performed by the build system.
61 The audience of this document is assumed to have good knowledge in
62 network and Unix/Linux administration.
67 Minimum Hardware Requirements
68 -----------------------------
70 - An x86_64 host (Bare-metal or VM) with Ubuntu 14.04 LTS installed
72 - Note: Builds on Wily (Ubuntu 15.x) are not supportted currently
74 - ~30 GB available disc
78 Minimum Software Requirements
79 -----------------------------
81 The build host should run Ubuntu 14.04 operating system.
83 On the host, the following packages must be installed:
85 - docker - see https://docs.docker.com/engine/installation/ubuntulinux/ for
86 installation notes for Ubuntu 14.04. Note: only use the Ubuntu stock
87 distro of Docker (docker-engine). Tested against ver 1.9.x and greater
89 - git (simply available through sudo apt-get install git)
91 - make (simply available through sudo apt-get install make)
93 - curl (simply available through sudo apt-get install curl)
98 Setting up the Docker build container
99 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
100 After having installed Docker, add yourself to the docker group:
102 <sudo usermod -a -G docker [userid]>
104 Also make sure to define relevant DNS servers part of the global dns chain in
105 in your </etc/default/docker> configuration file. Uncomment, modify the values appropriately
106 and save and quit the file. For example:
108 <DOCKER_OPTS=" --dns=8.8.8.8 --dns=8.8.8.4">
112 <sudo service docker restart>
114 Setting up OPNFV Gerrit in order to being able to clone the code
115 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
116 - Start setting up OPNFV gerrit by creating a SSH key (unless you
117 don't already have one), create one with ssh-keygen
119 - Add your generated public key in OPNFV Gerrit <https://gerrit.opnfv.org/>
120 (this requires a linuxfoundation account, create one if you do not
123 - Select "SSH Public Keys" to the left and then "Add Key" and paste
126 Clone the OPNFV code Git repository with your SSH key
127 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
128 Now it is time to clone the code repository:
130 <git clone ssh://'Linux foundation user'@gerrit.opnfv.org:29418/fuel>
132 Now you should have the OPNFV fuel repository with the Fuel
133 directories stored locally on your build host.
135 Check out the Brahmaputra release:
137 <git checkout insert-b-release-tag-here0>
139 Clone the OPNFV code Git repository without a SSH key
140 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
141 You can also opt to clone the code repository without a SSH key:
143 <git clone https://gerrit.opnfv.org:29418/gerrit/fuel>
145 Make sure to checkout the release tag as described above.
151 There are two methods available for building Fuel:
153 - A low level method using Make
155 - An abstracted method using build.sh
158 Support for building behind a http/https/rsync proxy
159 ----------------------------------------------------
161 The build system is able to make use of a web proxy setup if the
162 http_proxy, https_proxy, no_proxy (if needed) and RSYNC_PROXY or
163 RSYNC_CONNECT_PROG environment variables have been set before invoking make.
165 The proxy setup must permit port 80 (http), 443 (https) and 873
168 Important note about the host Docker daemon settings
169 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
171 The Docker daemon on the host must be configured to use the http proxy
172 for it to be able to pull the base Ubuntu 14.04 image from the Docker
173 registry before invoking make! In Ubuntu this is done by adding a line
176 export http_proxy="http://10.0.0.1:8888/"
178 to /etc/default/docker and restarting the Docker daemon.
180 Setting proxy environment variables prior to build
181 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
183 The build system will make use the following environment variables
184 that needs to be exported to subshells by using export (bash) or
187 | http_proxy (or HTTP_PROXY)
188 | https_proxy (or HTTP_PROXY)
189 | no_proxy (or NO_PROXY)
193 As an example, these are the settings that were put in the user's
194 .bashrc when verifying the proxy build functionality:
196 | export RSYNC_PROXY=10.0.0.1:8888
197 | export http_proxy=http://10.0.0.1:8888
198 | export https_proxy=http://10.0.0.1:8888
199 | export no_proxy=localhost,127.0.0.1,.consultron.com,.sock
201 Using a ssh proxy for the rsync connection
202 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
204 If the proxy setup is not allowing the rsync protocol, an alternative
205 solution is to use a SSH tunnel to a machine capable of accessing the
206 outbound port 873. Set the RSYNC_CONNECT_PROG according to the rsync
207 manual page (for example to "ssh <username>@<hostname> nc %H 873") to enable
208 this. Also note that netcat needs to be installed on the remote
211 Make sure that the ssh command also refers to the user on the remote
212 system, as the command itself will be run from the Docker build container
213 as the root user (but with the invoking user's SSH keys).
215 Disabling the Ubuntu repo cache if rsync is not allowed
216 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
218 During the build phase, a local Ubuntu package repository is fetched
219 from upstream in order to be added to the OPNFV Fuel ISO and for parts
220 of this process rsync is used.
222 If neither of the two available methods for proxying rsync are
223 available, the last resort is to turn off the caching of the Ubuntu
224 packages in the build system. This is done by removing the
225 "f_repobuild" from SUBDIRS in the beginning of
226 the fuel/build/f_isoroot/Makefile.
228 Note! Doing this will require the Fuel master node to have Internet
229 access when installing the ISO artifact built as no Ubuntu package
230 cache will be on the ISO!
232 Configure your build environment
233 -------------------------------------
235 ** Configuring the build environment should not be performed if building standard Brahmaputra release **
237 Select the versions of the components you want to build by editing the fuel/build/config.mk file.
239 Non official build: Selecting which plugins to build
240 ----------------------------------------------------
241 In order to cut the build time for unofficial builds (made by an
242 individual developer locally), the selection if which Fuel plugins to
243 build (if any) can be done by environment variable
244 "BUILD_FUEL_PLUGINS" prior to building.
246 Only the plugin targets from fuel/build/f_isoroot/Makefile that are
247 specified in the environment variable will then be built. In order to
248 completely disable the building of plugins, the environment variable
249 is set to " ". When using this functionality, the resulting iso file
250 will be prepended with the prefix "unofficial-" to clearly indiciate
251 that this is not a full build.
253 This method of plugin selection is not meant to be used from within
256 Low level build method using make
257 ---------------------------------
258 The low level method is based on Make:
260 From the <fuel/build> directory, invoke <make [target]>
262 Following targets exist:
264 - none/all - this will:
266 - If not already existing, initialize the docker build environment
268 - If not already done, build OpenDaylight from upstream (as defined
269 by fuel-build config-spec)
271 - If not already done, build fuel from upstream (as defined by
272 fuel-build/config-spec)
274 - Build the defined additions to fuel (as defined by the structure
277 - Apply changes and patches to fuel (as defined by the structure of
280 - Reconstruct a fuel .iso image
282 - clean - this will remove all artifacts from earlier builds.
284 If the build is successful, you will find the generated ISO file in
285 the <fuel/build/release> subdirectory!
287 Abstracted build method using build.sh
288 ======================================
289 The abstracted build method uses the <fuel/ci/build.sh> script which
292 - Create and use a build cache - significantly speeding up the
293 buildtime if upstream repositories have not changed.
295 - push/pull cache and artifacts to an arbitrary URI (http(s):, file:, ftp:)
297 For more info type <fuel/ci/build.sh -h>.
302 The artifacts produced are:
304 - <OPNFV_XXXX.iso> - Which represents the bootable Fuel image, XXXX is
305 replaced with the build identity provided to the build system
307 - <OPNFV_XXXX.iso.txt> - Which holds version metadata.
313 :Authors: Jonas Bjurel (Ericsson), Stefan Berg (Ericsson)
316 **Documentation tracking**