docs/developer-guide: update for debian build
[pti/rtp.git] / docs / developer-guide.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. SPDX-License-Identifier: CC-BY-4.0
3 .. Copyright (C) 2019 Wind River Systems, Inc.
4
5 INF Developer Guide
6 ===================
7
8 .. contents::
9    :depth: 3
10    :local:
11
12 1. About the INF project
13 ************************
14
15 This project is a reference implementation of O-Cloud infrastructure which is based on StarlingX, and it supports multi-OS.
16
17 * Currently the following OS are supported:
18
19   * Debian 11 (bullseye)
20   * CentOS 7
21   * Yocto 2.7 (warrior)
22
23 Notes:
24   * Debian based is the recommended platfrom.
25
26 1.1 About the Debian based implementaion
27 ----------------------------------------
28 The project provde wrapper scripts to automate all the steps of `StarlingX Debian Build Guide`_ to build out the reference platform as an installable ISO image.
29
30 .. _`StarlingX Debian Build Guide`: https://wiki.openstack.org/wiki/StarlingX/DebianBuildEnvironment
31
32 1.2 About the CentOS based implementaion
33 ----------------------------------------
34 The project provde wrapper scripts to automate all the steps of `StarlingX Build Guide`_ to build out the reference platform as an installable ISO image.
35
36 .. _`StarlingX Build Guide`: https://docs.starlingx.io/developer_resources/build_guide.html
37
38 1.3 About the Yocto based implementation
39 ----------------------------------------
40
41 The project provde wrapper scripts to pull all required Yocto/OE layers to build out the reference platform as an installable ISO image.
42
43 To contribute on this project, basic knowledge of Yocto/OpenEmbedded is needed, please refer to the following docs if you want to learn about how to develop with Yocto/OpenEmbedded:
44
45 - `Yocto dev manual`_
46 - `OpenEmbedded wiki`_
47
48 .. _`Yocto dev manual`: https://www.yoctoproject.org/docs/2.6.3/dev-manual/dev-manual.html
49 .. _`OpenEmbedded wiki`: http://www.openembedded.org/wiki/Main_Page
50
51
52 2. How to build the INF project
53 *******************************
54
55 2.1 How to build the Debian based image
56 ---------------------------------------
57
58 2.1.1 Prerequisite for Debian build environment
59 +++++++++++++++++++++++++++++++++++++++++++++++
60
61 NOTE: The build system for Debian requires a Linux system with Docker and python 3.x installed. The the following steps have been tested on CentOS 7 and Ubuntu 20.04.
62
63 * Refer to `Install docker on ubuntu`_ or `Install docker on centos`_ to install docker.
64 * Refer to `Configure_Debian_build_environment`_ to install prerequisite packges and configure for Debian build environment.
65
66 .. _`Install docker on ubuntu`: https://docs.docker.com/engine/install/ubuntu/
67 .. _`Install docker on centos`: https://docs.docker.com/engine/install/centos/
68 .. _`Configure_Debian_build_environment`: https://wiki.openstack.org/wiki/StarlingX/DebianBuildEnvironment#Configure_build_environment
69
70 2.1.2 Use wrapper script build_inf_debian.sh to build the Debian based image
71 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
72
73 ::
74
75   # Get the wrapper script to build the debian image
76   $ wget -O build_inf_debian.sh 'https://gerrit.o-ran-sc.org/r/gitweb?p=pti/rtp.git;a=blob_plain;f=scripts/build_inf_debian/build_inf_debian.sh;hb=HEAD'
77
78   $ chmod +x build_inf_debian.sh
79   $ WORKSPACE=/path/to/workspace
80   $ ./build_inf_debian.sh -w ${WORKSPACE}
81
82 If all go well, you will get the ISO image in:
83 ${WORKSPACE}/prj_output/inf-image-debian-all-x86-64.iso
84
85 2.2 How to build the CentOS based image
86 ---------------------------------------
87
88 NOTE: This only supports build on CentOS 7 which will be EOL 30 Jun 2024.
89
90 2.2.1 Prerequisite for CentOS build environment
91 +++++++++++++++++++++++++++++++++++++++++++++++
92
93 NOTE: This step needs the user has sudo permission.
94
95 ::
96
97   # Get the wrapper script for preparing the build environment
98   $ wget -O build_inf_prepare.sh https://gerrit.o-ran-sc.org/r/gitweb?p=pti/rtp.git;a=blob_plain;f=scripts/build_inf_centos/build_inf_prepare_jenkins.sh;hb=HEAD
99
100   $ chmod +x build_inf_prepare.sh
101   $ WORKSPACE=/path/to/workspace
102   $ ./build_inf_prepare.sh -w ${WORKSPACE}
103
104 2.2.2 Use wrapper script build_inf_centos.sh to build the CentOS based image
105 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
106
107 ::
108
109   # Get the wrapper script to build the centos image
110   $ wget -O build_inf_centos.sh 'https://gerrit.o-ran-sc.org/r/gitweb?p=pti/rtp.git;a=blob_plain;f=scripts/build_inf_centos/build_inf_centos.sh;hb=HEAD'
111
112   $ chmod +x build_inf_centos.sh
113   $ WORKSPACE=/path/to/workspace
114   $ ./build_inf_centos.sh -w ${WORKSPACE}
115
116 If all go well, you will get the ISO image in:
117 ${WORKSPACE}/prj_output/inf-image-centos-all-x86-64.iso
118
119
120 2.3 How to build the Yocto based image
121 --------------------------------------
122
123 2.3.1 Prerequisite for Yocto build environment
124 ++++++++++++++++++++++++++++++++++++++++++++++
125
126 * Your host need to meet the requirements for Yocto, please refer to:
127
128   * `Compatible Linux Distribution`_
129   * `Supported Linux Distributions`_
130   * `Required Packages for the Build Host`_
131
132 The recommended and tested host is Ubuntu 16.04/18.04 and CentOS 7.
133
134 * To install the required packages for Ubuntu 16.04/18.04:
135
136 .. _`Compatible Linux Distribution`: https://www.yoctoproject.org/docs/2.7.3/brief-yoctoprojectqs/brief-yoctoprojectqs.html#brief-compatible-distro
137 .. _`Supported Linux Distributions`: https://www.yoctoproject.org/docs/2.7.3/ref-manual/ref-manual.html#detailed-supported-distros
138 .. _`Required Packages for the Build Host`: https://www.yoctoproject.org/docs/2.7.3/ref-manual/ref-manual.html#required-packages-for-the-build-host
139
140 ::
141
142   $ sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \
143     build-essential chrpath socat cpio python python3 python3-pip python3-pexpect \
144     xz-utils debianutils iputils-ping make xsltproc docbook-utils fop dblatex xmlto \
145     python-git
146
147 * To install the required packages for CentOS 7:
148
149 ::
150
151   $ sudo yum install -y epel-release
152   $ sudo yum makecache
153   $ sudo yum install gawk make wget tar bzip2 gzip python unzip perl patch \
154     diffutils diffstat git cpp gcc gcc-c++ glibc-devel texinfo chrpath socat \
155     perl-Data-Dumper perl-Text-ParseWords perl-Thread-Queue perl-Digest-SHA \
156     python34-pip xz which SDL-devel xterm
157
158 2.3.2 Use wrapper script build_inf_yocto.sh to setup build the Yocto based image
159 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
160
161 ::
162
163   # Get the wrapper script with either curl or wget
164   $ curl -o build_inf_yocto.sh 'https://gerrit.o-ran-sc.org/r/gitweb?p=pti/rtp.git;a=blob_plain;f=scripts/build_inf_yocto/build_inf_yocto.sh;hb=HEAD'
165   $ wget -O build_inf_yocto.sh 'https://gerrit.o-ran-sc.org/r/gitweb?p=pti/rtp.git;a=blob_plain;f=scripts/build_inf_yocto/build_inf_yocto.sh;hb=HEAD'
166
167   $ chmod +x build_inf_yocto.sh
168   $ WORKSPACE=/path/to/workspace
169   $ ./build_inf_yocto.sh -w ${WORKSPACE}
170
171 If all go well, you will get the ISO image in:
172 ${WORKSPACE}/prj_output/inf-image-yocto-aio-x86-64.iso
173