Victor Morales | 1461312 | 2017-08-22 19:51:35 -0500 | [diff] [blame^] | 1 | ============================== |
| 2 | Using the provisioning scripts |
| 3 | ============================== |
| 4 | |
| 5 | Vagrant is a platform that uses prebaked images called |
| 6 | *vagrant boxes* to guarranty that running multiple times a |
| 7 | provisioning script will result in an expected output. This |
| 8 | mechanism is crucial for reducing the number of external factors |
| 9 | during the creation, development and testing of provisioning scripts. |
| 10 | However, it's possible to provide an ONAP development enviroment |
| 11 | without having to install Vagrant tool. This document explains how to |
| 12 | consume the provisioning scripts localed in **./lib** folder to |
| 13 | provision a development environment and the environment variables |
| 14 | that modifies their behavior. |
| 15 | |
| 16 | This project was built on an Ubuntu 14.04 ("Trusty") Operating System, |
| 17 | therefore it's necessary to have an user who has *sudo* permissions to |
| 18 | access to a Bare Metal or Virtual Machine. |
| 19 | |
| 20 | The following instructions retrieve the provisioning scripts and place |
| 21 | them into the */var/onap/* folder. |
| 22 | |
| 23 | .. code-block:: console |
| 24 | |
| 25 | $ sudo su - |
| 26 | # apt-get install git -y |
| 27 | # git clone https://git.onap.org/integration |
| 28 | # mv integration/bootstrap/vagrant-onap/lib/ /var/onap/ |
| 29 | |
| 30 | .. end |
| 31 | |
| 32 | Loading a provisioning script will be based on the desired ONAP |
| 33 | service, for example to setup the development environment for Active |
| 34 | and Available Inventory (AAI) service will be required to load the |
| 35 | */var/onap/aai* script. |
| 36 | |
| 37 | .. note:: |
| 38 | |
| 39 | The **git_src_folder** environment variable specifies the |
| 40 | source code destination folder, it's default value is */opt/* |
| 41 | but it can be changed only after is loaded the provisioning |
| 42 | scripts. |
| 43 | |
| 44 | .. end |
| 45 | |
| 46 | .. code-block:: console |
| 47 | |
| 48 | # source /var/onap/aai |
| 49 | |
| 50 | .. end |
| 51 | |
| 52 | Lastly, every script has defined a initialization function with |
| 53 | *init_* as prefix. This function is the starting point to provision |
| 54 | the chosen ONAP service. This example uses the *init_aai* function |
| 55 | to provision a AAI Developement environment. |
| 56 | |
| 57 | .. note:: |
| 58 | |
| 59 | The **compile_repo** environment variable defines whether or not |
| 60 | the source code located on the repositories of the service. |
| 61 | Enabling this value can impact the provisioning time of the |
| 62 | service. |
| 63 | |
| 64 | .. end |
| 65 | .. note:: |
| 66 | |
| 67 | **nexus_docker_repo**, **nexus_username** and **nexus_password** |
| 68 | environment variables specify the connectivity to a private Docker |
| 69 | Hub. |
| 70 | |
| 71 | .. end |
| 72 | .. note:: |
| 73 | |
| 74 | **build_image** environment variable allows the Docker images |
| 75 | from source code. Enabling this value can impact the |
| 76 | provisioning time of the service. |
| 77 | |
| 78 | .. end |
| 79 | |
| 80 | .. code-block:: console |
| 81 | |
| 82 | # export nexus_docker_repo="nexus3.onap.org:10001" |
| 83 | # export nexus_username="docker" |
| 84 | # export nexus_password="docker" |
| 85 | # init_aai |
| 86 | |
| 87 | .. end |
| 88 | |
| 89 | As result, the source code is pulled into */opt/aai/* folder and the |
| 90 | AAI services are up and running with the proper connection to the |
| 91 | Titan Distributed Graph Database. |