0172cffa435a092393bd00aa9107a1bc8ac6bc27
[ric-plt/a1.git] / docs / index.rst
1 A1
2 ==
3
4 API
5 ===
6
7 You can see the API (OpenAPI3 spec) at ``a1/openapi.yml``. You can also
8 see the “pretty” version if you run the container at
9 ``http://localhost:10000/ui/``.
10
11 Unit Testing
12 ============
13
14 Note, this requires rmr to be installed!
15
16 ::
17
18    tox
19    open htmlcov/index.html
20
21 Integration testing
22 ===================
23
24 This tests A1’s external API with two test receivers. Note, this
25 currently depends on docker-compose, meaning you cannot run this if
26 docker-compose is not installed. Note2: this is not fast. It builds the
27 containers and launches requests against the API so it takes time.
28
29 ::
30
31    tox -c tox-integration.ini
32
33 Running
34 =======
35
36 Optional ENV Variables
37 ----------------------
38
39 You can set the following ENVs to change the A1 behavior: 1)
40 ``RMR_RCV_RETRY_INTERVAL`` the number of milliseconds that execution
41 will defer (back to the server loop to handle http request if
42 applicable) when an expected ack is not received by rmr call. The
43 default is ``1000`` (1s). The time for the full HTTP request to
44 ``PUT /policies`` will be > this if an ACK is not recieved within 10ms,
45 which is an initial delay until the first rcv is tried. 2)
46 ``RMR_RETRY_TIMES`` the number of times failed rmr operations such as
47 timeouts and send failures should be retried before A1 gives up and
48 returns a 503. The default is ``4``.
49
50 Docker
51 ------
52
53 building
54 ~~~~~~~~
55
56 ::
57
58    docker build --no-cache -t a1:X.Y.Z .
59
60 .. _running-1:
61
62 running
63 ~~~~~~~
64
65 (TODO: this will be enhanced with Helm.)
66
67 ::
68
69    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