Added docs folder
[ric-plt/rtmgr.git] / docs / installation-guide.rst
1 ..
2 ..  Copyright (c) 2019 AT&T Intellectual Property.
3 ..  Copyright (c) 2019 Nokia.
4 ..
5 ..  Licensed under the Creative Commons Attribution 4.0 International
6 ..  Public License (the "License"); you may not use this file except
7 ..  in compliance with the License. You may obtain a copy of the License at
8 ..
9 ..    https://creativecommons.org/licenses/by/4.0/
10 ..
11 ..  Unless required by applicable law or agreed to in writing, documentation
12 ..  distributed under the License is distributed on an "AS IS" BASIS,
13 ..  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 ..
15 ..  See the License for the specific language governing permissions and
16 ..  limitations under the License.
17 ..
18
19
20
21 Installation Guide
22 ==================
23
24 .. contents::
25    :depth: 3
26    :local:
27
28 Abstract
29 --------
30
31 This document describes how to install ric-plt/rtmgr, it's dependencies and required system resources.
32
33 Introduction
34 ------------
35 Routing Manager is a basic platform service of RIC. It is responsible for distributing routing policies among the other platform components and xApps.
36
37 Pre-requisites
38 --------------
39 * Healthy kubernetes cluster (for Kubernetes testing)
40 * Access to the common docker registry (alternatively, you can set up your own private registry for testing: "https://docs.docker.com/registry/deploying/")
41 * In case of non-Docker build: 
42     * golang 11.1 at least
43     * go-swagger ("https://github.com/go-swagger/go-swagger", v0.19.0)
44     * glide ("https://github.com/Masterminds/glide")
45     * XApp Manager spec file (available in ORAN: "https://gerrit.o-ran-sc.org/r/admin/repos/ric-plt/appmgr" under api folder)
46
47 Software Installation and Deployment
48 ------------------------------------
49 This section describes the installation of the ric-plt/rtmgr installation.
50
51 Docker Image
52 ------------
53 The Dockerfile located in the project root folder does the following three things:
54
55 * As a first step, it creates a build container, fetches XApp Manager's spec file, generates rest api code from swagger spec and builds rtmgr.
56 * As a second step, it executes UTs on rtmgr source code.
57 * As a third step, it creates the final container from rtmgr binary (Ubuntu based).
58
59 For a docker build execute `docker build --tag=rtmgr-build:test .` in the project root directory (feel free to replace the name:tag with your own)
60
61 Linux Binary
62 ------------
63 * Compiling without Docker involves some manual steps before compiling directly with "go build".
64 * The XApp manager's spec file must be fetched, then api generated with swagger. (these steps are included in the Dockerfile).
65 * After the code is generated, glide can install the dependencies of rtmgr.
66 * Make sure you set your GOPATH variable correctly (example: $HOME/go/src/routing-manager)
67 * Code generation and building example (from project root folder):
68
69   * git clone https://gerrit.o-ran-sc.org/r/ric-plt/appmgr && cp appmgr/api/appmgr_rest_api.yaml api/
70   * swagger generate server -f api/routing_manager.yaml -t pkg/ --exclude-main -r LICENSE
71   * swagger generate client -f api/appmgr_rest_api.yaml -t pkg/ -m appmgr_model -c appmgr_client -r LICENSE
72   * glide install --strip-vendor
73   * go build cmd/rtmgr.go
74
75 NOTE: before doing a docker build it is advised to remove any generated files and vendor packages:
76 assuming that you stand in project root dir
77
78         rm -rf appmgr vendor pkg/appmgr_* pkg/models pkg/restapi
79
80 Command line arguments
81 ----------------------
82 Routing manager binary can be called with `-h` flag when it displays the available command line arguments and it's default value.
83
84 Example:
85
86 Usage of ./rtmgr:
87    -configfile string
88          Routing manager's configuration file path (default "/etc/rtmgrcfg.json")
89    -filename string
90          Absolute path of file where the route information to be stored (default "/db/rt.json")
91    -loglevel string
92          INFO | WARN | ERROR | DEBUG (default "INFO")
93    -nbi string
94          Northbound interface module to be used. Valid values are: 'httpGetter | httpRESTful' (default "httpGetter")
95    -nbi-if string
96          Base HTTP URL where routing manager will be listening on (default "http://localhost:8888")
97    -rpe string
98          Route Policy Engine to be used. Valid values are: 'rmrpush | rmrpub' (default "rmrpush")
99    -sbi string
100          Southbound interface module to be used. Valid values are: 'nngpush | nngpub' (default "nngpush")
101    -sbi-if string
102          IPv4 address of interface where Southbound socket to be opened (default "0.0.0.0")
103    -sdl string
104          Datastore enginge to be used. Valid values are: 'file' (default "file")
105    -xm-url string
106          HTTP URL where xApp Manager exposes the entire xApp List (default "http://localhost:3000/xapps")
107