blob: 8b0c9b283ccb13fb027a631c76e267744e6aec4f [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
3.. Copyright 2019 Samsung Electronics Co., Ltd.
4
5OOM ONAP Offline Installer Package Build Guide
6=============================================================
7
8This document is describing procedure for building offline installer packages. It is supposed to be triggered on server with internet connectivity and will download all artifacts required for ONAP deployment based on our static lists. The server used for the procedure in this guide is preferred to be separate build server.
9
Michal Ptacek1d0c0e72019-04-05 06:39:31 +000010Procedure was completely tested on RHEL 7.6 as its tested target platform, however with small adaptations it should be applicable also for other platforms.
11Some discrepancies when Centos 7.6 is used are described below as well.
Tomáš Levora418db4d2019-01-30 13:17:50 +010012
13Part 1. Preparations
14--------------------
15
Michal Ptacek1d0c0e72019-04-05 06:39:31 +000016We assume that procedure is executed on RHEL 7.6 server with \~300G disc space, 16G+ RAM and internet connectivity
Tomáš Levora418db4d2019-01-30 13:17:50 +010017
Michal Ptacek4aff8f42019-05-31 14:12:14 +000018Some additional sw packages are required by ONAP Offline platform building tooling. in order to install them
19following repos has to be configured for RHEL 7.6 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
23::
24
Michal Ptacek1d0c0e72019-04-05 06:39:31 +000025 ############
26 # RHEL 7.6 #
27 ############
28
Tomáš Levora418db4d2019-01-30 13:17:50 +010029 # Register server
30 subscription-manager register --username <rhel licence name> --password <password> --auto-attach
31
Michal Ptacek4aff8f42019-05-31 14:12:14 +000032 # required by special centos docker recommended by ONAP
33 yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
Tomáš Levora418db4d2019-01-30 13:17:50 +010034
Michal Ptacek4aff8f42019-05-31 14:12:14 +000035 # required by docker dependencies i.e. docker-selinux
36 subscription-manager repos --enable=rhel-7-server-extras-rpms
37
38 # epel is required by npm within blob build
39 rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
Tomáš Levora418db4d2019-01-30 13:17:50 +010040
Michal Ptacek1d0c0e72019-04-05 06:39:31 +000041Alternatively
42
43::
44
Michal Ptacek4aff8f42019-05-31 14:12:14 +000045 ToDo: newer download scripts needs to be verified on Centos with ONAP Dublin
46
Michal Ptacek1d0c0e72019-04-05 06:39:31 +000047 ##############
48 # Centos 7.6 #
49 ##############
50
Michal Ptacek4aff8f42019-05-31 14:12:14 +000051 # required by special centos docker recommended by ONAP
52 yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
53
Michal Ptacek1d0c0e72019-04-05 06:39:31 +000054 # enable epel repo for npm and jq
55 yum install -y epel-release
56
57Subsequent steps are the same on both platforms:
58
59::
60
Tomáš Levora418db4d2019-01-30 13:17:50 +010061 # install following packages
Michal Ptacek4aff8f42019-05-31 14:12:14 +000062 yum install -y docker-ce-18.09.5 python-pip git createrepo expect nodejs npm jq
Tomáš Levora418db4d2019-01-30 13:17:50 +010063
Milan Verespej11e84f52019-06-18 18:34:26 +020064 # install Python 3 (download scripts don't support Python 2 anymore)
Michal Ptacek26278df2019-07-09 10:46:26 +000065 yum install -y python36 python36-pip
Milan Verespej11e84f52019-06-18 18:34:26 +020066
Michal Ptacek4aff8f42019-05-31 14:12:14 +000067 # twine package is needed by nexus blob build script
Tomáš Levora1d902342019-02-05 10:01:43 +010068 pip install twine
69
Michal Ptacek4aff8f42019-05-31 14:12:14 +000070 # docker daemon must be running on host
71 service docker start
Tomáš Levora418db4d2019-01-30 13:17:50 +010072
73Then it is necessary to clone all installer and build related repositories and prepare the directory structure.
74
75::
76
77 # prepare the onap build directory structure
78 cd /tmp
Bartek Grzybowskic241f2f2019-03-14 09:38:52 +010079 git clone https://gerrit.onap.org/r/oom/offline-installer onap-offline
Tomáš Levora418db4d2019-01-30 13:17:50 +010080 cd onap-offline
81
Mateusz Pilat8fb56a92019-07-08 12:08:01 +020082 # install required pip packages for build and download scripts
83 pip3 install -r ./build/requirements.txt
Milan Verespej11e84f52019-06-18 18:34:26 +020084 pip3 install -r ./build/download/requirements.txt
Michal Ptacek4aff8f42019-05-31 14:12:14 +000085
Tomáš Levora418db4d2019-01-30 13:17:50 +010086Part 2. Download artifacts for offline installer
87------------------------------------------------
88
Tomáš Levora738f3e22019-07-09 12:07:51 +020089.. note::
90 It is possible to generate actual list of docker images using docker-images-collector.sh (helm is required) from cloned OOM directory
91 based on enabled subsystems.
92
93 In the beginning of the generated list is written commit number from which it was created - the same commit number should be used
94 in Part 4. Packages preparation.
95
96 Following example will create the list to the default path:
97 ::
98
99 # clone the OOM repository
100 git clone https://gerrit.onap.org/r/oom -b master /tmp/oom
101
102 # enable subsystems in oom/kubernetes/onap/values.yaml as required
103
104 #run the collector providing path the the project
105 ./build/creating_data/docker-images-collector.sh /tmp/oom/kubernetes/onap
106
107 If the list does not contain any image, no subsystem is enabled in the oom/kubernetes/onap/values.yaml
108
109 For the other options check the usage of the script.
110
Michal Ptacek1d0c0e72019-04-05 06:39:31 +0000111.. note:: Skip this step if you have already all necessary resources and continue with Part 3. Populate local nexus
Tomáš Levora418db4d2019-01-30 13:17:50 +0100112
Jan Benedikt8fdbfe72019-10-15 06:07:46 -0400113
114There need to be created RPM repository containing packages which need to be installed on all nodes.
Jan Benedikt7c0f6b12019-10-08 10:01:41 -0400115
116::
Jan Benedikt8fdbfe72019-10-15 06:07:46 -0400117
118 # run the docker container with -d parameter for destination directory with RPM packages
Jan Benedikt7c0f6b12019-10-08 10:01:41 -0400119 ./offline-installer/build/create_repo.sh -d $(pwd)
120
Jan Benedikt8fdbfe72019-10-15 06:07:46 -0400121.. note:: If script fails with permissions, problem could be with SeLinux. Issue is possible to solve by:
Jan Benedikt7c0f6b12019-10-08 10:01:41 -0400122 ::
Jan Benedikt8fdbfe72019-10-15 06:07:46 -0400123
Jan Benedikt7c0f6b12019-10-08 10:01:41 -0400124 # Change security context of directory
125 chcon -Rt svirt_sandbox_file_t $(pwd)
126
127It's possible to download rest artifacts in single ./download.py execution. Recently we improved reliability of download scripts
Michal Ptacek4aff8f42019-05-31 14:12:14 +0000128so one might try following command to download most of the required artifacts in single shot.
Tomáš Levora418db4d2019-01-30 13:17:50 +0100129
Michal Ptacek1d0c0e72019-04-05 06:39:31 +0000130::
131
Michal Ptacek4aff8f42019-05-31 14:12:14 +0000132 # following arguments are provided
133 # all data lists are taken in ./build/data_lists/ folder
134 # all resources will be stored in expected folder structure within ../resources folder
135 # for more details refer to Appendix 1.
Michal Ptacek1d0c0e72019-04-05 06:39:31 +0000136
Milan Verespejd85b2d72019-06-05 13:58:38 +0200137 ./build/download/download.py --docker ./build/data_lists/infra_docker_images.list ../resources/offline_data/docker_images_infra \
138 --docker ./build/data_lists/rke_docker_images.list ../resources/offline_data/docker_images_for_nexus \
139 --docker ./build/data_lists/onap_docker_images.list ../resources/offline_data/docker_images_for_nexus \
140 --git ./build/data_lists/onap_git_repos.list ../resources/git-repo \
141 --npm ./build/data_lists/onap_npm.list ../resources/offline_data/npm_tar \
Milan Verespejd0f76202019-06-10 10:27:20 +0200142 --pypi ./build/data_lists/onap_pip_packages.list ../resources/offline_data/pypi \
143 --http ./build/data_lists/infra_bin_utils.list ../resources/downloads
Tomáš Levora418db4d2019-01-30 13:17:50 +0100144
Tomáš Levora418db4d2019-01-30 13:17:50 +0100145
Michal Ptacek4aff8f42019-05-31 14:12:14 +0000146Alternatively, step-by-step procedure is described in Appendix 1.
Tomáš Levora418db4d2019-01-30 13:17:50 +0100147
Michal Ptacek4aff8f42019-05-31 14:12:14 +0000148This concludes SW download part required for ONAP offline platform creating.
Tomáš Levora418db4d2019-01-30 13:17:50 +0100149
150Part 3. Populate local nexus
151----------------------------
152
153Prerequisites:
154
155- All data lists and resources which are pushed to local nexus repository are available
156- Following ports are not occupied buy another service: 80, 8081, 8082, 10001
157- There's no docker container called "nexus"
158
eronkeo8457e022019-04-24 15:18:18 +0000159.. note:: In case you skipped the Part 2 for the artifacts download, please ensure that the copy of resources data are untarred in *./onap-offline/../resources/*
Tomáš Levora418db4d2019-01-30 13:17:50 +0100160
Michal Ptacek4aff8f42019-05-31 14:12:14 +0000161Whole nexus blob data will be created by running script build_nexus_blob.sh.
Tomáš Levora8d272bd2019-03-12 15:06:35 +0100162It will load the listed docker images, run the Nexus, configure it as npm, pypi
163and docker repositories. Then it will push all listed npm and pypi packages and
164docker images to the repositories. After all is done the repository container
165is stopped.
Tomáš Levora418db4d2019-01-30 13:17:50 +0100166
Michal Ptacek4aff8f42019-05-31 14:12:14 +0000167.. note:: build_nexus_blob.sh script is using docker, npm and pip data lists for building nexus blob. Unfortunatelly we now have 2 different docker data lists (RKE & ONAP). So we need to merge them as visible from following snippet. This problem will be fixed in OOM-1890
168
Tomáš Levora8d272bd2019-03-12 15:06:35 +0100169You can run the script as following example:
Tomáš Levora418db4d2019-01-30 13:17:50 +0100170
Michal Ptacek4aff8f42019-05-31 14:12:14 +0000171::
Tomáš Levora418db4d2019-01-30 13:17:50 +0100172
Michal Ptacek4aff8f42019-05-31 14:12:14 +0000173 # merge RKE and ONAP app data lists
174 cat ./build/data_lists/rke_docker_images.list >> ./build/data_lists/onap_docker_images.list
175
176 ./build/build_nexus_blob.sh
177
178.. note:: in current release scope we aim to maintain just single example data lists set, tags used in previous releases are not needed. Datalists are also covering latest versions verified by us despite user is allowed to build data lists on his own.
Tomáš Levora418db4d2019-01-30 13:17:50 +0100179
Tomáš Levora8d272bd2019-03-12 15:06:35 +0100180Once the Nexus data blob is created, the docker images and npm and pypi
181packages can be deleted to reduce the package size as they won't be needed in
182the installation time:
Tomáš Levora418db4d2019-01-30 13:17:50 +0100183
184E.g.
185
186::
187
Michal Ptacek4aff8f42019-05-31 14:12:14 +0000188 rm -f /tmp/resources/offline_data/docker_images_for_nexus/*
189 rm -rf /tmp/resources/offline_data/npm_tar
190 rm -rf /tmp/resources/offline_data/pypi
Tomáš Levora418db4d2019-01-30 13:17:50 +0100191
Mateusz Pilat8fb56a92019-07-08 12:08:01 +0200192Part 4. Packages preparation
Tomáš Levora418db4d2019-01-30 13:17:50 +0100193--------------------------------------------------------
194
Mateusz Pilat8fb56a92019-07-08 12:08:01 +0200195ONAP offline deliverable consist of 3 packages:
196
197+---------------------------------------+------------------------------------------------------------------------------+
198| Package | Description |
199+=======================================+==============================================================================+
200| sw_package.tar | Contains installation software and configuration for infrastructure and ONAP |
201+---------------------------------------+------------------------------------------------------------------------------+
202| resources_package.tar | Contains all input files needed to deploy infrastructure and ONAP |
203+---------------------------------------+------------------------------------------------------------------------------+
204| aux_package.tar | Contains auxiliary input files that can be added to ONAP |
205+---------------------------------------+------------------------------------------------------------------------------+
206
207All packages can be created using script build/package.py. Beside of archiving files gathered in the previous steps, script also builds installer software and apply patch over application repository to make it usable without internet access.
208
209From onap-offline directory run:
Tomáš Levora418db4d2019-01-30 13:17:50 +0100210
Michal Ptacek1d0c0e72019-04-05 06:39:31 +0000211::
212
Mateusz Pilat8fb56a92019-07-08 12:08:01 +0200213 ./build/package.py <helm charts repo> --application-repository_reference <commit/tag/branch> --application-patch_file <patchfile> --output-dir <target\_dir> --resources-directory <target\_dir>
Tomáš Levora418db4d2019-01-30 13:17:50 +0100214
215For example:
216
Michal Ptacek1d0c0e72019-04-05 06:39:31 +0000217::
218
Mateusz Pilat8fb56a92019-07-08 12:08:01 +0200219 ./build/package.py https://gerrit.onap.org/r/oom --application-repository_reference master --application-patch_file ./patches/onap.patch --output-dir ../packages --resources-directory ../resources
Tomáš Levora418db4d2019-01-30 13:17:50 +0100220
Tomáš Levora418db4d2019-01-30 13:17:50 +0100221
Mateusz Pilat8fb56a92019-07-08 12:08:01 +0200222In the target directory you should find tar files:
Tomáš Levora418db4d2019-01-30 13:17:50 +0100223
Michal Ptacek1d0c0e72019-04-05 06:39:31 +0000224::
225
Mateusz Pilat8fb56a92019-07-08 12:08:01 +0200226 sw_package.tar
227 resources_package.tar
228 aux_package.tar
Michal Ptacek4aff8f42019-05-31 14:12:14 +0000229
230
231Appendix 1. Step-by-step download procedure
232-------------------------------------------
233
234**Step 1 - docker images**
235
236::
237
238 # This step will parse all 3 docker datalists (offline infrastructure images, rke k8s images & onap images)
239 # and start building onap offline platform in /tmp/resources folder
240
Milan Verespejd85b2d72019-06-05 13:58:38 +0200241 ./build/download/download.py --docker ./build/data_lists/infra_docker_images.list ../resources/offline_data/docker_images_infra \
242 --docker ./build/data_lists/rke_docker_images.list ../resources/offline_data/docker_images_for_nexus \
243 --docker ./build/data_lists/onap_docker_images.list ../resources/offline_data/docker_images_for_nexus
Michal Ptacek4aff8f42019-05-31 14:12:14 +0000244
245
Mateusz Pilat8fb56a92019-07-08 12:08:01 +0200246**Step 2 - git repos**
Michal Ptacek4aff8f42019-05-31 14:12:14 +0000247
248::
249
250 # Following step will download all git repos
251 ./build/download/download.py --git ./build/data_lists/onap_git_repos.list ../resources/git-repo
252
Michal Ptacek4aff8f42019-05-31 14:12:14 +0000253
Mateusz Pilat8fb56a92019-07-08 12:08:01 +0200254**Step 3 - npm packages**
Michal Ptacek4aff8f42019-05-31 14:12:14 +0000255
256::
257
258 # Following step will download all npm packages
259 ./build/download/download.py --npm ./build/data_lists/onap_npm.list ../resources/offline_data/npm_tar
260
Mateusz Pilat8fb56a92019-07-08 12:08:01 +0200261**Step 4 - binaries**
Michal Ptacek4aff8f42019-05-31 14:12:14 +0000262
263::
264
Tomáš Levoraf6bd9372019-06-14 10:54:39 +0200265 # Following step will download rke, kubectl and helm binaries
Milan Verespejd0f76202019-06-10 10:27:20 +0200266 ./build/download/download.py --http ./build/data_lists/infra_bin_utils.sh ../resources/downloads
Michal Ptacek4aff8f42019-05-31 14:12:14 +0000267
Jan Benedikt8fdbfe72019-10-15 06:07:46 -0400268**Step 5 - pip packages**
Michal Ptacek4aff8f42019-05-31 14:12:14 +0000269
Michal Ptacek4aff8f42019-05-31 14:12:14 +0000270::
271
272 # Following step will download all pip packages
Milan Verespejd85b2d72019-06-05 13:58:38 +0200273 ./build/download/download.py --pypi ./build/data_lists/onap_pip_packages.list ../resources/offline_data/pypi
Michal Ptacek4aff8f42019-05-31 14:12:14 +0000274