Add helm chart, may need rmr edits
[ric-plt/a1.git] / docs / index.rst
1 .. ==================================================================================
2 ..       Copyright (c) 2019 Nokia
3 ..       Copyright (c) 2018-2019 AT&T Intellectual Property.
4 ..
5 ..   Licensed under the Apache License, Version 2.0 (the "License");
6 ..   you may not use this file except in compliance with the License.
7 ..   You may obtain a copy of the License at
8 ..
9 ..          http://www.apache.org/licenses/LICENSE-2.0
10 ..
11 ..   Unless required by applicable law or agreed to in writing, software
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 ..   See the License for the specific language governing permissions and
15 ..   limitations under the License.
16 .. ==================================================================================
17
18 A1 Mediator
19 ===========
20
21 API
22 ===
23
24 You can see the API (OpenAPI3 spec) at ``a1/openapi.yml``. You can also
25 see the “pretty” version if you run the container at
26 ``http://localhost:10000/ui/``.
27
28 Unit Testing
29 ============
30
31 Note, this requires rmr to be installed!
32
33 ::
34
35    tox
36    open htmlcov/index.html
37
38 Integration testing
39 ===================
40
41 This tests A1’s external API with two test receivers. Note, this
42 currently depends on docker-compose, meaning you cannot run this if
43 docker-compose is not installed. Note2: this is not fast. It builds the
44 containers and launches requests against the API so it takes time.
45
46 ::
47
48    tox -c tox-integration.ini
49
50 Running
51 =======
52
53 Optional ENV Variables
54 ----------------------
55
56 You can set the following ENVs to change the A1 behavior: 1)
57 ``RMR_RCV_RETRY_INTERVAL`` the number of milliseconds that execution
58 will defer (back to the server loop to handle http request if
59 applicable) when an expected ack is not received by rmr call. The
60 default is ``1000`` (1s). The time for the full HTTP request to
61 ``PUT /policies`` will be > this if an ACK is not recieved within 10ms,
62 which is an initial delay until the first rcv is tried. 2)
63 ``RMR_RETRY_TIMES`` the number of times failed rmr operations such as
64 timeouts and send failures should be retried before A1 gives up and
65 returns a 503. The default is ``4``.
66
67 K8S
68 ---
69 The helm chart is in the folder `a1mediator`.
70
71 There are two files in `a1mediator/files` that should be replaced with the "real" files for deployment. The ones included there, and referenced in the configmap, are only samples. To deploy A1 correctly, make sure these files are correct.
72
73 ::
74
75     helm install --devel a1mediator/ --name a1 --set imageCredentials.username=xxx --set imageCredentials.password=xxx
76
77 The username and password here are the credentials to the registry defined in `a1mediator/values.yaml`. Currently this is the LF docker registry.
78
79 Docker
80 ------
81
82 building
83 ~~~~~~~~
84
85 ::
86
87    docker build --no-cache -t a1:X.Y.Z .
88
89 .. _running-1:
90
91 running
92 ~~~~~~~
93
94 (TODO: this will be enhanced with Helm.)
95
96 ::
97
98    docker run -dt -p 10000:10000 -v /path/to/localrt:/opt/route/local.rt -v /path/to/ricmanifest:/opt/ricmanifest.json a1:X.Y.Z -v