Merge "Make RKE the default cluster deployment tool"
[oom/offline-installer.git] / docs / BuildGuide.rst
index 96c1fbf..8ae08d8 100644 (file)
@@ -7,12 +7,13 @@ OOM ONAP Offline Installer Package Build Guide
 
 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.
 
-Procedure was completely tested on RHEL 7.4 as it’s tested target platform, however with small adaptations it should be applicable also for other platforms.
+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.
+Some discrepancies when Centos 7.6 is used are described below as well.
 
 Part 1. Preparations
 --------------------
 
-We assume that procedure is executed on RHEL 7.4 server with \~300G disc space, 16G+ RAM and internet connectivity
+We assume that procedure is executed on RHEL 7.6 server with \~300G disc space, 16G+ RAM and internet connectivity
 
 More-over following sw packages has to be installed:
 
@@ -28,7 +29,7 @@ More-over following sw packages has to be installed:
 * for the Download artifacts for offline installer (Part 2) and the Populate local nexus (Part 3)
     -  nodejs
     -  jq
-    -  docker (exact version docker-ce-17.03.2)
+    -  docker (exact version docker-ce-18.09.5)
 
 * for the Download artifacts for offline installer (Part 2) and for the Application helm charts preparation and patching (Part 4)
     -  patch
@@ -36,10 +37,15 @@ More-over following sw packages has to be installed:
 * for the Populate local nexus (Part 3)
     -  twine
 
-This can be achieved by following commands:
+Configure repos for downloading all needed rpms for download/packaging tooling:
+
 
 ::
 
+    ############
+    # RHEL 7.6 #
+    ############
+
     # Register server
     subscription-manager register --username <rhel licence name> --password <password> --auto-attach
 
@@ -48,13 +54,28 @@ This can be achieved by following commands:
 
     # enable rhel-7-server-e4s-optional-rpms in /etc/yum.repos.d/redhat.repo
 
+Alternatively
+
+::
+
+   ##############
+   # Centos 7.6 #
+   ##############
+
+   # enable epel repo for npm and jq
+   yum install -y epel-release
+
+Subsequent steps are the same on both platforms:
+
+::
+
     # install following packages
-    yum install -y expect nodejs git wget createrepo python2-pip jq patch
+    yum install -y expect nodejs git wget createrepo python2-pip jq patch dpkg-dev
 
     pip install twine
 
     # install docker
-    curl https://releases.rancher.com/install-docker/17.03.sh | sh
+    curl https://releases.rancher.com/install-docker/18.09.sh | sh
 
 Then it is necessary to clone all installer and build related repositories and prepare the directory structure.
 
@@ -62,13 +83,13 @@ Then it is necessary to clone all installer and build related repositories and p
 
     # prepare the onap build directory structure
     cd /tmp
-    git clone -b casablanca https://gerrit.onap.org/r/oom/offline-installer
+    git clone https://gerrit.onap.org/r/oom/offline-installer onap-offline
     cd onap-offline
 
 Part 2. Download artifacts for offline installer
 ------------------------------------------------
 
-**Note: Skip this step if you have already all necessary resources and continue with Part 3. Populate local nexus**
+.. note:: Skip this step if you have already all necessary resources and continue with Part 3. Populate local nexus
 
 All artifacts should be downloaded by running the download script as follows:
 
@@ -76,7 +97,13 @@ All artifacts should be downloaded by running the download script as follows:
 
 For example:
 
-``$ ./build/download_offline_data_by_lists.sh onap_3.0.0``
+::
+
+  # onap_3.0.0 for casablanca                                (sign-off 30/11/2018)
+  # onap_3.0.1 for casablanca maintenance release            (sign-off 10/12/2018)
+  # onap_3.0.2 for latest casablanca with fixed certificates (sign-off 25/04/2019)
+
+  $ ./build/download_offline_data_by_lists.sh onap_3.0.2
 
 Download is as reliable as network connectivity to internet, it is highly recommended to run it in screen and save log file from this script execution for checking if all artifacts were successfully collected. Each start and end of script call should contain timestamp in console output. Downloading consists of 10 steps, which should be checked at the end one-by-one.
 
@@ -112,8 +139,12 @@ E.g
 
 [Step 2/10 Build own nginx image]
 
-=> there is no hardening in this step, if it failed needs to be
-retriggered. It should end with **Successfully built <id>**
+=> there is no hardening in this step, if it fails it needs to be
+retriggered. It should end with
+
+::
+
+  Successfully built <id>
 
 [Step 3/10 Save docker images from docker cache to tarfiles]
 
@@ -201,82 +232,24 @@ Prerequisites:
 - Following ports are not occupied buy another service: 80, 8081, 8082, 10001
 - There's no docker container called "nexus"
 
-**Note: In case you skipped the Part 2 for the artifacts download,
-please ensure that the copy of resources data are untarred in
-./install/onap-offline/resources/**
-
-Whole nexus blob data tarball will be created by running script
-build\_nexus\_blob.sh. It will load the listed docker images, run the
-Nexus, configure it as npm and docker repository. Then it will push all
-listed npm packages and docker images to the repositories. After all is
-done the repository container is stopped and from the nexus-data
-directory is created tarball.
-
-There are mandatory parameters need to be set in configuration file:
-
-+------------------------------+------------------------------------------------------------------------------------------+
-| Parameter                    | Description                                                                              |
-+==============================+==========================================================================================+
-| NXS\_SRC\_DOCKER\_IMG\_DIR   | resource directory of docker images                                                      |
-+------------------------------+------------------------------------------------------------------------------------------+
-| NXS\_SRC\_NPM\_DIR           | resource directory of npm packages                                                       |
-+------------------------------+------------------------------------------------------------------------------------------+
-| NXS\_SRC\_PYPI\_DIR          | resource directory of npm packages                                                       |
-+------------------------------+------------------------------------------------------------------------------------------+
-| NXS\_DOCKER\_IMG\_LIST       | list of docker images to be pushed to Nexus repository                                   |
-+------------------------------+------------------------------------------------------------------------------------------+
-| NXS\_DOCKER\_WO\_LIST        | list of docker images which uses default repository                                      |
-+------------------------------+------------------------------------------------------------------------------------------+
-| NXS\_NPM\_LIST               | list of npm packages to be published to Nexus repository                                 |
-+------------------------------+------------------------------------------------------------------------------------------+
-| NXS\_PYPI\_LIST              | list of pypi packages to be published to Nexus repository                                |
-+------------------------------+------------------------------------------------------------------------------------------+
-| NEXUS\_DATA\_TAR             | target tarball of Nexus data path/name                                                   |
-+------------------------------+------------------------------------------------------------------------------------------+
-| NEXUS\_DATA\_DIR             | directory used for the Nexus blob build                                                  |
-+------------------------------+------------------------------------------------------------------------------------------+
-| NEXUS\_IMAGE                 | Sonatype/Nexus3 docker image which will be used for data blob creation for this script   |
-+------------------------------+------------------------------------------------------------------------------------------+
-
-Some of the docker images using default registry requires special
-treatment (e.g. they use different ports or SSL connection), therefore
-there is the list NXS\_DOCKER\_WO\_LIST by which are the images retagged
-to be able to push them to our nexus repository.
-
-**Note: It's recomended to use abolute paths in the configuration file
-for the current script**
-
-Example of the configuration file:
-
-::
-
-    NXS_SRC_DOCKER_IMG_DIR="/tmp/onap-offline/resources/offline_data/docker_images_for_nexus"
-    NXS_SRC_NPM_DIR="/tmp/onap-offline/resources/offline_data/npm_tar"
-    NXS_DOCKER_IMG_LIST="/tmp/onap-me-data_lists/docker_img.list"
-    NXS_DOCKER_WO_LIST="/tmp/onap-me-data_lists/docker_no_registry.list"
-    NXS_NPM_LIST="/tmp/onap-offline/bash/tools/data_list/npm_list.txt"
-    NXS_SRC_PYPI_DIR="/tmp/onap-offline/resources/offline_data/pypi"
-    NXS_DOCKER_IMG_LIST="/tmp/onap-me-data_lists/docker_img.list"
-    NXS_DOCKER_WO_LIST="/tmp/onap-me-data_lists/docker_no_registry.list"
-    NXS_NPM_LIST="/tmp/onap-offline/bash/tools/data_list/onap_3.0.0-npm.list"
-    NEXUS_DATA_TAR="/root/nexus_data.tar"
-    NEXUS_DATA_DIR="/tmp/onap-offline/resources/nexus_data"
-    NEXUS_IMAGE="/tmp/onap-offline/resources/offline_data/docker_images_infra/sonatype_nexus3_latest.tar"
+.. 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/*
 
-Once everything is ready you can run the script as following example:
+Whole nexus blob data will be created by running script build\_nexus\_blob.sh.
+It will load the listed docker images, run the Nexus, configure it as npm, pypi
+and docker repositories. Then it will push all listed npm and pypi packages and
+docker images to the repositories. After all is done the repository container
+is stopped.
 
-``$ ./install/onap-offline/build_nexus_blob.sh /root/nexus_build.conf``
+You can run the script as following example:
 
-Where the nexus\_build.conf is the configuration file and the
-/root/nexus\_data.tar is the destination tarball
+``$ ./install/onap-offline/build_nexus_blob.sh onap_3.0.2``
 
-**Note: Move, link or mount the NEXUS\_DATA\_DIR to the resources
-directory if there was different directory specified in configuration or
-use the resulting nexus\_data.tar for movement between machines.**
+Where the onap_3.0.2 is the tag to specify which lists will be used for the
+resources
 
-Once the Nexus data blob is created, the docker images and npm packages
-can be deleted to reduce the package size as they won't be needed in the
-installation time:
+Once the Nexus data blob is created, the docker images and npm and pypi
+packages can be deleted to reduce the package size as they won't be needed in
+the installation time:
 
 E.g.
 
@@ -284,6 +257,7 @@ E.g.
 
     rm -f /tmp/onap-offline/resources/offline_data/docker_images_for_nexus/*
     rm -rf /tmp/onap-offline/resources/offline_data/npm_tar
+    rm -rf /tmp/onap-offline/resources/offline_data/pypi
 
 Part 4. Application helm charts preparation and patching
 --------------------------------------------------------
@@ -291,12 +265,15 @@ Part 4. Application helm charts preparation and patching
 This is about to clone oom repository and patch it to be able to use it
 offline. Use the following command:
 
-./build/fetch\_and\_patch\_charts.sh <helm charts repo>
-<commit/tag/branch> <patchfile> <target\_dir>
+::
+
+  ./build/fetch\_and\_patch\_charts.sh <helm charts repo> <commit/tag/branch> <patchfile> <target\_dir>
 
 For example:
 
-``$ ./build/fetch_and_patch_charts.sh https://gerrit.onap.org/r/oom 3.0.0-ONAP /tmp/offline-installer/patches/casablanca.patch /tmp/oom-clone``
+::
+
+  ./build/fetch_and_patch_charts.sh https://gerrit.onap.org/r/oom 3.0.2-ONAP /tmp/onap-offline/patches/casablanca.patch /tmp/oom-clone
 
 Part 5. Creating offline installation package
 ---------------------------------------------
@@ -321,8 +298,8 @@ Example values below are setup according to steps done in this guide to package
 |                                       | Example::                                                                    |
 |                                       |                                                                              |
 |                                       |  APP_CONFIGURATION=(                                                         |
-|                                       |     /tmp/offline-installer/config/application_configuration.yml              |
-|                                       |     /tmp/offline-installer/patches/onap-casablanca-patch-role                |
+|                                       |     /tmp/onap-offline/config/application_configuration.yml              |
+|                                       |     /tmp/onap-offline/patches/onap-casablanca-patch-role                |
 |                                       |  )                                                                           |
 |                                       |                                                                              |
 +---------------------------------------+------------------------------------------------------------------------------+
@@ -334,19 +311,23 @@ Example values below are setup according to steps done in this guide to package
 +---------------------------------------+------------------------------------------------------------------------------+
 
 Offline installer packages are created with prepopulated data via
-following command run from offline-installer directory
+following command run from onap-offline directory
+
+::
 
-./build/package.sh <project> <version> <packaging target directory>
+  ./build/package.sh <project> <version> <packaging target directory>
 
 E.g.
 
-``$ ./build/package.sh onap 1.0.1 /tmp/package"``
+::
 
+  ./build/package.sh onap 3.0.2 /tmp/package
 
-So in the target directory you should find tar files with
 
-offline-<PROJECT\_NAME>-<PROJECT\_VERSION>-sw.tar
+So in the target directory you should find tar files with
 
-offline-<PROJECT\_NAME>-<PROJECT\_VERSION>-resources.tar
+::
 
-offline-<PROJECT\_NAME>-<PROJECT\_VERSION>-aux-resources.tar
+  offline-<PROJECT\_NAME>-<PROJECT\_VERSION>-sw.tar
+  offline-<PROJECT\_NAME>-<PROJECT\_VERSION>-resources.tar
+  offline-<PROJECT\_NAME>-<PROJECT\_VERSION>-aux-resources.tar