blob: e04fdf27b260437b6d244903411da6dee1f1007d [file] [log] [blame]
Tommy Carpenter42493982019-11-06 07:27:16 -05001.. This work is licensed under a Creative Commons Attribution 4.0 International License.
2.. http://creativecommons.org/licenses/by/4.0
Tommy Carpenter0a3f6762019-11-06 09:24:16 -05003.. Copyright (C) 2019 AT&T Intellectual Property
Tommy Carpenter42493982019-11-06 07:27:16 -05004
Lott, Christopher (cl778h)39c9ab62020-05-27 09:45:49 -04005Installation Guide
6==================
Tommy Carpenter42493982019-11-06 07:27:16 -05007
8.. contents::
9 :depth: 3
10 :local:
11
Lott, Christopher (cl778h)c91a4a12020-05-27 15:56:20 -040012Environment Variables
13---------------------
Tommy Carpenter42493982019-11-06 07:27:16 -050014
Lott, Christopher (cl778h)20d87ed2020-04-29 16:50:06 -040015You can set the following environment variables when launching a container to change the A1 behavior:
Tommy Carpenter42493982019-11-06 07:27:16 -050016
Tommy Carpenter0a3f6762019-11-06 09:24:16 -0500171. ``A1_RMR_RETRY_TIMES``: the number of times failed rmr operations such as timeouts and send failures should be retried before A1 gives up and returns a 503. The default is ``4``.
18
192. ``INSTANCE_DELETE_NO_RESP_TTL``: Please refer to the delete flowchart in docs/; this is ``T1`` there. The default is 5 (seconds). Basically, the number of seconds that a1 waits to remove an instance from the database after a delete is called in the case that no downstream apps responded.
20
213. ``INSTANCE_DELETE_RESP_TTL``: Please refer to the delete flowchart in docs/; this is ``T2`` there. The default is 5 (seconds). Basically, the number of seconds that a1 waits to remove an instance from the database after a delete is called in the case that downstream apps responded.
Tommy Carpenter42493982019-11-06 07:27:16 -050022
Lott, Christopher (cl778h)20d87ed2020-04-29 16:50:06 -0400234. ``USE_FAKE_SDL``: This allows testing of the A1 feature without a DBaaS SDL container. The default is False.
24
Lott, Christopher (cl778h)c91a4a12020-05-27 15:56:20 -0400255. ``prometheus_multiproc_dir``: The directory where Prometheus gathers metrics. The default is /tmp.
Tommy Carpenter42493982019-11-06 07:27:16 -050026
Lott, Christopher (cl778h)c91a4a12020-05-27 15:56:20 -040027
28Kubernetes Deployment
29---------------------
30The official Helm chart for the A1 Mediator is in a deployment repository, which holds all of the Helm charts
31for the RIC platform. There is a helm chart in `integration_tests` here for running the integration tests as
32discussed above.
33
34Local Deployment
35----------------
36
37Build and run the A1 mediator locally using the docker CLI as follows.
Tommy Carpenter42493982019-11-06 07:27:16 -050038
Lott, Christopher (cl778h)fe30c172020-04-29 15:23:28 -040039Build the image
40~~~~~~~~~~~~~~~
Tommy Carpenter42493982019-11-06 07:27:16 -050041::
42
Lott, Christopher (cl778h)fe30c172020-04-29 15:23:28 -040043 docker build --no-cache -t a1:latest .
Tommy Carpenter42493982019-11-06 07:27:16 -050044
45.. _running-1:
46
Lott, Christopher (cl778h)fe30c172020-04-29 15:23:28 -040047Start the container
48~~~~~~~~~~~~~~~~~~~
49
Lott, Christopher (cl778h)20d87ed2020-04-29 16:50:06 -040050The A1 container depends on a companion DBaaS (SDL) container, but if that is not convenient set
51an environment variable as shown below to mock that service. Also a sample RMR routing table is
52supplied in file `local.rt` for mounting as a volume. The following command uses both:
Tommy Carpenter42493982019-11-06 07:27:16 -050053
54::
55
Lott, Christopher (cl778h)20d87ed2020-04-29 16:50:06 -040056 docker run -e USE_FAKE_SDL=True -p 10000:10000 -v /path/to/local.rt:/opt/route/local.rt a1:latest
Tommy Carpenter42493982019-11-06 07:27:16 -050057
Lott, Christopher (cl778h)fe30c172020-04-29 15:23:28 -040058View container API
59~~~~~~~~~~~~~~~~~~
60
61A web user interface generated from the OpenAPI specification can be accessed at this URL:
62
63::
64
65 http://docker-host-name-or-ip:10000/ui
66
67Check container health
68~~~~~~~~~~~~~~~~~~~~~~
69
Lott, Christopher (cl778h)20d87ed2020-04-29 16:50:06 -040070The following command requests the container health. Expect an internal server error if the
71Storage Data Layer (SDL) service is not available or has not been mocked as shown above.
Lott, Christopher (cl778h)fe30c172020-04-29 15:23:28 -040072
73::
74
75 curl docker-host-name-or-ip:10000/a1-p/healthcheck