blob: 6b44f23041ffd87cf6515f28c45df29b3df2c912 [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
Michal Ptacek4aff8f42019-05-31 14:12:14 +000064 # twine package is needed by nexus blob build script
Tomáš Levora1d902342019-02-05 10:01:43 +010065 pip install twine
66
Michal Ptacek4aff8f42019-05-31 14:12:14 +000067 # docker daemon must be running on host
68 service docker start
Tomáš Levora418db4d2019-01-30 13:17:50 +010069
70Then it is necessary to clone all installer and build related repositories and prepare the directory structure.
71
72::
73
74 # prepare the onap build directory structure
75 cd /tmp
Bartek Grzybowskic241f2f2019-03-14 09:38:52 +010076 git clone https://gerrit.onap.org/r/oom/offline-installer onap-offline
Tomáš Levora418db4d2019-01-30 13:17:50 +010077 cd onap-offline
78
Michal Ptacek4aff8f42019-05-31 14:12:14 +000079 # install required pip packages for download scripts
80 pip install -r ./build/download/requirements.txt
81
Tomáš Levora418db4d2019-01-30 13:17:50 +010082Part 2. Download artifacts for offline installer
83------------------------------------------------
84
Michal Ptacek1d0c0e72019-04-05 06:39:31 +000085.. 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 +010086
Michal Ptacek4aff8f42019-05-31 14:12:14 +000087It's possible to download all artifacts in single ./download.py execution. Recently we improved reliability of download scripts
88so one might try following command to download most of the required artifacts in single shot.
Tomáš Levora418db4d2019-01-30 13:17:50 +010089
Michal Ptacek4aff8f42019-05-31 14:12:14 +000090**Step1 - download wrapper script execution**
Tomáš Levora418db4d2019-01-30 13:17:50 +010091
Michal Ptacek1d0c0e72019-04-05 06:39:31 +000092::
93
Michal Ptacek4aff8f42019-05-31 14:12:14 +000094 # following arguments are provided
95 # all data lists are taken in ./build/data_lists/ folder
96 # all resources will be stored in expected folder structure within ../resources folder
97 # for more details refer to Appendix 1.
Michal Ptacek1d0c0e72019-04-05 06:39:31 +000098
Milan Verespejd85b2d72019-06-05 13:58:38 +020099 ./build/download/download.py --docker ./build/data_lists/infra_docker_images.list ../resources/offline_data/docker_images_infra \
100 --docker ./build/data_lists/rke_docker_images.list ../resources/offline_data/docker_images_for_nexus \
101 --docker ./build/data_lists/onap_docker_images.list ../resources/offline_data/docker_images_for_nexus \
102 --git ./build/data_lists/onap_git_repos.list ../resources/git-repo \
103 --npm ./build/data_lists/onap_npm.list ../resources/offline_data/npm_tar \
104 --rpm ./build/data_lists/onap_rpm.list ../resources/pkg/rhel \
Milan Verespejd0f76202019-06-10 10:27:20 +0200105 --pypi ./build/data_lists/onap_pip_packages.list ../resources/offline_data/pypi \
106 --http ./build/data_lists/infra_bin_utils.list ../resources/downloads
Tomáš Levora418db4d2019-01-30 13:17:50 +0100107
Tomáš Levora418db4d2019-01-30 13:17:50 +0100108
Michal Ptacek4aff8f42019-05-31 14:12:14 +0000109Alternatively, step-by-step procedure is described in Appendix 1.
Tomáš Levora418db4d2019-01-30 13:17:50 +0100110
Michal Ptacek4aff8f42019-05-31 14:12:14 +0000111Following steps are still required and are not supported by current version of download.py script.
Tomáš Levora418db4d2019-01-30 13:17:50 +0100112
Michal Ptacek4aff8f42019-05-31 14:12:14 +0000113**Step 2 - Building own dns image**
Tomáš Levora418db4d2019-01-30 13:17:50 +0100114
115::
116
Michal Ptacek4aff8f42019-05-31 14:12:14 +0000117 # We are building our own dns image within our offline infrastructure
118 ./build/creating_data/create_nginx_image/01create-image.sh /tmp/resources/offline_data/docker_images_infra
Tomáš Levora418db4d2019-01-30 13:17:50 +0100119
Tomáš Levora418db4d2019-01-30 13:17:50 +0100120
Michal Ptacek34cd5082019-06-26 15:29:07 +0000121**Step 3 - Create repo**
Tomáš Levora418db4d2019-01-30 13:17:50 +0100122
123::
124
Michal Ptacek4aff8f42019-05-31 14:12:14 +0000125 createrepo ../resources/pkg/rhel
Tomáš Levora418db4d2019-01-30 13:17:50 +0100126
Tomáš Levora418db4d2019-01-30 13:17:50 +0100127
Michal Ptacek4aff8f42019-05-31 14:12:14 +0000128This concludes SW download part required for ONAP offline platform creating.
Tomáš Levora418db4d2019-01-30 13:17:50 +0100129
130Part 3. Populate local nexus
131----------------------------
132
133Prerequisites:
134
135- All data lists and resources which are pushed to local nexus repository are available
136- Following ports are not occupied buy another service: 80, 8081, 8082, 10001
137- There's no docker container called "nexus"
138
eronkeo8457e022019-04-24 15:18:18 +0000139.. 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 +0100140
Michal Ptacek4aff8f42019-05-31 14:12:14 +0000141Whole nexus blob data will be created by running script build_nexus_blob.sh.
Tomáš Levora8d272bd2019-03-12 15:06:35 +0100142It will load the listed docker images, run the Nexus, configure it as npm, pypi
143and docker repositories. Then it will push all listed npm and pypi packages and
144docker images to the repositories. After all is done the repository container
145is stopped.
Tomáš Levora418db4d2019-01-30 13:17:50 +0100146
Michal Ptacek4aff8f42019-05-31 14:12:14 +0000147.. 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
148
Tomáš Levora8d272bd2019-03-12 15:06:35 +0100149You can run the script as following example:
Tomáš Levora418db4d2019-01-30 13:17:50 +0100150
Michal Ptacek4aff8f42019-05-31 14:12:14 +0000151::
Tomáš Levora418db4d2019-01-30 13:17:50 +0100152
Michal Ptacek4aff8f42019-05-31 14:12:14 +0000153 # merge RKE and ONAP app data lists
154 cat ./build/data_lists/rke_docker_images.list >> ./build/data_lists/onap_docker_images.list
155
156 ./build/build_nexus_blob.sh
157
158.. 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 +0100159
Tomáš Levora8d272bd2019-03-12 15:06:35 +0100160Once the Nexus data blob is created, the docker images and npm and pypi
161packages can be deleted to reduce the package size as they won't be needed in
162the installation time:
Tomáš Levora418db4d2019-01-30 13:17:50 +0100163
164E.g.
165
166::
167
Michal Ptacek4aff8f42019-05-31 14:12:14 +0000168 rm -f /tmp/resources/offline_data/docker_images_for_nexus/*
169 rm -rf /tmp/resources/offline_data/npm_tar
170 rm -rf /tmp/resources/offline_data/pypi
Tomáš Levora418db4d2019-01-30 13:17:50 +0100171
172Part 4. Application helm charts preparation and patching
173--------------------------------------------------------
174
175This is about to clone oom repository and patch it to be able to use it
176offline. Use the following command:
177
Michal Ptacek1d0c0e72019-04-05 06:39:31 +0000178::
179
Michal Ptacek4aff8f42019-05-31 14:12:14 +0000180 ./build/fetch_and_patch_charts.sh <helm charts repo> <commit/tag/branch> <patchfile> <target\_dir>
Tomáš Levora418db4d2019-01-30 13:17:50 +0100181
182For example:
183
Michal Ptacek1d0c0e72019-04-05 06:39:31 +0000184::
185
Michal Ptacek4aff8f42019-05-31 14:12:14 +0000186 ./build/fetch_and_patch_charts.sh https://gerrit.onap.org/r/oom 0b904977dde761d189874d6dc6c527cd45928 /tmp/onap-offline/patches/onap.patch /tmp/oom-clone
Tomáš Levora418db4d2019-01-30 13:17:50 +0100187
188Part 5. Creating offline installation package
189---------------------------------------------
190
191For the packagin itself it's necessary to prepare configuration. You can
Samuli Silviusf3eee9e2019-02-10 13:24:03 +0200192use ./build/package.conf as template or
Tomáš Levora418db4d2019-01-30 13:17:50 +0100193directly modify it.
194
Samuli Silvius426e6c02019-02-06 11:25:01 +0200195There are some parameters needs to be set in configuration file.
Samuli Silviusf3eee9e2019-02-10 13:24:03 +0200196Example values below are setup according to steps done in this guide to package ONAP.
Tomáš Levora418db4d2019-01-30 13:17:50 +0100197
198+---------------------------------------+------------------------------------------------------------------------------+
199| Parameter | Description |
200+=======================================+==============================================================================+
Michal Ptacek4aff8f42019-05-31 14:12:14 +0000201| HELM_CHARTS_DIR | directory with Helm charts for the application |
Tomáš Levoraf3491542019-02-20 12:59:14 +0100202| | |
Samuli Silviusf3eee9e2019-02-10 13:24:03 +0200203| | Example: /tmp/oom-clone/kubernetes |
Tomáš Levora418db4d2019-01-30 13:17:50 +0100204+---------------------------------------+------------------------------------------------------------------------------+
Michal Ptacek4aff8f42019-05-31 14:12:14 +0000205| APP_CONFIGURATION | application install configuration (application_configuration.yml) for |
Samuli Silviusf3eee9e2019-02-10 13:24:03 +0200206| | ansible installer and custom ansible role code directories if any. |
Tomáš Levoraf3491542019-02-20 12:59:14 +0100207| | |
208| | Example:: |
209| | |
210| | APP_CONFIGURATION=( |
Michal Ptacekb78bbf82019-05-29 14:56:50 +0000211| | /tmp/onap-offline/config/application_configuration.yml |
212| | /tmp/onap-offline/patches/onap-patch-role |
Tomáš Levoraf3491542019-02-20 12:59:14 +0100213| | ) |
214| | |
Tomáš Levora418db4d2019-01-30 13:17:50 +0100215+---------------------------------------+------------------------------------------------------------------------------+
Michal Ptacek4aff8f42019-05-31 14:12:14 +0000216| APP_BINARY_RESOURCES_DIR | directory with all (binary) resources for offline infra and application |
Tomáš Levoraf3491542019-02-20 12:59:14 +0100217| | |
Michal Ptacek4aff8f42019-05-31 14:12:14 +0000218| | Example: /tmp/resources |
Tomáš Levora418db4d2019-01-30 13:17:50 +0100219+---------------------------------------+------------------------------------------------------------------------------+
Michal Ptacek4aff8f42019-05-31 14:12:14 +0000220| APP_AUX_BINARIES | additional binaries such as docker images loaded during runtime [optional] |
Tomáš Levora418db4d2019-01-30 13:17:50 +0100221+---------------------------------------+------------------------------------------------------------------------------+
222
223Offline installer packages are created with prepopulated data via
eronkeo8457e022019-04-24 15:18:18 +0000224following command run from onap-offline directory
Tomáš Levora418db4d2019-01-30 13:17:50 +0100225
Michal Ptacek1d0c0e72019-04-05 06:39:31 +0000226::
227
228 ./build/package.sh <project> <version> <packaging target directory>
Tomáš Levora418db4d2019-01-30 13:17:50 +0100229
230E.g.
231
Michal Ptacek1d0c0e72019-04-05 06:39:31 +0000232::
233
Michal Ptacek4aff8f42019-05-31 14:12:14 +0000234 ./build/package.sh onap 4.0.0 /tmp/package
Tomáš Levora418db4d2019-01-30 13:17:50 +0100235
236
237So in the target directory you should find tar files with
238
Michal Ptacek1d0c0e72019-04-05 06:39:31 +0000239::
Tomáš Levora418db4d2019-01-30 13:17:50 +0100240
Michal Ptacek4aff8f42019-05-31 14:12:14 +0000241 offline-<PROJECT_NAME>-<PROJECT_VERSION>-sw.tar
242 offline-<PROJECT_NAME>-<PROJECT_VERSION>-resources.tar
243 offline-<PROJECT_NAME>-<PROJECT_VERSION>-aux-resources.tar
244
245
246Appendix 1. Step-by-step download procedure
247-------------------------------------------
248
249**Step 1 - docker images**
250
251::
252
253 # This step will parse all 3 docker datalists (offline infrastructure images, rke k8s images & onap images)
254 # and start building onap offline platform in /tmp/resources folder
255
Milan Verespejd85b2d72019-06-05 13:58:38 +0200256 ./build/download/download.py --docker ./build/data_lists/infra_docker_images.list ../resources/offline_data/docker_images_infra \
257 --docker ./build/data_lists/rke_docker_images.list ../resources/offline_data/docker_images_for_nexus \
258 --docker ./build/data_lists/onap_docker_images.list ../resources/offline_data/docker_images_for_nexus
Michal Ptacek4aff8f42019-05-31 14:12:14 +0000259
260
261**Step 2 - building own dns image**
262
263::
264
265 # We are building our own dns image within our offline infrastructure
266 ./build/creating_data/create_nginx_image/01create-image.sh /tmp/resources/offline_data/docker_images_infra
267
268**Step 3 - git repos**
269
270::
271
272 # Following step will download all git repos
273 ./build/download/download.py --git ./build/data_lists/onap_git_repos.list ../resources/git-repo
274
Michal Ptacek4aff8f42019-05-31 14:12:14 +0000275
Michal Ptacek34cd5082019-06-26 15:29:07 +0000276**Step 4 - npm packages**
Michal Ptacek4aff8f42019-05-31 14:12:14 +0000277
278::
279
280 # Following step will download all npm packages
281 ./build/download/download.py --npm ./build/data_lists/onap_npm.list ../resources/offline_data/npm_tar
282
Michal Ptacek34cd5082019-06-26 15:29:07 +0000283**Step 5 - binaries**
Michal Ptacek4aff8f42019-05-31 14:12:14 +0000284
285::
286
Tomáš Levoraf6bd9372019-06-14 10:54:39 +0200287 # Following step will download rke, kubectl and helm binaries
Milan Verespejd0f76202019-06-10 10:27:20 +0200288 ./build/download/download.py --http ./build/data_lists/infra_bin_utils.sh ../resources/downloads
Michal Ptacek4aff8f42019-05-31 14:12:14 +0000289
Michal Ptacek34cd5082019-06-26 15:29:07 +0000290**Step 6 - rpms**
Michal Ptacek4aff8f42019-05-31 14:12:14 +0000291
292::
293
294 # Following step will download all rpms and create repo
295 ./build/download/download.py --rpm ./build/data_lists/onap_rpm.list ../resources/pkg/rhel
296
297 createrepo ../resources/pkg/rhel
298
Michal Ptacek34cd5082019-06-26 15:29:07 +0000299**Step 7 - pip packages**
Michal Ptacek4aff8f42019-05-31 14:12:14 +0000300
Michal Ptacek4aff8f42019-05-31 14:12:14 +0000301::
302
303 # Following step will download all pip packages
Milan Verespejd85b2d72019-06-05 13:58:38 +0200304 ./build/download/download.py --pypi ./build/data_lists/onap_pip_packages.list ../resources/offline_data/pypi
Michal Ptacek4aff8f42019-05-31 14:12:14 +0000305