Bump the nfs-utils package version
[oom/offline-installer.git] / docs / BuildGuide.rst
index 8ada5e3..e2215c1 100644 (file)
@@ -10,6 +10,7 @@ This document is describing procedure for building offline installer packages. I
 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
 --------------------
 
@@ -20,6 +21,9 @@ following repos has to be configured for RHEL 7.6 platform.
 
 
 
+.. note::
+   All commands stated in this guide are meant to be run in root shell.
+
 ::
 
     ############
@@ -42,8 +46,6 @@ Alternatively
 
 ::
 
-   ToDo: newer download scripts needs to be verified on Centos with ONAP Dublin
-
    ##############
    # Centos 7.6 #
    ##############
@@ -59,14 +61,11 @@ Subsequent steps are the same on both platforms:
 ::
 
     # install following packages
-    yum install -y docker-ce-18.09.5 python-pip git createrepo expect nodejs npm jq
+    yum install -y docker-ce-18.09.5 git createrepo expect nodejs npm jq
 
-    # install Python 3 (download scripts don't support Python 2 anymore)
+    # install Python 3
     yum install -y python36 python36-pip
 
-    # twine package is needed by nexus blob build script
-    pip install twine
-
     # docker daemon must be running on host
     service docker start
 
@@ -86,29 +85,64 @@ Then it is necessary to clone all installer and build related repositories and p
 Part 2. Download artifacts for offline installer
 ------------------------------------------------
 
+.. note::
+   It is possible to generate actual list of docker images using docker-images-collector.sh (helm is required) from cloned OOM directory
+   based on enabled subsystems.
+
+   In the beginning of the generated list is written commit number from which it was created - the same commit number should be used
+   in Part 4. Packages preparation.
+
+   Following example will create the list to the default path:
+   ::
+
+    # clone the OOM repository
+    git clone https://gerrit.onap.org/r/oom -b <branch> --recurse-submodules /tmp/oom
+
+.. note::  replace <branch> by branch you want to build
+
+    # docker-images-collector.sh script uses oom/kubernetes/onap/resources/overrides/onap-all.yaml file to find what subsystems
+    are enabled. By default all subsystems are enabled there. Modify the file if want to drop some subsystems.
+
+    #run the collector providing path the the project
+    ./build/creating_data/docker-images-collector.sh /tmp/oom/kubernetes/onap
+
+   For the other options check the usage of the script.
+
 .. note:: Skip this step if you have already all necessary resources and continue with Part 3. Populate local nexus
 
-It's possible to download all artifacts in single ./download.py execution. Recently we improved reliability of download scripts
+
+Repository containing packages to be installed on all nodes needs to be created:
+
+::
+
+    # run the docker container with -d parameter for destination directory with RPM packages and optionally use -t parameter for target platform. Supported target platforms are centos|rhel|ubuntu. If -t parameter is not given, default platform is based on host platform where script is running.
+    ./offline-installer/build/create_repo.sh -d $(pwd) -t centos|rhel|ubuntu
+
+.. note:: If script fails due to permissions issue, it could be a problem with SeLinux. It can be fixed by running:
+    ::
+
+      # Change security context of directory
+      chcon -Rt svirt_sandbox_file_t $(pwd)
+
+It's possible to download rest artifacts in single ./download.py execution. Recently we improved reliability of download scripts
 so one might try following command to download most of the required artifacts in single shot.
 
 ::
 
         # following arguments are provided
-        # all data lists are taken in ./build/data_lists/ folder
+        # all data lists are taken from ./build/data_lists/ folder
         # all resources will be stored in expected folder structure within ../resources folder
-        # for more details refer to Appendix 1.
 
         ./build/download/download.py --docker ./build/data_lists/infra_docker_images.list ../resources/offline_data/docker_images_infra \
-        --docker ./build/data_lists/rke_docker_images.list ../resources/offline_data/docker_images_for_nexus \
-        --docker ./build/data_lists/onap_docker_images.list ../resources/offline_data/docker_images_for_nexus \
-        --git ./build/data_lists/onap_git_repos.list ../resources/git-repo \
-        --npm ./build/data_lists/onap_npm.list ../resources/offline_data/npm_tar \
-        --rpm ./build/data_lists/onap_rpm.list ../resources/pkg/rhel \
-        --pypi ./build/data_lists/onap_pip_packages.list ../resources/offline_data/pypi \
         --http ./build/data_lists/infra_bin_utils.list ../resources/downloads
 
+        # following docker images do not necessarily need to be stored under resources as they load into repository in next part
+        # if second argument for --docker is not present, images are just pulled and cached.
+        # Warning: script must be run twice separately, for more details run download.py --help
+        ./build/download/download.py --docker ./build/data_lists/rke_docker_images.list \
+        --docker ./build/data_lists/k8s_docker_images.list \
+        --docker ./build/data_lists/onap_docker_images.list \
 
-Alternatively, step-by-step procedure is described in Appendix 1.
 
 This concludes SW download part required for ONAP offline platform creating.
 
@@ -118,41 +152,21 @@ Part 3. Populate local nexus
 Prerequisites:
 
 - All data lists and resources which are pushed to local nexus repository are available
-- Following ports are not occupied buy another service: 80, 8081, 8082, 10001
+- Following ports are not occupied by 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 *./onap-offline/../resources/*
-
-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.
-
-.. 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
-
-You can run the script as following example:
+.. 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/*
 
 ::
 
-        # merge RKE and ONAP app data lists
-        cat ./build/data_lists/rke_docker_images.list >> ./build/data_lists/onap_docker_images.list
+        #Whole nexus blob data will be created by running script build_nexus_blob.sh.
+        ./onap-offline/build/build_nexus_blob.sh
 
-        ./build/build_nexus_blob.sh
-
-.. 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.
-
-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:
+It will load the listed docker images, run the Nexus, configure it as npm, pypi
+and docker repositories. Then it will push all listed docker images to the repositories. After all is done the repository container is stopped.
 
-E.g.
+.. 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.
 
-::
-
-    rm -f /tmp/resources/offline_data/docker_images_for_nexus/*
-    rm -rf /tmp/resources/offline_data/npm_tar
-    rm -rf /tmp/resources/offline_data/pypi
 
 Part 4. Packages preparation
 --------------------------------------------------------
@@ -169,20 +183,21 @@ ONAP offline deliverable consist of 3 packages:
 | aux_package.tar                       | Contains auxiliary input files that can be added to ONAP                     |
 +---------------------------------------+------------------------------------------------------------------------------+
 
-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.
+All 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.
 
 From onap-offline directory run:
 
 ::
 
-  ./build/package.py <helm charts repo> --application-repository_reference <commit/tag/branch> --application-patch_file <patchfile> --output-dir <target\_dir> --resources-directory <target\_dir>
+  ./build/package.py <helm charts repo> --build-version <version> --application-repository_reference <commit/tag/branch> --output-dir <target\_dir> --resources-directory <target\_dir>
 
 For example:
 
 ::
 
-  ./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
+  ./build/package.py https://gerrit.onap.org/r/oom --application-repository_reference <branch> --output-dir /tmp/packages --resources-directory /tmp/resources
 
+.. note::  replace <branch> by branch you want to build
 
 In the target directory you should find tar files:
 
@@ -192,57 +207,3 @@ In the target directory you should find tar files:
   resources_package.tar
   aux_package.tar
 
-
-Appendix 1. Step-by-step download procedure
--------------------------------------------
-
-**Step 1 - docker images**
-
-::
-
-        # This step will parse all 3 docker datalists (offline infrastructure images, rke k8s images & onap images)
-        # and start building onap offline platform in /tmp/resources folder
-
-        ./build/download/download.py --docker ./build/data_lists/infra_docker_images.list ../resources/offline_data/docker_images_infra \
-        --docker ./build/data_lists/rke_docker_images.list ../resources/offline_data/docker_images_for_nexus \
-        --docker ./build/data_lists/onap_docker_images.list ../resources/offline_data/docker_images_for_nexus
-
-
-**Step 2 - git repos**
-
-::
-
-        # Following step will download all git repos
-        ./build/download/download.py --git ./build/data_lists/onap_git_repos.list ../resources/git-repo
-
-
-**Step 3 - npm packages**
-
-::
-
-        # Following step will download all npm packages
-        ./build/download/download.py --npm ./build/data_lists/onap_npm.list ../resources/offline_data/npm_tar
-
-**Step 4 - binaries**
-
-::
-
-       # Following step will download rke, kubectl and helm binaries
-       ./build/download/download.py --http ./build/data_lists/infra_bin_utils.sh ../resources/downloads
-
-**Step 5 - rpms**
-
-::
-
-      # Following step will download all rpms and create repo
-      ./build/download/download.py --rpm ./build/data_lists/onap_rpm.list ../resources/pkg/rhel
-
-      createrepo ../resources/pkg/rhel
-
-**Step 6 - pip packages**
-
-::
-
-      # Following step will download all pip packages
-      ./build/download/download.py --pypi ./build/data_lists/onap_pip_packages.list ../resources/offline_data/pypi
-