316ef9e134500fc230ee33f223e5c73e9a0a3d1c
[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 Docker
68 ------
69
70 building
71 ~~~~~~~~
72
73 ::
74
75    docker build --no-cache -t a1:X.Y.Z .
76
77 .. _running-1:
78
79 running
80 ~~~~~~~
81
82 (TODO: this will be enhanced with Helm.)
83
84 ::
85
86    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