blob: 6317760cbadf186525ef44d7774851c528113e41 [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
Ondřej Šmaleccb26bd82020-01-23 11:40:54 +010013
Tomáš Levora418db4d2019-01-30 13:17:50 +010014Part 1. Preparations
15--------------------
16
Michal Ptacek1d0c0e72019-04-05 06:39:31 +000017We 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 +010018
Michal Ptacek4aff8f42019-05-31 14:12:14 +000019Some additional sw packages are required by ONAP Offline platform building tooling. in order to install them
20following repos has to be configured for RHEL 7.6 platform.
Tomáš Levora418db4d2019-01-30 13:17:50 +010021
Michal Ptacek1d0c0e72019-04-05 06:39:31 +000022
Tomáš Levora418db4d2019-01-30 13:17:50 +010023
Denis Kasanic01fd0952019-11-05 09:50:00 +010024.. note::
25 All commands stated in this guide are meant to be run in root shell.
26
Tomáš Levora418db4d2019-01-30 13:17:50 +010027::
28
Michal Ptacek1d0c0e72019-04-05 06:39:31 +000029 ############
30 # RHEL 7.6 #
31 ############
32
Tomáš Levora418db4d2019-01-30 13:17:50 +010033 # Register server
34 subscription-manager register --username <rhel licence name> --password <password> --auto-attach
35
Michal Ptacek4aff8f42019-05-31 14:12:14 +000036 # required by special centos docker recommended by ONAP
37 yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
Tomáš Levora418db4d2019-01-30 13:17:50 +010038
Michal Ptacek4aff8f42019-05-31 14:12:14 +000039 # required by docker dependencies i.e. docker-selinux
40 subscription-manager repos --enable=rhel-7-server-extras-rpms
41
42 # epel is required by npm within blob build
43 rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
Tomáš Levora418db4d2019-01-30 13:17:50 +010044
Michal Ptacek1d0c0e72019-04-05 06:39:31 +000045Alternatively
46
47::
48
49 ##############
50 # Centos 7.6 #
51 ##############
52
Michal Ptacek4aff8f42019-05-31 14:12:14 +000053 # required by special centos docker recommended by ONAP
54 yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
55
Michal Ptacek1d0c0e72019-04-05 06:39:31 +000056 # enable epel repo for npm and jq
57 yum install -y epel-release
58
59Subsequent steps are the same on both platforms:
60
61::
62
Tomáš Levora418db4d2019-01-30 13:17:50 +010063 # install following packages
Tomáš Levorad6d93a22020-03-31 10:15:32 +020064 yum install -y docker-ce-18.09.5 git createrepo expect nodejs npm jq
Tomáš Levora418db4d2019-01-30 13:17:50 +010065
Tomáš Levorad6d93a22020-03-31 10:15:32 +020066 # install Python 3
Michal Ptacek26278df2019-07-09 10:46:26 +000067 yum install -y python36 python36-pip
Milan Verespej11e84f52019-06-18 18:34:26 +020068
Michal Ptacek4aff8f42019-05-31 14:12:14 +000069 # docker daemon must be running on host
70 service docker start
Tomáš Levora418db4d2019-01-30 13:17:50 +010071
72Then it is necessary to clone all installer and build related repositories and prepare the directory structure.
73
74::
75
76 # prepare the onap build directory structure
77 cd /tmp
Bartek Grzybowskic241f2f2019-03-14 09:38:52 +010078 git clone https://gerrit.onap.org/r/oom/offline-installer onap-offline
Tomáš Levora418db4d2019-01-30 13:17:50 +010079 cd onap-offline
80
Mateusz Pilat8fb56a92019-07-08 12:08:01 +020081 # install required pip packages for build and download scripts
82 pip3 install -r ./build/requirements.txt
Milan Verespej11e84f52019-06-18 18:34:26 +020083 pip3 install -r ./build/download/requirements.txt
Michal Ptacek4aff8f42019-05-31 14:12:14 +000084
Tomáš Levora418db4d2019-01-30 13:17:50 +010085Part 2. Download artifacts for offline installer
86------------------------------------------------
87
Tomáš Levora738f3e22019-07-09 12:07:51 +020088.. note::
89 It is possible to generate actual list of docker images using docker-images-collector.sh (helm is required) from cloned OOM directory
90 based on enabled subsystems.
91
92 In the beginning of the generated list is written commit number from which it was created - the same commit number should be used
93 in Part 4. Packages preparation.
94
95 Following example will create the list to the default path:
96 ::
97
98 # clone the OOM repository
Ondřej Šmaleccb26bd82020-01-23 11:40:54 +010099 git clone https://gerrit.onap.org/r/oom -b <branch> --recurse-submodules /tmp/oom
100
101.. note:: replace <branch> by branch you want to build
Tomáš Levora738f3e22019-07-09 12:07:51 +0200102
Samuli Silvius62b73a62019-11-25 08:45:12 +0200103 # docker-images-collector.sh script uses oom/kubernetes/onap/resources/overrides/onap-all.yaml file to find what subsystems
104 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 +0200105
106 #run the collector providing path the the project
107 ./build/creating_data/docker-images-collector.sh /tmp/oom/kubernetes/onap
108
Tomáš Levora738f3e22019-07-09 12:07:51 +0200109 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
Bartek Grzybowskib75d08f2020-01-20 10:01:22 +0100114A RPM repository containing packages to be installed on all nodes needs to be created:
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
Bartek Grzybowskib75d08f2020-01-20 10:01:22 +0100121.. 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 -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
Denis Kasanica7702f22019-11-14 12:35:46 +0100133 # all data lists are taken from ./build/data_lists/ folder
Michal Ptacek4aff8f42019-05-31 14:12:14 +0000134 # all resources will be stored in expected folder structure within ../resources folder
Michal Ptacek1d0c0e72019-04-05 06:39:31 +0000135
Milan Verespejd85b2d72019-06-05 13:58:38 +0200136 ./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 +0100137 --http ./build/data_lists/infra_bin_utils.list ../resources/downloads
138
139 # following docker images do not necessarily need to be stored under resources as they load into repository in next part
140 # if second argument for --docker is not present, images are just pulled and cached.
141 # Warning: script must be run twice separately, for more details run download.py --help
142 ./build/download/download.py --docker ./build/data_lists/rke_docker_images.list \
Denis Kasanic01fd0952019-11-05 09:50:00 +0100143 --docker ./build/data_lists/k8s_docker_images.list \
144 --docker ./build/data_lists/onap_docker_images.list \
Tomáš Levora418db4d2019-01-30 13:17:50 +0100145
Tomáš Levora418db4d2019-01-30 13:17:50 +0100146
Michal Ptacek4aff8f42019-05-31 14:12:14 +0000147This concludes SW download part required for ONAP offline platform creating.
Tomáš Levora418db4d2019-01-30 13:17:50 +0100148
149Part 3. Populate local nexus
150----------------------------
151
152Prerequisites:
153
154- All data lists and resources which are pushed to local nexus repository are available
Denis Kasanica7702f22019-11-14 12:35:46 +0100155- Following ports are not occupied by another service: 80, 8081, 8082, 10001
Tomáš Levora418db4d2019-01-30 13:17:50 +0100156- There's no docker container called "nexus"
157
Denis Kasanic01fd0952019-11-05 09:50:00 +0100158.. 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 +0100159
Denis Kasanic01fd0952019-11-05 09:50:00 +0100160::
161
162 #Whole nexus blob data will be created by running script build_nexus_blob.sh.
163 ./onap-offline/build/build_nexus_blob.sh
164
Tomáš Levora8d272bd2019-03-12 15:06:35 +0100165It will load the listed docker images, run the Nexus, configure it as npm, pypi
Tomáš Levora2a355bb2019-10-10 14:04:08 +0200166and 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 +0100167
Tomáš Levora2a355bb2019-10-10 14:04:08 +0200168.. 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 +0000169
Tomáš Levora418db4d2019-01-30 13:17:50 +0100170
Mateusz Pilat8fb56a92019-07-08 12:08:01 +0200171Part 4. Packages preparation
Tomáš Levora418db4d2019-01-30 13:17:50 +0100172--------------------------------------------------------
173
Mateusz Pilat8fb56a92019-07-08 12:08:01 +0200174ONAP offline deliverable consist of 3 packages:
175
176+---------------------------------------+------------------------------------------------------------------------------+
177| Package | Description |
178+=======================================+==============================================================================+
179| sw_package.tar | Contains installation software and configuration for infrastructure and ONAP |
180+---------------------------------------+------------------------------------------------------------------------------+
181| resources_package.tar | Contains all input files needed to deploy infrastructure and ONAP |
182+---------------------------------------+------------------------------------------------------------------------------+
183| aux_package.tar | Contains auxiliary input files that can be added to ONAP |
184+---------------------------------------+------------------------------------------------------------------------------+
185
Tomáš Levora2a355bb2019-10-10 14:04:08 +0200186All 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 +0200187
188From onap-offline directory run:
Tomáš Levora418db4d2019-01-30 13:17:50 +0100189
Michal Ptacek1d0c0e72019-04-05 06:39:31 +0000190::
191
Denis Kasanica7702f22019-11-14 12:35:46 +0100192 ./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 +0100193
194For example:
195
Michal Ptacek1d0c0e72019-04-05 06:39:31 +0000196::
197
Ondřej Šmaleccb26bd82020-01-23 11:40:54 +0100198 ./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 +0100199
Ondřej Šmaleccb26bd82020-01-23 11:40:54 +0100200.. note:: replace <branch> by branch you want to build
Tomáš Levora418db4d2019-01-30 13:17:50 +0100201
Mateusz Pilat8fb56a92019-07-08 12:08:01 +0200202In the target directory you should find tar files:
Tomáš Levora418db4d2019-01-30 13:17:50 +0100203
Michal Ptacek1d0c0e72019-04-05 06:39:31 +0000204::
205
Mateusz Pilat8fb56a92019-07-08 12:08:01 +0200206 sw_package.tar
207 resources_package.tar
208 aux_package.tar
Michal Ptacek4aff8f42019-05-31 14:12:14 +0000209