Changing doc section related to packaging
[oom/offline-installer.git] / docs / BuildGuide.rst
index cfddcc9..464422a 100644 (file)
@@ -61,6 +61,9 @@ 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
 
     # install following packages
     yum install -y docker-ce-18.09.5 python-pip git createrepo expect nodejs npm jq
 
+    # install Python 3 (download scripts don't support Python 2 anymore)
+    yum install -y python36
+
     # twine package is needed by nexus blob build script
     pip install twine
 
     # twine package is needed by nexus blob build script
     pip install twine
 
@@ -76,8 +79,9 @@ Then it is necessary to clone all installer and build related repositories and p
     git clone https://gerrit.onap.org/r/oom/offline-installer onap-offline
     cd onap-offline
 
     git clone https://gerrit.onap.org/r/oom/offline-installer onap-offline
     cd onap-offline
 
-    # install required pip packages for download scripts
-    pip install -r ./build/download/requirements.txt
+    # install required pip packages for build and download scripts
+    pip3 install -r ./build/requirements.txt
+    pip3 install -r ./build/download/requirements.txt
 
 Part 2. Download artifacts for offline installer
 ------------------------------------------------
 
 Part 2. Download artifacts for offline installer
 ------------------------------------------------
@@ -87,8 +91,6 @@ Part 2. Download artifacts for offline installer
 It's possible to download all 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.
 
 It's possible to download all 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.
 
-**Step1 - download wrapper script execution**
-
 ::
 
         # following arguments are provided
 ::
 
         # following arguments are provided
@@ -108,40 +110,6 @@ so one might try following command to download most of the required artifacts in
 
 Alternatively, step-by-step procedure is described in Appendix 1.
 
 
 Alternatively, step-by-step procedure is described in Appendix 1.
 
-Following steps are still required and are not supported by current version of download.py script.
-
-**Step 2 - Building own dns image**
-
-::
-
-        # We are building our own dns image within our offline infrastructure
-        ./build/creating_data/create_nginx_image/01create-image.sh /tmp/resources/offline_data/docker_images_infra
-
-
-**Step 3 - Http files**
-
-ToDo: complete and verified list of http files will come just during/after vFWCL testcase
-
-
-**Step 4 - Binaries**
-
-::
-
-       # Binaries are downloaded in step one but some post processing is still needed.
-       # This will be improved in future in installer itself
-
-       tar -xf ../resources/downloads/helm-v2.12.3-linux-amd64.tar.gz linux-amd64/helm -O > ../resources/downloads/helm
-       rm -f ../resources/downloads/helm-v2.12.3-linux-amd64.tar.gz
-       mv ../resources/downloads/rke_linux-amd64 rke
-
-
-**Step 5 - Create repo**
-
-::
-
-      createrepo ../resources/pkg/rhel
-
-
 This concludes SW download part required for ONAP offline platform creating.
 
 Part 3. Populate local nexus
 This concludes SW download part required for ONAP offline platform creating.
 
 Part 3. Populate local nexus
@@ -186,78 +154,43 @@ E.g.
     rm -rf /tmp/resources/offline_data/npm_tar
     rm -rf /tmp/resources/offline_data/pypi
 
     rm -rf /tmp/resources/offline_data/npm_tar
     rm -rf /tmp/resources/offline_data/pypi
 
-Part 4. Application helm charts preparation and patching
+Part 4. Packages preparation
 --------------------------------------------------------
 
 --------------------------------------------------------
 
-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>
-
-For example:
-
-::
-
-  ./build/fetch_and_patch_charts.sh https://gerrit.onap.org/r/oom 0b904977dde761d189874d6dc6c527cd45928 /tmp/onap-offline/patches/onap.patch /tmp/oom-clone
-
-Part 5. Creating offline installation package
----------------------------------------------
-
-For the packagin itself it's necessary to prepare configuration. You can
-use ./build/package.conf as template or
-directly modify it.
-
-There are some parameters needs to be set in configuration file.
-Example values below are setup according to steps done in this guide to package ONAP.
+ONAP offline deliverable consist of 3 packages:
 
 +---------------------------------------+------------------------------------------------------------------------------+
 
 +---------------------------------------+------------------------------------------------------------------------------+
-| Parameter                             | Description                                                                  |
+| Package                               | Description                                                                  |
 +=======================================+==============================================================================+
 +=======================================+==============================================================================+
-| HELM_CHARTS_DIR                       | directory with Helm charts for the application                               |
-|                                       |                                                                              |
-|                                       | Example: /tmp/oom-clone/kubernetes                                           |
-+---------------------------------------+------------------------------------------------------------------------------+
-| APP_CONFIGURATION                     | application install configuration (application_configuration.yml) for        |
-|                                       | ansible installer and custom ansible role code directories if any.           |
-|                                       |                                                                              |
-|                                       | Example::                                                                    |
-|                                       |                                                                              |
-|                                       |  APP_CONFIGURATION=(                                                         |
-|                                       |     /tmp/onap-offline/config/application_configuration.yml                   |
-|                                       |     /tmp/onap-offline/patches/onap-patch-role                                |
-|                                       |  )                                                                           |
-|                                       |                                                                              |
+| sw_package.tar                        | Contains installation software and configuration for infrastructure and ONAP |
 +---------------------------------------+------------------------------------------------------------------------------+
 +---------------------------------------+------------------------------------------------------------------------------+
-| APP_BINARY_RESOURCES_DIR              | directory with all (binary) resources for offline infra and application      |
-|                                       |                                                                              |
-|                                       | Example: /tmp/resources                                                      |
+| resources_package.tar                 | Contains all input files  needed to deploy infrastructure and ONAP           |
 +---------------------------------------+------------------------------------------------------------------------------+
 +---------------------------------------+------------------------------------------------------------------------------+
-| APP_AUX_BINARIES                      | additional binaries such as docker images loaded during runtime   [optional] |
+| aux_package.tar                       | Contains auxiliary input files that can be added to ONAP                     |
 +---------------------------------------+------------------------------------------------------------------------------+
 
 +---------------------------------------+------------------------------------------------------------------------------+
 
-Offline installer packages are created with prepopulated data via
-following command run from onap-offline directory
+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.
+
+From onap-offline directory run:
 
 ::
 
 
 ::
 
-  ./build/package.sh <project> <version> <packaging target directory>
+  ./build/package.py <helm charts repo> --application-repository_reference <commit/tag/branch> --application-patch_file <patchfile> --output-dir <target\_dir> --resources-directory <target\_dir>
 
 
-E.g.
+For example:
 
 ::
 
 
 ::
 
-  ./build/package.sh onap 4.0.0 /tmp/package
+  ./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
 
 
 
 
-So in the target directory you should find tar files with
+In the target directory you should find tar files:
 
 ::
 
 
 ::
 
-  offline-<PROJECT_NAME>-<PROJECT_VERSION>-sw.tar
-  offline-<PROJECT_NAME>-<PROJECT_VERSION>-resources.tar
-  offline-<PROJECT_NAME>-<PROJECT_VERSION>-aux-resources.tar
+  sw_package.tar
+  resources_package.tar
+  aux_package.tar
 
 
 Appendix 1. Step-by-step download procedure
 
 
 Appendix 1. Step-by-step download procedure
@@ -275,42 +208,29 @@ Appendix 1. Step-by-step download procedure
         --docker ./build/data_lists/onap_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 - building own dns image**
-
-::
-
-        # We are building our own dns image within our offline infrastructure
-        ./build/creating_data/create_nginx_image/01create-image.sh /tmp/resources/offline_data/docker_images_infra
-
-**Step 3 - git repos**
+**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
 
 
 ::
 
         # Following step will download all git repos
         ./build/download/download.py --git ./build/data_lists/onap_git_repos.list ../resources/git-repo
 
-**Step 4 - http files**
-
-ToDo: complete and verified list of http files will come just during/after vFWCL testcase
 
 
-**Step 5 - npm packages**
+**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
 
 
 ::
 
         # Following step will download all npm packages
         ./build/download/download.py --npm ./build/data_lists/onap_npm.list ../resources/offline_data/npm_tar
 
-**Step 6 - binaries**
+**Step 4 - binaries**
 
 ::
 
 
 ::
 
-       # Following step will download and prepare rke, kubectl and helm binaries
+       # Following step will download rke, kubectl and helm binaries
        ./build/download/download.py --http ./build/data_lists/infra_bin_utils.sh ../resources/downloads
        ./build/download/download.py --http ./build/data_lists/infra_bin_utils.sh ../resources/downloads
-       tar -xf ../resources/downloads/helm-v2.12.3-linux-amd64.tar.gz linux-amd64/helm -O > ../resources/downloads/helm
-       rm -f ../resources/downloads/helm-v2.12.3-linux-amd64.tar.gz
-       mv ../resources/downloads/rke_linux-amd64 rke
 
 
-**Step 7 - rpms**
+**Step 5 - rpms**
 
 ::
 
 
 ::
 
@@ -319,7 +239,7 @@ ToDo: complete and verified list of http files will come just during/after vFWCL
 
       createrepo ../resources/pkg/rhel
 
 
       createrepo ../resources/pkg/rhel
 
-**Step 8 - pip packages**
+**Step 6 - pip packages**
 
 ::
 
 
 ::