Tomáš Levora | 418db4d | 2019-01-30 13:17:50 +0100 | [diff] [blame] | 1 | .. 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 | |
| 5 | OOM ONAP Offline Installer Package Build Guide |
| 6 | ============================================================= |
| 7 | |
| 8 | This 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 Ptacek | 1d0c0e7 | 2019-04-05 06:39:31 +0000 | [diff] [blame] | 10 | Procedure was completely tested on RHEL 7.6 as it’s tested target platform, however with small adaptations it should be applicable also for other platforms. |
| 11 | Some discrepancies when Centos 7.6 is used are described below as well. |
Tomáš Levora | 418db4d | 2019-01-30 13:17:50 +0100 | [diff] [blame] | 12 | |
| 13 | Part 1. Preparations |
| 14 | -------------------- |
| 15 | |
Michal Ptacek | 1d0c0e7 | 2019-04-05 06:39:31 +0000 | [diff] [blame] | 16 | We assume that procedure is executed on RHEL 7.6 server with \~300G disc space, 16G+ RAM and internet connectivity |
Tomáš Levora | 418db4d | 2019-01-30 13:17:50 +0100 | [diff] [blame] | 17 | |
Michal Ptacek | 4aff8f4 | 2019-05-31 14:12:14 +0000 | [diff] [blame] | 18 | Some additional sw packages are required by ONAP Offline platform building tooling. in order to install them |
| 19 | following repos has to be configured for RHEL 7.6 platform. |
Tomáš Levora | 418db4d | 2019-01-30 13:17:50 +0100 | [diff] [blame] | 20 | |
Michal Ptacek | 1d0c0e7 | 2019-04-05 06:39:31 +0000 | [diff] [blame] | 21 | |
Tomáš Levora | 418db4d | 2019-01-30 13:17:50 +0100 | [diff] [blame] | 22 | |
| 23 | :: |
| 24 | |
Michal Ptacek | 1d0c0e7 | 2019-04-05 06:39:31 +0000 | [diff] [blame] | 25 | ############ |
| 26 | # RHEL 7.6 # |
| 27 | ############ |
| 28 | |
Tomáš Levora | 418db4d | 2019-01-30 13:17:50 +0100 | [diff] [blame] | 29 | # Register server |
| 30 | subscription-manager register --username <rhel licence name> --password <password> --auto-attach |
| 31 | |
Michal Ptacek | 4aff8f4 | 2019-05-31 14:12:14 +0000 | [diff] [blame] | 32 | # required by special centos docker recommended by ONAP |
| 33 | yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo |
Tomáš Levora | 418db4d | 2019-01-30 13:17:50 +0100 | [diff] [blame] | 34 | |
Michal Ptacek | 4aff8f4 | 2019-05-31 14:12:14 +0000 | [diff] [blame] | 35 | # 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áš Levora | 418db4d | 2019-01-30 13:17:50 +0100 | [diff] [blame] | 40 | |
Michal Ptacek | 1d0c0e7 | 2019-04-05 06:39:31 +0000 | [diff] [blame] | 41 | Alternatively |
| 42 | |
| 43 | :: |
| 44 | |
Michal Ptacek | 4aff8f4 | 2019-05-31 14:12:14 +0000 | [diff] [blame] | 45 | ToDo: newer download scripts needs to be verified on Centos with ONAP Dublin |
| 46 | |
Michal Ptacek | 1d0c0e7 | 2019-04-05 06:39:31 +0000 | [diff] [blame] | 47 | ############## |
| 48 | # Centos 7.6 # |
| 49 | ############## |
| 50 | |
Michal Ptacek | 4aff8f4 | 2019-05-31 14:12:14 +0000 | [diff] [blame] | 51 | # 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 Ptacek | 1d0c0e7 | 2019-04-05 06:39:31 +0000 | [diff] [blame] | 54 | # enable epel repo for npm and jq |
| 55 | yum install -y epel-release |
| 56 | |
| 57 | Subsequent steps are the same on both platforms: |
| 58 | |
| 59 | :: |
| 60 | |
Tomáš Levora | 418db4d | 2019-01-30 13:17:50 +0100 | [diff] [blame] | 61 | # install following packages |
Michal Ptacek | 4aff8f4 | 2019-05-31 14:12:14 +0000 | [diff] [blame] | 62 | yum install -y docker-ce-18.09.5 python-pip git createrepo expect nodejs npm jq |
Tomáš Levora | 418db4d | 2019-01-30 13:17:50 +0100 | [diff] [blame] | 63 | |
Milan Verespej | 11e84f5 | 2019-06-18 18:34:26 +0200 | [diff] [blame] | 64 | # install Python 3 (download scripts don't support Python 2 anymore) |
Michal Ptacek | 26278df | 2019-07-09 10:46:26 +0000 | [diff] [blame] | 65 | yum install -y python36 python36-pip |
Milan Verespej | 11e84f5 | 2019-06-18 18:34:26 +0200 | [diff] [blame] | 66 | |
Michal Ptacek | 4aff8f4 | 2019-05-31 14:12:14 +0000 | [diff] [blame] | 67 | # twine package is needed by nexus blob build script |
Tomáš Levora | 1d90234 | 2019-02-05 10:01:43 +0100 | [diff] [blame] | 68 | pip install twine |
| 69 | |
Michal Ptacek | 4aff8f4 | 2019-05-31 14:12:14 +0000 | [diff] [blame] | 70 | # docker daemon must be running on host |
| 71 | service docker start |
Tomáš Levora | 418db4d | 2019-01-30 13:17:50 +0100 | [diff] [blame] | 72 | |
| 73 | Then 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 Grzybowski | c241f2f | 2019-03-14 09:38:52 +0100 | [diff] [blame] | 79 | git clone https://gerrit.onap.org/r/oom/offline-installer onap-offline |
Tomáš Levora | 418db4d | 2019-01-30 13:17:50 +0100 | [diff] [blame] | 80 | cd onap-offline |
| 81 | |
Mateusz Pilat | 8fb56a9 | 2019-07-08 12:08:01 +0200 | [diff] [blame] | 82 | # install required pip packages for build and download scripts |
| 83 | pip3 install -r ./build/requirements.txt |
Milan Verespej | 11e84f5 | 2019-06-18 18:34:26 +0200 | [diff] [blame] | 84 | pip3 install -r ./build/download/requirements.txt |
Michal Ptacek | 4aff8f4 | 2019-05-31 14:12:14 +0000 | [diff] [blame] | 85 | |
Tomáš Levora | 418db4d | 2019-01-30 13:17:50 +0100 | [diff] [blame] | 86 | Part 2. Download artifacts for offline installer |
| 87 | ------------------------------------------------ |
| 88 | |
Tomáš Levora | 738f3e2 | 2019-07-09 12:07:51 +0200 | [diff] [blame] | 89 | .. 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 Ptacek | 1d0c0e7 | 2019-04-05 06:39:31 +0000 | [diff] [blame] | 111 | .. note:: Skip this step if you have already all necessary resources and continue with Part 3. Populate local nexus |
Tomáš Levora | 418db4d | 2019-01-30 13:17:50 +0100 | [diff] [blame] | 112 | |
Michal Ptacek | 4aff8f4 | 2019-05-31 14:12:14 +0000 | [diff] [blame] | 113 | It's possible to download all artifacts in single ./download.py execution. Recently we improved reliability of download scripts |
| 114 | so one might try following command to download most of the required artifacts in single shot. |
Tomáš Levora | 418db4d | 2019-01-30 13:17:50 +0100 | [diff] [blame] | 115 | |
Michal Ptacek | 1d0c0e7 | 2019-04-05 06:39:31 +0000 | [diff] [blame] | 116 | :: |
| 117 | |
Michal Ptacek | 4aff8f4 | 2019-05-31 14:12:14 +0000 | [diff] [blame] | 118 | # following arguments are provided |
| 119 | # all data lists are taken in ./build/data_lists/ folder |
| 120 | # all resources will be stored in expected folder structure within ../resources folder |
| 121 | # for more details refer to Appendix 1. |
Michal Ptacek | 1d0c0e7 | 2019-04-05 06:39:31 +0000 | [diff] [blame] | 122 | |
Milan Verespej | d85b2d7 | 2019-06-05 13:58:38 +0200 | [diff] [blame] | 123 | ./build/download/download.py --docker ./build/data_lists/infra_docker_images.list ../resources/offline_data/docker_images_infra \ |
| 124 | --docker ./build/data_lists/rke_docker_images.list ../resources/offline_data/docker_images_for_nexus \ |
| 125 | --docker ./build/data_lists/onap_docker_images.list ../resources/offline_data/docker_images_for_nexus \ |
| 126 | --git ./build/data_lists/onap_git_repos.list ../resources/git-repo \ |
| 127 | --npm ./build/data_lists/onap_npm.list ../resources/offline_data/npm_tar \ |
| 128 | --rpm ./build/data_lists/onap_rpm.list ../resources/pkg/rhel \ |
Milan Verespej | d0f7620 | 2019-06-10 10:27:20 +0200 | [diff] [blame] | 129 | --pypi ./build/data_lists/onap_pip_packages.list ../resources/offline_data/pypi \ |
| 130 | --http ./build/data_lists/infra_bin_utils.list ../resources/downloads |
Tomáš Levora | 418db4d | 2019-01-30 13:17:50 +0100 | [diff] [blame] | 131 | |
Tomáš Levora | 418db4d | 2019-01-30 13:17:50 +0100 | [diff] [blame] | 132 | |
Michal Ptacek | 4aff8f4 | 2019-05-31 14:12:14 +0000 | [diff] [blame] | 133 | Alternatively, step-by-step procedure is described in Appendix 1. |
Tomáš Levora | 418db4d | 2019-01-30 13:17:50 +0100 | [diff] [blame] | 134 | |
Michal Ptacek | 4aff8f4 | 2019-05-31 14:12:14 +0000 | [diff] [blame] | 135 | This concludes SW download part required for ONAP offline platform creating. |
Tomáš Levora | 418db4d | 2019-01-30 13:17:50 +0100 | [diff] [blame] | 136 | |
| 137 | Part 3. Populate local nexus |
| 138 | ---------------------------- |
| 139 | |
| 140 | Prerequisites: |
| 141 | |
| 142 | - All data lists and resources which are pushed to local nexus repository are available |
| 143 | - Following ports are not occupied buy another service: 80, 8081, 8082, 10001 |
| 144 | - There's no docker container called "nexus" |
| 145 | |
eronkeo | 8457e02 | 2019-04-24 15:18:18 +0000 | [diff] [blame] | 146 | .. 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áš Levora | 418db4d | 2019-01-30 13:17:50 +0100 | [diff] [blame] | 147 | |
Michal Ptacek | 4aff8f4 | 2019-05-31 14:12:14 +0000 | [diff] [blame] | 148 | Whole nexus blob data will be created by running script build_nexus_blob.sh. |
Tomáš Levora | 8d272bd | 2019-03-12 15:06:35 +0100 | [diff] [blame] | 149 | It will load the listed docker images, run the Nexus, configure it as npm, pypi |
| 150 | and docker repositories. Then it will push all listed npm and pypi packages and |
| 151 | docker images to the repositories. After all is done the repository container |
| 152 | is stopped. |
Tomáš Levora | 418db4d | 2019-01-30 13:17:50 +0100 | [diff] [blame] | 153 | |
Michal Ptacek | 4aff8f4 | 2019-05-31 14:12:14 +0000 | [diff] [blame] | 154 | .. 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 |
| 155 | |
Tomáš Levora | 8d272bd | 2019-03-12 15:06:35 +0100 | [diff] [blame] | 156 | You can run the script as following example: |
Tomáš Levora | 418db4d | 2019-01-30 13:17:50 +0100 | [diff] [blame] | 157 | |
Michal Ptacek | 4aff8f4 | 2019-05-31 14:12:14 +0000 | [diff] [blame] | 158 | :: |
Tomáš Levora | 418db4d | 2019-01-30 13:17:50 +0100 | [diff] [blame] | 159 | |
Michal Ptacek | 4aff8f4 | 2019-05-31 14:12:14 +0000 | [diff] [blame] | 160 | # merge RKE and ONAP app data lists |
| 161 | cat ./build/data_lists/rke_docker_images.list >> ./build/data_lists/onap_docker_images.list |
| 162 | |
| 163 | ./build/build_nexus_blob.sh |
| 164 | |
| 165 | .. 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áš Levora | 418db4d | 2019-01-30 13:17:50 +0100 | [diff] [blame] | 166 | |
Tomáš Levora | 8d272bd | 2019-03-12 15:06:35 +0100 | [diff] [blame] | 167 | Once the Nexus data blob is created, the docker images and npm and pypi |
| 168 | packages can be deleted to reduce the package size as they won't be needed in |
| 169 | the installation time: |
Tomáš Levora | 418db4d | 2019-01-30 13:17:50 +0100 | [diff] [blame] | 170 | |
| 171 | E.g. |
| 172 | |
| 173 | :: |
| 174 | |
Michal Ptacek | 4aff8f4 | 2019-05-31 14:12:14 +0000 | [diff] [blame] | 175 | rm -f /tmp/resources/offline_data/docker_images_for_nexus/* |
| 176 | rm -rf /tmp/resources/offline_data/npm_tar |
| 177 | rm -rf /tmp/resources/offline_data/pypi |
Tomáš Levora | 418db4d | 2019-01-30 13:17:50 +0100 | [diff] [blame] | 178 | |
Mateusz Pilat | 8fb56a9 | 2019-07-08 12:08:01 +0200 | [diff] [blame] | 179 | Part 4. Packages preparation |
Tomáš Levora | 418db4d | 2019-01-30 13:17:50 +0100 | [diff] [blame] | 180 | -------------------------------------------------------- |
| 181 | |
Mateusz Pilat | 8fb56a9 | 2019-07-08 12:08:01 +0200 | [diff] [blame] | 182 | ONAP offline deliverable consist of 3 packages: |
| 183 | |
| 184 | +---------------------------------------+------------------------------------------------------------------------------+ |
| 185 | | Package | Description | |
| 186 | +=======================================+==============================================================================+ |
| 187 | | sw_package.tar | Contains installation software and configuration for infrastructure and ONAP | |
| 188 | +---------------------------------------+------------------------------------------------------------------------------+ |
| 189 | | resources_package.tar | Contains all input files needed to deploy infrastructure and ONAP | |
| 190 | +---------------------------------------+------------------------------------------------------------------------------+ |
| 191 | | aux_package.tar | Contains auxiliary input files that can be added to ONAP | |
| 192 | +---------------------------------------+------------------------------------------------------------------------------+ |
| 193 | |
| 194 | All 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. |
| 195 | |
| 196 | From onap-offline directory run: |
Tomáš Levora | 418db4d | 2019-01-30 13:17:50 +0100 | [diff] [blame] | 197 | |
Michal Ptacek | 1d0c0e7 | 2019-04-05 06:39:31 +0000 | [diff] [blame] | 198 | :: |
| 199 | |
Mateusz Pilat | 8fb56a9 | 2019-07-08 12:08:01 +0200 | [diff] [blame] | 200 | ./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áš Levora | 418db4d | 2019-01-30 13:17:50 +0100 | [diff] [blame] | 201 | |
| 202 | For example: |
| 203 | |
Michal Ptacek | 1d0c0e7 | 2019-04-05 06:39:31 +0000 | [diff] [blame] | 204 | :: |
| 205 | |
Mateusz Pilat | 8fb56a9 | 2019-07-08 12:08:01 +0200 | [diff] [blame] | 206 | ./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áš Levora | 418db4d | 2019-01-30 13:17:50 +0100 | [diff] [blame] | 207 | |
Tomáš Levora | 418db4d | 2019-01-30 13:17:50 +0100 | [diff] [blame] | 208 | |
Mateusz Pilat | 8fb56a9 | 2019-07-08 12:08:01 +0200 | [diff] [blame] | 209 | In the target directory you should find tar files: |
Tomáš Levora | 418db4d | 2019-01-30 13:17:50 +0100 | [diff] [blame] | 210 | |
Michal Ptacek | 1d0c0e7 | 2019-04-05 06:39:31 +0000 | [diff] [blame] | 211 | :: |
| 212 | |
Mateusz Pilat | 8fb56a9 | 2019-07-08 12:08:01 +0200 | [diff] [blame] | 213 | sw_package.tar |
| 214 | resources_package.tar |
| 215 | aux_package.tar |
Michal Ptacek | 4aff8f4 | 2019-05-31 14:12:14 +0000 | [diff] [blame] | 216 | |
| 217 | |
| 218 | Appendix 1. Step-by-step download procedure |
| 219 | ------------------------------------------- |
| 220 | |
| 221 | **Step 1 - docker images** |
| 222 | |
| 223 | :: |
| 224 | |
| 225 | # This step will parse all 3 docker datalists (offline infrastructure images, rke k8s images & onap images) |
| 226 | # and start building onap offline platform in /tmp/resources folder |
| 227 | |
Milan Verespej | d85b2d7 | 2019-06-05 13:58:38 +0200 | [diff] [blame] | 228 | ./build/download/download.py --docker ./build/data_lists/infra_docker_images.list ../resources/offline_data/docker_images_infra \ |
| 229 | --docker ./build/data_lists/rke_docker_images.list ../resources/offline_data/docker_images_for_nexus \ |
| 230 | --docker ./build/data_lists/onap_docker_images.list ../resources/offline_data/docker_images_for_nexus |
Michal Ptacek | 4aff8f4 | 2019-05-31 14:12:14 +0000 | [diff] [blame] | 231 | |
| 232 | |
Mateusz Pilat | 8fb56a9 | 2019-07-08 12:08:01 +0200 | [diff] [blame] | 233 | **Step 2 - git repos** |
Michal Ptacek | 4aff8f4 | 2019-05-31 14:12:14 +0000 | [diff] [blame] | 234 | |
| 235 | :: |
| 236 | |
| 237 | # Following step will download all git repos |
| 238 | ./build/download/download.py --git ./build/data_lists/onap_git_repos.list ../resources/git-repo |
| 239 | |
Michal Ptacek | 4aff8f4 | 2019-05-31 14:12:14 +0000 | [diff] [blame] | 240 | |
Mateusz Pilat | 8fb56a9 | 2019-07-08 12:08:01 +0200 | [diff] [blame] | 241 | **Step 3 - npm packages** |
Michal Ptacek | 4aff8f4 | 2019-05-31 14:12:14 +0000 | [diff] [blame] | 242 | |
| 243 | :: |
| 244 | |
| 245 | # Following step will download all npm packages |
| 246 | ./build/download/download.py --npm ./build/data_lists/onap_npm.list ../resources/offline_data/npm_tar |
| 247 | |
Mateusz Pilat | 8fb56a9 | 2019-07-08 12:08:01 +0200 | [diff] [blame] | 248 | **Step 4 - binaries** |
Michal Ptacek | 4aff8f4 | 2019-05-31 14:12:14 +0000 | [diff] [blame] | 249 | |
| 250 | :: |
| 251 | |
Tomáš Levora | f6bd937 | 2019-06-14 10:54:39 +0200 | [diff] [blame] | 252 | # Following step will download rke, kubectl and helm binaries |
Milan Verespej | d0f7620 | 2019-06-10 10:27:20 +0200 | [diff] [blame] | 253 | ./build/download/download.py --http ./build/data_lists/infra_bin_utils.sh ../resources/downloads |
Michal Ptacek | 4aff8f4 | 2019-05-31 14:12:14 +0000 | [diff] [blame] | 254 | |
Mateusz Pilat | 8fb56a9 | 2019-07-08 12:08:01 +0200 | [diff] [blame] | 255 | **Step 5 - rpms** |
Michal Ptacek | 4aff8f4 | 2019-05-31 14:12:14 +0000 | [diff] [blame] | 256 | |
| 257 | :: |
| 258 | |
| 259 | # Following step will download all rpms and create repo |
| 260 | ./build/download/download.py --rpm ./build/data_lists/onap_rpm.list ../resources/pkg/rhel |
| 261 | |
| 262 | createrepo ../resources/pkg/rhel |
| 263 | |
Mateusz Pilat | 8fb56a9 | 2019-07-08 12:08:01 +0200 | [diff] [blame] | 264 | **Step 6 - pip packages** |
Michal Ptacek | 4aff8f4 | 2019-05-31 14:12:14 +0000 | [diff] [blame] | 265 | |
Michal Ptacek | 4aff8f4 | 2019-05-31 14:12:14 +0000 | [diff] [blame] | 266 | :: |
| 267 | |
| 268 | # Following step will download all pip packages |
Milan Verespej | d85b2d7 | 2019-06-05 13:58:38 +0200 | [diff] [blame] | 269 | ./build/download/download.py --pypi ./build/data_lists/onap_pip_packages.list ../resources/offline_data/pypi |
Michal Ptacek | 4aff8f4 | 2019-05-31 14:12:14 +0000 | [diff] [blame] | 270 | |