update Release Notes and Doc Issue
[aaf/authz.git] / docs / sections / installation / AAF_3.1_build.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
3 .. Copyright © 2017 AT&T Intellectual Property. All rights reserved.
4
5 ============================
6 Building 
7 ============================
8 *Note: this document assumes UNIX Bash Shell.  Being Java, AAF works in Windows, but you will have to create your own script/instruction conversions.*
9
10 ---------------------
11 Building from Source 
12 ---------------------
13 Choose the directory you wish to start in... This process will create an "authz" subdirectory::
14
15   $ mkdir -p ~/src
16   $ cd ~/src
17
18 Use 'git' to 'clone' the master code::
19  
20   $ git clone https://gerrit.onap.org/r/aaf/authz
21
22 Change to that directory::
23
24   $ cd authz
25
26 Use Maven to build::
27
28   << TODO, get ONAP Settings.xml>>
29   $ mvn install
30
31 .. -----------------
32 .. Standalone
33 .. -----------------
34
35 -----------------
36 Docker Mode
37 -----------------
38
39 After you have successfully run maven, you will need a Cassandra.  If you don't have one, here are instructions for a Docker Standalone Cassandra.  For a *serious* endeavor, you need a multi-node Cassandra.
40
41 -----------------------------
42 Existing Cassandra Instance
43 -----------------------------
44
45 When AAF modifies or adds a Cassandra Table, it is entered in two places:
46         - COMPLETE Table Schemes for Startup:  authz/auth/auth-cass/cass_init/init.cql
47         - INCREMENTAL Table Schemes for Existing AAF Setups:  authz/auth/auth-cass/cass_init/init<Interface Version>.cql
48
49 ### As an example, Assume interface change of "2_10" AND you have an existing Cassandra, add these steps, otherwise, skip
50 $ docker container cp init2_10.cql aaf_cass:/tmp
51 $ docker exec -it aaf_cass bash
52 (docker) $ cd /tmp
53 ###
54 $ cqlsh -f 'init2_10.cql'
55
56 --------------------
57 New Docker Cassandra
58 --------------------
59
60 Assuming you are in your src/authz directory::
61 | $ cd auth/auth-cass/docker
62 | $ bash dinstall.sh
63
64 FOR DEVELOPMENT:
65 Normally, Cassandra in Containers are NOT published external to Docker for security exposure reasons.  HOWEVER, you can do the above as follows and then be able to access the DB while coding, debugging, etc::
66
67 | $ bash dinstall.sh publish
68
69 ---------------------
70 AAF Itself
71 ---------------------
72
73 Assuming you are in your src/authz directory::
74
75 | $ cd auth/docker
76 | ### If you have not done so before (don't overwrite your work!)
77 | $ cp d.props.init d.props
78
79 Adjust for ACTUAL AAF version if required.
80
81 There are two special scripts created.
82         - "aaf.sh" - The script that creates and accesses AAF's Configuration information.  It uses "d.props"
83         - "agent.sh" - A script for use by MSs OTHER than AAF (i.e. aai) for creating AAF Configuration. It uses "aaf.props".  (note, need to have AAF running to generate Certificates)
84
85 In BOTH cases, the scripts will ask for Properties required that are not in the current d.props or 
86
87 ------------------------------
88 "Bleeding Edge" Source install
89 ------------------------------
90
91 AAF can be built, and local Docker Images built with the following::
92
93   $ bash dbuild.sh
94
95 Otherwise, just let it pull from Nexus
96
97 ------------------------------
98 Other Scripts
99 ------------------------------
100 The following will act on ALL possible AAF instances if there are no Params.  You can apply to only ONE MS by adding short name i.e. "service" instead of "aaf_service"
101   - drun.sh - starts up Docker FRESH instances of AAF locally (not K8s)
102   - dstop.sh - stops Docker instances of AAF locally
103   - dclean.sh - cleans up containers in Docker so you can do "dbuild.sh" (above) and start fresh
104   - dstart.sh - starts Docker containers that were previously stopped... Doesn't refresh actual container.
105   - dbounce.sh - stops and starts in one method
106
107
108
109