X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=docs%2Fdeveloper-guide.rst;h=b5ce09f9766a5d9ce74de2f0a8b193744da04e5e;hb=4146a97893da684b12bb1136444eca779d63d185;hp=a3b501507c045d1ec15f01c8438a15538def6ea3;hpb=0d1338cd5cebcc03ca159de1090ce31cec663a22;p=pti%2Frtp.git diff --git a/docs/developer-guide.rst b/docs/developer-guide.rst index a3b5015..b5ce09f 100755 --- a/docs/developer-guide.rst +++ b/docs/developer-guide.rst @@ -2,18 +2,46 @@ .. SPDX-License-Identifier: CC-BY-4.0 .. Copyright (C) 2019 Wind River Systems, Inc. -Developer-Guide -=============== +INF Developer Guide +=================== .. contents:: :depth: 3 :local: +1. About the INF project +************************ -This project implements a real time platform to deploy the O-CU and O-DU and it's based on Yocto/OpenEmbedded. +This project is a reference implementation of O-Cloud infrastructure which is based on StarlingX, and it supports multi-OS. -This includes a Yocto/OpenEmbedded compatible layer meta-oran and wrapper scripts -to pull all required Yocto/OE layers to build out the reference platform. +* Currently the following OS are supported: + + * Debian 11 (bullseye) + * CentOS 7 + * Yocto 2.7 (warrior) + +Notes: + * Debian based is the recommended platfrom. + * The intended audiences of this guide are the developers who want to develop/integrate apps in INF platform, if you just want to install and deploy INF platform, you can ignore this guide and read the `INF Installation Guide`_ + +.. _`INF Installation Guide`: https://docs.o-ran-sc.org/projects/o-ran-sc-pti-rtp/en/latest/installation-guide.html + +1.1 About the Debian based implementaion +---------------------------------------- +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. + +.. _`StarlingX Debian Build Guide`: https://wiki.openstack.org/wiki/StarlingX/DebianBuildEnvironment + +1.2 About the CentOS based implementaion +---------------------------------------- +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. + +.. _`StarlingX Build Guide`: https://docs.starlingx.io/developer_resources/build_guide.html + +1.3 About the Yocto based implementation +---------------------------------------- + +The project provde wrapper scripts to pull all required Yocto/OE layers to build out the reference platform as an installable ISO image. 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: @@ -24,93 +52,125 @@ To contribute on this project, basic knowledge of Yocto/OpenEmbedded is needed, .. _`OpenEmbedded wiki`: http://www.openembedded.org/wiki/Main_Page +2. How to build the INF project +******************************* -1. Prerequisite for build environment -------------------------------------- +2.1 How to build the Debian based image +--------------------------------------- -* Your host need to meet the requirements for Yocto, please refer to: +2.1.1 Prerequisite for Debian build environment ++++++++++++++++++++++++++++++++++++++++++++++++ - * `Compatible Linux Distribution`_ - * `Supported Linux Distributions`_ - * `Required Packages for the Build Host`_ +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. -* The recommended and tested host is Ubuntu 16.04/18.04 and CentOS 7. +* Refer to `Install docker on ubuntu`_ or `Install docker on centos`_ to install docker. +* Refer to `Configure_Debian_build_environment`_ to install prerequisite packges and configure for Debian build environment. - * To install the required packages for Ubuntu 16.04/18.04: +.. _`Install docker on ubuntu`: https://docs.docker.com/engine/install/ubuntu/ +.. _`Install docker on centos`: https://docs.docker.com/engine/install/centos/ +.. _`Configure_Debian_build_environment`: https://wiki.openstack.org/wiki/StarlingX/DebianBuildEnvironment#Configure_build_environment -.. _`Compatible Linux Distribution`: https://www.yoctoproject.org/docs/2.6.3/brief-yoctoprojectqs/brief-yoctoprojectqs.html#brief-compatible-distro -.. _`Supported Linux Distributions`: https://www.yoctoproject.org/docs/2.6.3/ref-manual/ref-manual.html#detailed-supported-distros -.. _`Required Packages for the Build Host`: https://www.yoctoproject.org/docs/2.6.3/ref-manual/ref-manual.html#required-packages-for-the-build-host +2.1.2 Use wrapper script build_inf_debian.sh to build the Debian based image +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ :: - $ sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \ - build-essential chrpath socat cpio python python3 python3-pip python3-pexpect \ - xz-utils debianutils iputils-ping make xsltproc docbook-utils fop dblatex xmlto \ - python-git + # Get the wrapper script to build the debian image + $ 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' + + $ chmod +x build_inf_debian.sh + $ WORKSPACE=/path/to/workspace + $ ./build_inf_debian.sh -w ${WORKSPACE} + +If all go well, you will get the ISO image in: +${WORKSPACE}/prj_output/inf-image-debian-all-x86-64.iso + +2.2 How to build the CentOS based image +--------------------------------------- - * To install the required packages for CentOS 7: +NOTE: This only supports build on CentOS 7 which will be EOL 30 Jun 2024. + +2.2.1 Prerequisite for CentOS build environment ++++++++++++++++++++++++++++++++++++++++++++++++ + +NOTE: This step needs the user has sudo permission. :: - $ sudo yum install -y epel-release - $ sudo yum makecache - $ sudo yum install gawk make wget tar bzip2 gzip python unzip perl patch \ - diffutils diffstat git cpp gcc gcc-c++ glibc-devel texinfo chrpath socat \ - perl-Data-Dumper perl-Text-ParseWords perl-Thread-Queue perl-Digest-SHA \ - python34-pip xz which SDL-devel xterm + # Get the wrapper script for preparing the build environment + $ 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 + $ chmod +x build_inf_prepare.sh + $ WORKSPACE=/path/to/workspace + $ ./build_inf_prepare.sh -w ${WORKSPACE} -2. Use wrapper script build_inf.sh to setup build env and build the INF AIO x86 image -------------------------------------------------------------------------------------- +2.2.2 Use wrapper script build_inf_centos.sh to build the CentOS based image +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ :: - # Get the wrapper script with either curl or wget - $ curl -o build_inf.sh 'https://gerrit.o-ran-sc.org/r/gitweb?p=pti/rtp.git;a=blob_plain;f=scripts/build_inf.sh;hb=HEAD' - $ wget -O build_inf.sh 'https://gerrit.o-ran-sc.org/r/gitweb?p=pti/rtp.git;a=blob_plain;f=scripts/build_inf.sh;hb=HEAD' + # Get the wrapper script to build the centos image + $ 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' - $ chmod +x build_inf.sh + $ chmod +x build_inf_centos.sh $ WORKSPACE=/path/to/workspace - $ ./build_inf.sh -w ${WORKSPACE} + $ ./build_inf_centos.sh -w ${WORKSPACE} If all go well, you will get the ISO image in: -${WORKSPACE}/prj_oran_inf_anaconda/tmp-glibc/deploy/images/intel-corei7-64/inf-image-aio-installer-intel-corei7-64.iso +${WORKSPACE}/prj_output/inf-image-centos-all-x86-64.iso + -3. (Optional) Use wrapper script build_oran.sh to setup build env and build the lagecy x86 image ------------------------------------------------------------------------------------------------- +2.3 How to build the Yocto based image +-------------------------------------- -Note: The lagecy image is the Kubernetes Cluster image as the same one in Amber (1.0) release. +2.3.1 Prerequisite for Yocto build environment +++++++++++++++++++++++++++++++++++++++++++++++ + +* Your host need to meet the requirements for Yocto, please refer to: + + * `Compatible Linux Distribution`_ + * `Supported Linux Distributions`_ + * `Required Packages for the Build Host`_ + +The recommended and tested host is Ubuntu 16.04/18.04 and CentOS 7. + +* To install the required packages for Ubuntu 16.04/18.04: + +.. _`Compatible Linux Distribution`: https://www.yoctoproject.org/docs/2.7.3/brief-yoctoprojectqs/brief-yoctoprojectqs.html#brief-compatible-distro +.. _`Supported Linux Distributions`: https://www.yoctoproject.org/docs/2.7.3/ref-manual/ref-manual.html#detailed-supported-distros +.. _`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 :: - # Get the wrapper script with either curl or wget - $ curl -o build_oran.sh 'https://gerrit.o-ran-sc.org/r/gitweb?p=pti/rtp.git;a=blob_plain;f=scripts/build_oran.sh;hb=HEAD' - $ wget -O build_oran.sh 'https://gerrit.o-ran-sc.org/r/gitweb?p=pti/rtp.git;a=blob_plain;f=scripts/build_oran.sh;hb=HEAD' + $ sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \ + build-essential chrpath socat cpio python python3 python3-pip python3-pexpect \ + xz-utils debianutils iputils-ping make xsltproc docbook-utils fop dblatex xmlto \ + python-git - $ chmod +x build_oran.sh - $ WORKSPACE=/path/to/workspace_lagecy - $ ./build_oran.sh -w ${WORKSPACE} +* To install the required packages for CentOS 7: -If all go well, you will get the ISO image in: -${WORKSPACE}/prj_oran_inf/tmp-glibc/deploy/images/intel-x86-64/oran-image-inf-host-intel-x86-64.iso +:: -4. (Optional) Use wrapper script build_oran.sh to setup build env and build the ARM Kubernetes Cluster image ------------------------------------------------------------------------------------------------------------- + $ sudo yum install -y epel-release + $ sudo yum makecache + $ sudo yum install gawk make wget tar bzip2 gzip python unzip perl patch \ + diffutils diffstat git cpp gcc gcc-c++ glibc-devel texinfo chrpath socat \ + perl-Data-Dumper perl-Text-ParseWords perl-Thread-Queue perl-Digest-SHA \ + python34-pip xz which SDL-devel xterm -Note: - * the ARM Kubernetes Cluster image only supports the BSP nxp-lx2xxx and is verified with the board NXP LX2160ARDB - * The ISO image is supported yet. +2.3.2 Use wrapper script build_inf_yocto.sh to setup build the Yocto based image +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ :: # Get the wrapper script with either curl or wget - $ curl -o build_oran.sh 'https://gerrit.o-ran-sc.org/r/gitweb?p=pti/rtp.git;a=blob_plain;f=scripts/build_oran.sh;hb=HEAD' - $ wget -O build_oran.sh 'https://gerrit.o-ran-sc.org/r/gitweb?p=pti/rtp.git;a=blob_plain;f=scripts/build_oran.sh;hb=HEAD' + $ 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' + $ 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' - $ chmod +x build_oran.sh - $ WORKSPACE=/path/to/workspace_arm - $ ./build_oran.sh -w ${WORKSPACE} -b nxp-lx2xxx + $ chmod +x build_inf_yocto.sh + $ WORKSPACE=/path/to/workspace + $ ./build_inf_yocto.sh -w ${WORKSPACE} + +If all go well, you will get the ISO image in: +${WORKSPACE}/prj_output/inf-image-yocto-aio-x86-64.iso -If all go well, you will get the rootfs image in: -${WORKSPACE}/prj_oran_inf/tmp-glibc/deploy/images/nxp-lx2xxx/oran-image-inf-host-nxp-lx2xxx.tar.bz2