blob: 15a265c2303c4d2eef81cd7da4d412f5654980b4 [file] [log] [blame]
Tomáš Levora418db4d2019-01-30 13:17:50 +01001.. This work is licensed under a Creative Commons Attribution 4.0 International License.
2.. http://creativecommons.org/licenses/by/4.0
Bartek Grzybowskie12f9742021-03-22 13:10:22 +01003.. Copyright 2021 Samsung Electronics Co., Ltd.
Tomáš Levora418db4d2019-01-30 13:17:50 +01004
Bartek Grzybowskie12f9742021-03-22 13:10:22 +01005Offline Installer Package Build Guide
6=====================================
Tomáš Levora418db4d2019-01-30 13:17:50 +01007
Bartek Grzybowskid1e27ba2021-03-22 16:35:31 +01008This document describes how to build offline installer packages. The build process should be triggered on a host with internet connectivity. It will retrieve all artifacts required for ONAP deployment based on both - static data list files and dynamically assembled ones. The host used for the procedure in this guide should be preferably a separate build server.
Tomáš Levora418db4d2019-01-30 13:17:50 +01009
Bartek Grzybowski632891d2021-09-24 12:25:33 +020010Procedure was completely tested on RHEL 7.9 as its the default target installation platform, however with small adaptations it should be applicable also for other platforms.
11Some discrepancies when Centos 7.9 is used are described below as well.
Tomáš Levora418db4d2019-01-30 13:17:50 +010012
Ondřej Šmaleccb26bd82020-01-23 11:40:54 +010013
Bartek Grzybowskifa071a12021-03-18 15:47:45 +010014Part 1. Prerequisites
Bartek Grzybowskie12f9742021-03-22 13:10:22 +010015---------------------
Tomáš Levora418db4d2019-01-30 13:17:50 +010016
Bartek Grzybowski632891d2021-09-24 12:25:33 +020017We assume that procedure is executed on RHEL 7.9 server with \~300G disc space, 16G+ RAM and internet connectivity.
Tomáš Levora418db4d2019-01-30 13:17:50 +010018
Bartek Grzybowski632891d2021-09-24 12:25:33 +020019Some additional software packages are required by ONAP Offline platform building tooling. In order to install them following repos have to be configured for RHEL 7.9 platform.
Tomáš Levora418db4d2019-01-30 13:17:50 +010020
Michal Ptacek1d0c0e72019-04-05 06:39:31 +000021
Tomáš Levora418db4d2019-01-30 13:17:50 +010022
Denis Kasanic01fd0952019-11-05 09:50:00 +010023.. note::
24 All commands stated in this guide are meant to be run in root shell.
25
Tomáš Levora418db4d2019-01-30 13:17:50 +010026::
27
Michal Ptacek1d0c0e72019-04-05 06:39:31 +000028 ############
Bartek Grzybowski632891d2021-09-24 12:25:33 +020029 # RHEL 7.9 #
Michal Ptacek1d0c0e72019-04-05 06:39:31 +000030 ############
31
Tomáš Levora418db4d2019-01-30 13:17:50 +010032 # Register server
33 subscription-manager register --username <rhel licence name> --password <password> --auto-attach
34
Bartek Grzybowskid1e27ba2021-03-22 16:35:31 +010035 # required by custom docker version recommended by ONAP
Michal Ptacek4aff8f42019-05-31 14:12:14 +000036 yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
Tomáš Levora418db4d2019-01-30 13:17:50 +010037
Michal Ptacek4aff8f42019-05-31 14:12:14 +000038 # required by docker dependencies i.e. docker-selinux
39 subscription-manager repos --enable=rhel-7-server-extras-rpms
40
41 # epel is required by npm within blob build
42 rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
Tomáš Levora418db4d2019-01-30 13:17:50 +010043
Michal Ptacek1d0c0e72019-04-05 06:39:31 +000044Alternatively
45
46::
47
48 ##############
Bartek Grzybowski632891d2021-09-24 12:25:33 +020049 # Centos 7.9 #
Michal Ptacek1d0c0e72019-04-05 06:39:31 +000050 ##############
51
Bartek Grzybowskid1e27ba2021-03-22 16:35:31 +010052 # required by custom docker version recommended by ONAP
Michal Ptacek4aff8f42019-05-31 14:12:14 +000053 yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
54
Michal Ptacek1d0c0e72019-04-05 06:39:31 +000055 # enable epel repo for npm and jq
56 yum install -y epel-release
57
58Subsequent steps are the same on both platforms:
59
60::
61
Tomáš Levora418db4d2019-01-30 13:17:50 +010062 # install following packages
Bartek Grzybowski0f96f3e2021-02-19 14:43:10 +010063 yum install -y docker-ce-19.03.15 git createrepo expect nodejs npm jq
Tomáš Levora418db4d2019-01-30 13:17:50 +010064
Tomáš Levorad6d93a22020-03-31 10:15:32 +020065 # install Python 3
Michal Ptacek26278df2019-07-09 10:46:26 +000066 yum install -y python36 python36-pip
Milan Verespej11e84f52019-06-18 18:34:26 +020067
Bartek Grzybowskid1e27ba2021-03-22 16:35:31 +010068 # ensure docker daemon is running
Michal Ptacek4aff8f42019-05-31 14:12:14 +000069 service docker start
Tomáš Levora418db4d2019-01-30 13:17:50 +010070
71Then it is necessary to clone all installer and build related repositories and prepare the directory structure.
72
73::
74
75 # prepare the onap build directory structure
76 cd /tmp
Bartek Grzybowskic241f2f2019-03-14 09:38:52 +010077 git clone https://gerrit.onap.org/r/oom/offline-installer onap-offline
Tomáš Levora418db4d2019-01-30 13:17:50 +010078 cd onap-offline
79
Mateusz Pilat8fb56a92019-07-08 12:08:01 +020080 # install required pip packages for build and download scripts
81 pip3 install -r ./build/requirements.txt
Milan Verespej11e84f52019-06-18 18:34:26 +020082 pip3 install -r ./build/download/requirements.txt
Michal Ptacek4aff8f42019-05-31 14:12:14 +000083
Tomáš Levora418db4d2019-01-30 13:17:50 +010084Part 2. Download artifacts for offline installer
85------------------------------------------------
86
Bartek Grzybowskid1e27ba2021-03-22 16:35:31 +010087Generate the actual list of docker images that are defined within OOM helm charts. Run the docker-images-collector.sh script (check script for runtime dependencies) from cloned OOM repository.
Tomáš Levora738f3e22019-07-09 12:07:51 +020088
Bartek Grzybowskifa071a12021-03-18 15:47:45 +010089At the beginning of the generated list file there is the OOM repo commit sha from which it was created - the same commit reference
90should be used in **Part 4. Packages preparation** as *--application-repository_reference* option value.
Tomáš Levora738f3e22019-07-09 12:07:51 +020091
Bartek Grzybowskifa071a12021-03-18 15:47:45 +010092Following example will create the list to the default path (*build/data_lists/onap_docker_images.list*):
93
94::
Tomáš Levora738f3e22019-07-09 12:07:51 +020095
96 # clone the OOM repository
Ondřej Šmaleccb26bd82020-01-23 11:40:54 +010097 git clone https://gerrit.onap.org/r/oom -b <branch> --recurse-submodules /tmp/oom
Tomáš Levora738f3e22019-07-09 12:07:51 +020098 #run the collector providing path the the project
99 ./build/creating_data/docker-images-collector.sh /tmp/oom/kubernetes/onap
100
Bartek Grzybowskifa071a12021-03-18 15:47:45 +0100101For the list of all available options check script usage info.
Tomáš Levora738f3e22019-07-09 12:07:51 +0200102
Bartek Grzybowskifa071a12021-03-18 15:47:45 +0100103.. note:: replace <branch> with OOM branch you want to build
Tomáš Levora418db4d2019-01-30 13:17:50 +0100104
Bartek Grzybowskifa071a12021-03-18 15:47:45 +0100105.. note:: docker-images-collector.sh script uses oom/kubernetes/onap/resources/overrides/onap-all.yaml file to find what subsystems are enabled. By default all subsystems are enabled there. Modify the file to disable some of them if needed.
106
107.. note:: Skip this step if you have already all necessary resources and continue with **Part 3. Populate local nexus**
Jan Benedikt8fdbfe72019-10-15 06:07:46 -0400108
Bartek Grzybowskib2b01a22021-03-25 09:14:59 +0100109.. note:: Docker images collector supports both helm v2 and v3. Please note that helm v3 support was added in Guilin release of OOM and as of Honolulu release helm v2 will be obsolete.
110
Bartek Grzybowskid1e27ba2021-03-22 16:35:31 +0100111Create repository containing OS packages to be installed on all nodes:
Jan Benedikt7c0f6b12019-10-08 10:01:41 -0400112
113::
Jan Benedikt8fdbfe72019-10-15 06:07:46 -0400114
Bartek Grzybowskid1e27ba2021-03-22 16:35:31 +0100115 # run create_repo.sh script to download all required packages with their dependencies
116 # set destination directory for packages with '-d' parameter
117 # optionally use '-t' parameter to set target platform (host platform by default)
Jan Benedikt77459fe2020-02-10 13:46:52 +0100118 ./offline-installer/build/create_repo.sh -d $(pwd) -t centos|rhel|ubuntu
Jan Benedikt7c0f6b12019-10-08 10:01:41 -0400119
Bartek Grzybowskib75d08f2020-01-20 10:01:22 +0100120.. note:: If script fails due to permissions issue, it could be a problem with SeLinux. It can be fixed by running:
Jan Benedikt7c0f6b12019-10-08 10:01:41 -0400121 ::
Jan Benedikt8fdbfe72019-10-15 06:07:46 -0400122
Jan Benedikt7c0f6b12019-10-08 10:01:41 -0400123 # Change security context of directory
124 chcon -Rt svirt_sandbox_file_t $(pwd)
125
Bartek Grzybowskid1e27ba2021-03-22 16:35:31 +0100126Download all required binaries and docker images. Run download.py twice (as shown below) as it does not support mixing downloading docker images to a local directory and pulling them to local docker engine cache in one run. Docker images from *infra_docker_images.list* need to be saved to resources directory while the rest of the images need to be just pulled locally:
Tomáš Levora418db4d2019-01-30 13:17:50 +0100127
Michal Ptacek1d0c0e72019-04-05 06:39:31 +0000128::
129
Bartek Grzybowskid1e27ba2021-03-22 16:35:31 +0100130 # all data lists are taken from ./build/data_lists/ folder by default
131 # all resources will be stored in expected folder structure within "../resources" folder
Milan Verespejd85b2d72019-06-05 13:58:38 +0200132 ./build/download/download.py --docker ./build/data_lists/infra_docker_images.list ../resources/offline_data/docker_images_infra \
Bartek Grzybowski8aa5c682021-06-21 16:04:38 +0200133 --http ./build/data_lists/infra_bin_utils.list ../resources/downloads \
134 --http ./build/data_lists/kube_prometheus_stack_http.list ../resources/downloads
Denis Kasanica7702f22019-11-14 12:35:46 +0100135
Bartek Grzybowskid1e27ba2021-03-22 16:35:31 +0100136 # second argument for --docker is not present, images are just pulled and cached
Denis Kasanica7702f22019-11-14 12:35:46 +0100137 ./build/download/download.py --docker ./build/data_lists/rke_docker_images.list \
Denis Kasanic01fd0952019-11-05 09:50:00 +0100138 --docker ./build/data_lists/k8s_docker_images.list \
Bartek Grzybowski8aa5c682021-06-21 16:04:38 +0200139 --docker ./build/data_lists/onap_docker_images.list \
140 --docker ./build/data_lists/kube_prometheus_stack_docker_images.list
Tomáš Levora418db4d2019-01-30 13:17:50 +0100141
Tomáš Levora418db4d2019-01-30 13:17:50 +0100142
Tomáš Levora418db4d2019-01-30 13:17:50 +0100143
144Part 3. Populate local nexus
145----------------------------
146
Bartek Grzybowskid1e27ba2021-03-22 16:35:31 +0100147In order to build nexus blob all docker images required for ONAP offline platform should be available locally (see Part 2).
Tomáš Levora418db4d2019-01-30 13:17:50 +0100148
Denis Kasanic01fd0952019-11-05 09:50:00 +0100149.. note:: In case you skipped the Part 2 for the artifacts download, please ensure that the onap docker images are cached and copy of resources data are untarred in *./onap-offline/../resources/*
Tomáš Levora418db4d2019-01-30 13:17:50 +0100150
Bartek Grzybowskid1e27ba2021-03-22 16:35:31 +0100151*build_nexus_blob.sh* script will run the Nexus container and configure it as docker repository. Then it will push all docker images from previously generated list to it. After that the repository container is stopped and its filesystem gets saved to resources directory.
152
Denis Kasanic01fd0952019-11-05 09:50:00 +0100153::
154
Denis Kasanic01fd0952019-11-05 09:50:00 +0100155 ./onap-offline/build/build_nexus_blob.sh
156
Bartek Grzybowskid1e27ba2021-03-22 16:35:31 +0100157It will load the listed docker images, run the Nexus, configure it as npm, pypi and docker repositories. Then it will push all listed docker images to the repositories. After all is done the repository container is stopped.
Tomáš Levora418db4d2019-01-30 13:17:50 +0100158
Bartek Grzybowskid1e27ba2021-03-22 16:35:31 +0100159.. note:: By default the script uses data lists from ./build/data_lists/ directory and saves the blob to ../resources/nexus_data.
160
161.. note:: By default the script uses "nexus" for the container name and binds 8081 and 8082 ports. Should those names/ports be already used please check the script options on how to customize them.
Michal Ptacek4aff8f42019-05-31 14:12:14 +0000162
Tomáš Levora418db4d2019-01-30 13:17:50 +0100163
Mateusz Pilat8fb56a92019-07-08 12:08:01 +0200164Part 4. Packages preparation
Bartek Grzybowskid1e27ba2021-03-22 16:35:31 +0100165----------------------------
Tomáš Levora418db4d2019-01-30 13:17:50 +0100166
Mateusz Pilat8fb56a92019-07-08 12:08:01 +0200167ONAP offline deliverable consist of 3 packages:
168
Bartek Grzybowskid1e27ba2021-03-22 16:35:31 +0100169+---------------------------------------+------------------------------------------------------------------------------------+
170| Package | Description |
171+=======================================+====================================================================================+
172| sw_package.tar | Contains provisioning software and configuration for infrastructure and ONAP |
173+---------------------------------------+------------------------------------------------------------------------------------+
174| resources_package.tar | Contains all binary data and config files needed to deploy infrastructure and ONAP |
175+---------------------------------------+------------------------------------------------------------------------------------+
176| aux_package.tar | Contains auxiliary input files that can be added to ONAP |
177+---------------------------------------+------------------------------------------------------------------------------------+
Mateusz Pilat8fb56a92019-07-08 12:08:01 +0200178
Bartek Grzybowskid1e27ba2021-03-22 16:35:31 +0100179All packages can be created using build/package.py script. Beside of archiving files gathered in the previous steps, script also builds docker images used on infra server.
Mateusz Pilat8fb56a92019-07-08 12:08:01 +0200180
181From onap-offline directory run:
Tomáš Levora418db4d2019-01-30 13:17:50 +0100182
Michal Ptacek1d0c0e72019-04-05 06:39:31 +0000183::
184
Denis Kasanica7702f22019-11-14 12:35:46 +0100185 ./build/package.py <helm charts repo> --build-version <version> --application-repository_reference <commit/tag/branch> --output-dir <target\_dir> --resources-directory <target\_dir>
Tomáš Levora418db4d2019-01-30 13:17:50 +0100186
187For example:
188
Michal Ptacek1d0c0e72019-04-05 06:39:31 +0000189::
190
Ondřej Šmaleccb26bd82020-01-23 11:40:54 +0100191 ./build/package.py https://gerrit.onap.org/r/oom --application-repository_reference <branch> --output-dir /tmp/packages --resources-directory /tmp/resources
Tomáš Levora418db4d2019-01-30 13:17:50 +0100192
Ondřej Šmaleccb26bd82020-01-23 11:40:54 +0100193.. note:: replace <branch> by branch you want to build
Tomáš Levora418db4d2019-01-30 13:17:50 +0100194
Bartek Grzybowskid1e27ba2021-03-22 16:35:31 +0100195Above command should produce following tar files in the target directory:
Tomáš Levora418db4d2019-01-30 13:17:50 +0100196
Michal Ptacek1d0c0e72019-04-05 06:39:31 +0000197::
198
Mateusz Pilat8fb56a92019-07-08 12:08:01 +0200199 sw_package.tar
200 resources_package.tar
201 aux_package.tar
Michal Ptacek4aff8f42019-05-31 14:12:14 +0000202