Update docs for music migration
[optf/has.git] / docs / sections / installation.rst
1 Installation
2 ============
3
4 OOF-HAS OOM Charts
5 ------------------
6
7 HAS charts are located in the `OOM repository <https://git.onap.org/oom/>`__
8
9 Please refer OOM documentation for deploying/undeploying the OOF compoenents
10 via helm charts in the k8s environment.
11
12 Local Installation
13 ------------------
14
15 HAS components can be deployed in two ways in a local environment for development
16 and testing.
17
18 Docker Installation
19 -------------------
20
21 Building Docker Images
22 ~~~~~~~~~~~~~~~~~~~~~~
23
24 Build the HAS docker images using the maven build from the root of the project
25
26 .. code:: bash
27
28     git clone --depth 1 https://gerrit.onap.org/r/optf/has
29     cd has
30     mvn clean install
31
32 Installing the components and simulators
33 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
34
35 HAS docker containers can be installed using the shell scripts in the CSIT directory
36 which includes the script to deploy the startup dependencies(SMS, ETCD) and a
37 few simulators.
38
39 .. code:: bash
40
41     export WORKSPACE=$(pwd)/csit
42     ./csit/plans/default/setup.sh
43
44 Similarly the installed components can be deleted using the teardown script.
45
46 .. code:: bash
47
48     export WORKSPACE=$(pwd)/csit
49     ./csit/plans/default/teardown.sh
50
51 Note: The simulator setup can be disabled by the commenting out the commands from
52 the setup scripts.
53
54 Installation from the source
55 ----------------------------
56
57 HAS components can be installed locally by directly in a linux based environment.
58 This will be significant for testing and debugging during developme
59
60 Requirements
61 ~~~~~~~~~~~~
62
63 Conductor is officially supported on most of the linux based environment, but of
64 the development and testing were done on Ubuntu based machines.
65
66 Ensure the following packages are present, as they may not be
67 included by default:
68
69 -  libffi-dev
70 -  python3.8
71
72 Installing Dependent Components(AAF-SMS, ETCD/MUSIC)
73 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
74
75 The scripts to install and uninstall the components are present in the
76 CSIT directory.
77
78 **Note**: For setting up SMS, ETCD and MUSIC, docker must be present in
79 the machine.
80
81 For installing/uninstalling AAF-SMS,
82
83 .. code:: bash
84
85     cd csit/scripts
86     # install SMS
87     source setup-sms.sh
88     # uninstall SMS
89     docker stop sms
90     docker stop vault
91     docker rm sms
92     docker rm vault
93
94 For installing/uninstalling ETCD
95
96 .. code:: bash
97
98     cd csit/scripts
99     # install etcd
100     source etcd_Script.sh
101     # uninstall etcd
102     source etcd_teardown_script.sh
103
104 Installing From Source
105 ~~~~~~~~~~~~~~~~~~~~~~
106
107 **IMPORTANT**: Perform the steps in this section after *optionally*
108 configuring and activating a python virtual environment.
109
110 Conductor source in ONAP is maintained in
111 https://gerrit.onap.org/r/optf/has.
112
113 Clone the git repository, and then install from within the ``conductor``
114 directory:
115
116 .. code:: bash
117
118     git clone --depth 1 https://gerrit.onap.org/r/optf/has
119     cd conductor
120     pip install --no-cache-dir -e .
121
122 Verifying Installation
123 ~~~~~~~~~~~~~~~~~~~~~~
124
125 Each of the five Conductor services may be invoked with the ``--help``
126 option:
127
128 .. code:: bash
129
130     conductor-api -- --help
131     conductor-controller --help
132     conductor-data --help
133     conductor-solver --help
134     conductor-reservation --help
135
136 **NOTE**: The ``conductor-api`` command is deliberate. ``--`` is used as
137 as separator between the arguments used to start the WSGI server and the
138 arguments passed to the WSGI application.
139
140 Running for the First Time
141 ~~~~~~~~~~~~~~~~~~~~~~~~~~
142
143 Each Conductor component may be run interactively. In this case, the
144 user does not necessarily matter.
145
146 When running interactively, it is suggested to run each command in a
147 separate terminal session and in the following order:
148
149 .. code:: bash
150
151     conductor-data --config-file=/etc/conductor/conductor.conf
152     conductor-controller --config-file=/etc/conductor/conductor.conf
153     conductor-solver --config-file=/etc/conductor/conductor.conf
154     conductor-reservation --config-file=/etc/conductor/conductor.conf
155     conductor-api --port=8091 -- --config-file=/etc/conductor/conductor.conf
156
157 Sample API Calls and Homing Templates
158 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
159
160 A `Postman <http://getpostman.com/>`__ collection illustrating sample
161 requests is available upon request. The collection will also be added in
162 a future revision.
163
164 `Sample homing templates <example.html>`__ are also
165 available.