blob: 12426b7c2a7f51f0a7005828dfa43b79f568bfeb [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
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 ############
29 # RHEL 7.6 #
30 ############
31
Tomáš Levora418db4d2019-01-30 13:17:50 +010032 # Register server
33 subscription-manager register --username <rhel licence name> --password <password> --auto-attach
34
Michal Ptacek4aff8f42019-05-31 14:12:14 +000035 # required by special centos docker recommended by ONAP
36 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 ##############
49 # Centos 7.6 #
50 ##############
51
Michal Ptacek4aff8f42019-05-31 14:12:14 +000052 # required by special centos docker recommended by ONAP
53 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
Michal Ptacek4aff8f42019-05-31 14:12:14 +000063 yum install -y docker-ce-18.09.5 python-pip git createrepo expect nodejs npm jq
Tomáš Levora418db4d2019-01-30 13:17:50 +010064
Milan Verespej11e84f52019-06-18 18:34:26 +020065 # install Python 3 (download scripts don't support Python 2 anymore)
Michal Ptacek26278df2019-07-09 10:46:26 +000066 yum install -y python36 python36-pip
Milan Verespej11e84f52019-06-18 18:34:26 +020067
Michal Ptacek4aff8f42019-05-31 14:12:14 +000068 # docker daemon must be running on host
69 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
Tomáš Levora738f3e22019-07-09 12:07:51 +020087.. note::
88 It is possible to generate actual list of docker images using docker-images-collector.sh (helm is required) from cloned OOM directory
89 based on enabled subsystems.
90
91 In the beginning of the generated list is written commit number from which it was created - the same commit number should be used
92 in Part 4. Packages preparation.
93
94 Following example will create the list to the default path:
95 ::
96
97 # clone the OOM repository
Denis Kasanic01fd0952019-11-05 09:50:00 +010098 git clone https://gerrit.onap.org/r/oom -b master --recurse-submodules /tmp/oom
Tomáš Levora738f3e22019-07-09 12:07:51 +020099
Samuli Silvius62b73a62019-11-25 08:45:12 +0200100 # docker-images-collector.sh script uses oom/kubernetes/onap/resources/overrides/onap-all.yaml file to find what subsystems
101 are enabled. By default all subsystems are enabled there. Modify the file if want to drop some subsystems.
Tomáš Levora738f3e22019-07-09 12:07:51 +0200102
103 #run the collector providing path the the project
104 ./build/creating_data/docker-images-collector.sh /tmp/oom/kubernetes/onap
105
Tomáš Levora738f3e22019-07-09 12:07:51 +0200106 For the other options check the usage of the script.
107
Michal Ptacek1d0c0e72019-04-05 06:39:31 +0000108.. 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 +0100109
Jan Benedikt8fdbfe72019-10-15 06:07:46 -0400110
111There need to be created RPM repository containing packages which need to be installed on all nodes.
Jan Benedikt7c0f6b12019-10-08 10:01:41 -0400112
113::
Jan Benedikt8fdbfe72019-10-15 06:07:46 -0400114
115 # run the docker container with -d parameter for destination directory with RPM packages
Jan Benedikt7c0f6b12019-10-08 10:01:41 -0400116 ./offline-installer/build/create_repo.sh -d $(pwd)
117
Jan Benedikt8fdbfe72019-10-15 06:07:46 -0400118.. note:: If script fails with permissions, problem could be with SeLinux. Issue is possible to solve by:
Jan Benedikt7c0f6b12019-10-08 10:01:41 -0400119 ::
Jan Benedikt8fdbfe72019-10-15 06:07:46 -0400120
Jan Benedikt7c0f6b12019-10-08 10:01:41 -0400121 # Change security context of directory
122 chcon -Rt svirt_sandbox_file_t $(pwd)
123
124It'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 +0000125so one might try following command to download most of the required artifacts in single shot.
Tomáš Levora418db4d2019-01-30 13:17:50 +0100126
Michal Ptacek1d0c0e72019-04-05 06:39:31 +0000127::
128
Michal Ptacek4aff8f42019-05-31 14:12:14 +0000129 # following arguments are provided
Denis Kasanica7702f22019-11-14 12:35:46 +0100130 # all data lists are taken from ./build/data_lists/ folder
Michal Ptacek4aff8f42019-05-31 14:12:14 +0000131 # all resources will be stored in expected folder structure within ../resources folder
Michal Ptacek1d0c0e72019-04-05 06:39:31 +0000132
Milan Verespejd85b2d72019-06-05 13:58:38 +0200133 ./build/download/download.py --docker ./build/data_lists/infra_docker_images.list ../resources/offline_data/docker_images_infra \
Denis Kasanica7702f22019-11-14 12:35:46 +0100134 --http ./build/data_lists/infra_bin_utils.list ../resources/downloads
135
136 # following docker images do not necessarily need to be stored under resources as they load into repository in next part
137 # if second argument for --docker is not present, images are just pulled and cached.
138 # Warning: script must be run twice separately, for more details run download.py --help
139 ./build/download/download.py --docker ./build/data_lists/rke_docker_images.list \
Denis Kasanic01fd0952019-11-05 09:50:00 +0100140 --docker ./build/data_lists/k8s_docker_images.list \
141 --docker ./build/data_lists/onap_docker_images.list \
Tomáš Levora418db4d2019-01-30 13:17:50 +0100142
Tomáš Levora418db4d2019-01-30 13:17:50 +0100143
Michal Ptacek4aff8f42019-05-31 14:12:14 +0000144Alternatively, step-by-step procedure is described in Appendix 1.
Tomáš Levora418db4d2019-01-30 13:17:50 +0100145
Michal Ptacek4aff8f42019-05-31 14:12:14 +0000146This concludes SW download part required for ONAP offline platform creating.
Tomáš Levora418db4d2019-01-30 13:17:50 +0100147
148Part 3. Populate local nexus
149----------------------------
150
151Prerequisites:
152
153- All data lists and resources which are pushed to local nexus repository are available
Denis Kasanica7702f22019-11-14 12:35:46 +0100154- Following ports are not occupied by another service: 80, 8081, 8082, 10001
Tomáš Levora418db4d2019-01-30 13:17:50 +0100155- There's no docker container called "nexus"
156
Denis Kasanic01fd0952019-11-05 09:50:00 +0100157.. 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 +0100158
Denis Kasanic01fd0952019-11-05 09:50:00 +0100159::
160
161 #Whole nexus blob data will be created by running script build_nexus_blob.sh.
162 ./onap-offline/build/build_nexus_blob.sh
163
Tomáš Levora8d272bd2019-03-12 15:06:35 +0100164It will load the listed docker images, run the Nexus, configure it as npm, pypi
Tomáš Levora2a355bb2019-10-10 14:04:08 +0200165and 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 +0100166
Tomáš Levora2a355bb2019-10-10 14:04:08 +0200167.. note:: In the 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.
Michal Ptacek4aff8f42019-05-31 14:12:14 +0000168
Tomáš Levora418db4d2019-01-30 13:17:50 +0100169
Mateusz Pilat8fb56a92019-07-08 12:08:01 +0200170Part 4. Packages preparation
Tomáš Levora418db4d2019-01-30 13:17:50 +0100171--------------------------------------------------------
172
Mateusz Pilat8fb56a92019-07-08 12:08:01 +0200173ONAP offline deliverable consist of 3 packages:
174
175+---------------------------------------+------------------------------------------------------------------------------+
176| Package | Description |
177+=======================================+==============================================================================+
178| sw_package.tar | Contains installation software and configuration for infrastructure and ONAP |
179+---------------------------------------+------------------------------------------------------------------------------+
180| resources_package.tar | Contains all input files needed to deploy infrastructure and ONAP |
181+---------------------------------------+------------------------------------------------------------------------------+
182| aux_package.tar | Contains auxiliary input files that can be added to ONAP |
183+---------------------------------------+------------------------------------------------------------------------------+
184
Tomáš Levora2a355bb2019-10-10 14:04:08 +0200185All packages can be created using script build/package.py. Beside of archiving files gathered in the previous steps, script also builds docker images used in on infra server.
Mateusz Pilat8fb56a92019-07-08 12:08:01 +0200186
187From onap-offline directory run:
Tomáš Levora418db4d2019-01-30 13:17:50 +0100188
Michal Ptacek1d0c0e72019-04-05 06:39:31 +0000189::
190
Denis Kasanica7702f22019-11-14 12:35:46 +0100191 ./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 +0100192
193For example:
194
Michal Ptacek1d0c0e72019-04-05 06:39:31 +0000195::
196
Denis Kasanica7702f22019-11-14 12:35:46 +0100197 ./build/package.py https://gerrit.onap.org/r/oom --application-repository_reference master --output-dir /tmp/packages --resources-directory /tmp/resources
Tomáš Levora418db4d2019-01-30 13:17:50 +0100198
Tomáš Levora418db4d2019-01-30 13:17:50 +0100199
Mateusz Pilat8fb56a92019-07-08 12:08:01 +0200200In the target directory you should find tar files:
Tomáš Levora418db4d2019-01-30 13:17:50 +0100201
Michal Ptacek1d0c0e72019-04-05 06:39:31 +0000202::
203
Mateusz Pilat8fb56a92019-07-08 12:08:01 +0200204 sw_package.tar
205 resources_package.tar
206 aux_package.tar
Michal Ptacek4aff8f42019-05-31 14:12:14 +0000207