aboutsummaryrefslogtreecommitdiffstats
path: root/bootstrap/vagrant-onap/doc
diff options
context:
space:
mode:
Diffstat (limited to 'bootstrap/vagrant-onap/doc')
-rw-r--r--bootstrap/vagrant-onap/doc/source/features/configure_execution.rst73
-rw-r--r--bootstrap/vagrant-onap/doc/source/features/example_usage.rst151
-rw-r--r--bootstrap/vagrant-onap/doc/source/features/features.rst2
3 files changed, 226 insertions, 0 deletions
diff --git a/bootstrap/vagrant-onap/doc/source/features/configure_execution.rst b/bootstrap/vagrant-onap/doc/source/features/configure_execution.rst
new file mode 100644
index 000000000..713c0e0fd
--- /dev/null
+++ b/bootstrap/vagrant-onap/doc/source/features/configure_execution.rst
@@ -0,0 +1,73 @@
+=======================
+Modify execution values
+=======================
+
+In order to provide a flexible platform that adjusts to different developer
+needs, it has been implemented two mechanism to configure the execution of this
+project.
+
+Settings configuration file
+---------------------------
+
+The first mechanism refers to the process to replace default configuration
+values through a settings configuration file. This file needs to be placed into
+the *./etc* folder and named *settings.yaml*. It must contain the key/pair
+configuration values that will be overriden.
+
+.. note::
+
+ There are sample files (e. g. settings.yaml.development and
+ settings.yaml.testing) placed into the *./etc* folder. Their purpose is to
+ provide a reference of different configurations.
+
+.. end
+
+Configuration values:
+
++------------------+-------------------+---------------------------------------+
+| Key | Values | Description |
++==================+===================+=======================================+
+| build_image | "True" or "False" | Determines if the Docker image is |
+| | | retrieved from public hub or built |
+| | | from source code. |
++------------------+-------------------+---------------------------------------+
+| clone_repo | "True" or "False" | Determines if all the source code |
+| | | repositories of a given component are |
+| | | cloned locally. |
++------------------+-------------------+---------------------------------------+
+| compile_repo | "True" or "False" | Determines if all the source code |
+| | | repositories of a given component are |
+| | | going to be compiled. |
++------------------+-------------------+---------------------------------------+
+| enable_oparent | "True" or "False" | Determines if the OParent project |
+| | | will be used during the maven |
+| | | compilation. |
++------------------+-------------------+---------------------------------------+
+| skip_get_images | "True" or "False" | Determines if the process to build or |
+| | | retrieve docker images of a given |
+| | | component are going to skipped. |
++------------------+-------------------+---------------------------------------+
+| skip_install | "True" or "False" | Determines if the process to start |
+| | | the services of a given component |
+| | | will be started. |
++------------------+-------------------+---------------------------------------+
+
+Parameters
+----------
+
+The **skip_get_images** and **skip_install** are the only two configuration
+values that can be overriden using *-g* and *-i* respectively by the run scripts
+(*./tools/run.sh* and *.\\tools\\Run.ps1*).
+
+.. note::
+
+ The script parameters take precendence of the configuration file.
+
+.. end
+
+.. code-block:: console
+
+ $ ./tools/run.sh sdc -g
+
+.. end
+
diff --git a/bootstrap/vagrant-onap/doc/source/features/example_usage.rst b/bootstrap/vagrant-onap/doc/source/features/example_usage.rst
new file mode 100644
index 000000000..293c543fa
--- /dev/null
+++ b/bootstrap/vagrant-onap/doc/source/features/example_usage.rst
@@ -0,0 +1,151 @@
+=================================================
+Example usage to bring up a developer environment
+=================================================
+
+In the example, we will bring up a single ONAP component using the Vagrant ONAP
+tool.
+
+There are multiple scenarios in which this tool can be made use of by a
+developer, they usually fall in the following use cases.
+
+Use case 1: Use Vagrant ONAP to just clone project related source code
+----------------------------------------------------------------------
+
+In this use case, the developer needs just the source code of the project to work on.
+
+Since the Vagrant ONAP project supports building docker containers and compiling
+source files, we need to first edit the settings.yaml file to add key value pairs
+indicating we need to only clone repo and not build docker image or compile then.
+By default, Vagrant ONAP clones repo, but to not run the build process and cloning
+docker images, the following are required to be added in the settings file.
+
+.. code-block:: console
+
+ skip_get_images: "True"
+
+.. end
+
+The reason this is done is because as mentioned in the
+`configure execution docs. <https://git.onap.org/integration/tree/bootstrap/vagrant-onap/doc/source/features/configure_execution.rst>`,
+the default values taken are:
+
+.. code-block:: console
+
+ 'build_image' => 'True',
+ 'clone_repo' => 'True',
+ 'compile_repo' => 'False',
+ 'enable_oparent' => 'True',
+ 'skip_get_images' => 'False',
+ 'skip_install' => 'True'
+
+.. end
+
+We override them and skip_get_images is given precedence over build_image.
+
+Use case 2: Use Vagrant ONAP to clone project related source code and clone Docker Images
+-----------------------------------------------------------------------------------------
+
+In this use case, the developer needs to clone docker images of the project to work on.
+
+For this case, we will edit the settings.yaml file to add key value pairs indicating we
+need to clone repo and clone docker image from Nexus.
+
+.. code-block:: console
+
+ build_images: "False"
+ compile_repo: "True"
+ skip_get_images: "False"
+ skip_install: "True"
+
+.. end
+
+Use case 3: Use Vagrant ONAP to clone project related source code and build Docker Images locally
+-------------------------------------------------------------------------------------------------
+
+In this use case, the developer needs to build docker images of the project to work on.
+
+For this case, we will edit the settings.yaml file to add key value pairs indicating we need to
+clone repo and build docker image locally and not fetch them from Nexus.
+
+.. code-block:: console
+
+ build_images: "True"
+ compile_repo: "True"
+ skip_get_images: "False"
+ skip_install: "True"
+
+.. end
+
+Use case 4: Use Vagrant ONAP to clone project related source code and build Docker Images and start services
+------------------------------------------------------------------------------------------------------------
+
+In this use case, the developer needs to build docker images of the project he or
+she wanted to work on and start the services running inside them.
+
+For this case, we will edit the settings.yaml file to add key value pairs indicating
+we need to clone repo, compile repo, build docker image and run the image.
+
+.. code-block:: console
+
+ build_images: "True"
+ compile_repo: "True"
+ skip_get_images: "False"
+ skip_install: "False"
+
+.. end
+
+Once the required changes to the settings file is added, we can use the run.sh
+script in tools directory to setup the development environment.
+
+Example steps for setting up a development environment for VFC project.
+-----------------------------------------------------------------------
+
+In this example we will be using vagrant ONAP to get all the source code of VFC
+project and the developer can point the IDE to the cloned repo in the ./opt directory
+and start the development process.
+
+.. code-block:: console
+
+ $ ./tools/run.sh vfc
+
+.. end
+
+At the end of the setup process, all the VFC related source code will be present
+in the vagrant-onap/opt/ directory. The developer can point an IDE to this directory
+and start contributing. When the changes are done, the developer can SSH into the VM
+running VFC and tests can be executed by running Maven for Java and Tox for Python
+from the ~/opt/vfc directory.
+
+.. code-block:: console
+
+ $ vagrant ssh vfc
+ $ cd ~/opt/vfc/<vfc-subrepo>
+ $ tox -e py27
+
+.. end
+
+This way the tool helps the developer to clone repos of a particular project,
+without having to manually search for repos and setup an environment.
+
+Also, if something gets messed up in the VM, the developer can tear down the VM
+and spin a fresh one without having to lose the changes made to the source code since
+the ./opt files are in sync from the host to the VM.
+
+.. code-block:: console
+
+ $ vagrant destroy vfc
+
+.. end
+
+Testing
+-------
+
+Use the run.sh script to test if the provisioning scripts run without errors.
+
+And example test to check the number of covered repositories with this tool.
+
+.. code-block:: console
+
+ $ ./tools/run.sh testing -y -c coverity_repos -s functions
+
+.. end \ No newline at end of file
diff --git a/bootstrap/vagrant-onap/doc/source/features/features.rst b/bootstrap/vagrant-onap/doc/source/features/features.rst
index 949969828..2f88c52e7 100644
--- a/bootstrap/vagrant-onap/doc/source/features/features.rst
+++ b/bootstrap/vagrant-onap/doc/source/features/features.rst
@@ -9,6 +9,8 @@ Advanced features
openstack.rst
consuming_scripts.rst
+ configure_execution.rst
+ example_usage.rst
This chapter explains how to use ONAP on Vagrant Advanced features
like different providers.