Refactoring Docs
[ccsdk/cds.git] / docs / CBA / index.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0
2 .. International License. http://creativecommons.org/licenses/by/4.0
3 .. Copyright (C) 2019 IBM.
4
5 .. _cds_cba-doc:
6
7 Controller Blueprint Archived Designer Tool (CBA)
8 =================================================
9 .. toctree::
10    :maxdepth: 1
11
12 Introduction
13 ------------
14 The **C**\ ontroller **B**\ lueprint **A**\ rchive is the overall service design, fully model-driven, intent based
15 **package** needed for SELF SERVICE provisioning and configuration management automation.
16
17 The CBA is **.zip** file, comprised of the following folder structure, the files may vary:
18
19 .. code-block language is required for ReadTheDocs to render code-blocks. Python set as default.
20
21 .. code-block:: python
22
23     ├── Definitions
24     │   ├── blueprint.json                          Overall TOSCA service template (workflow + node_template)
25     │   ├── artifact_types.json                     (generated by enrichment)
26     │   ├── data_types.json                         (generated by enrichment)
27     │   ├── policy_types.json                       (generated by enrichment)
28     │   ├── node_types.json                         (generated by enrichment)
29     │   ├── relationship_types.json                 (generated by enrichment)
30     │   ├── resources_definition_types.json         (generated by enrichment, based on Data Dictionaries)
31     │   └── *-mapping.json                          One per Template
32     │
33     ├── Environments                                Contains *.properties files as required by the service
34     │
35     ├── Plans                                       Contains Directed Graph
36     │
37     ├── Tests                                       Contains uat.yaml file for testing cba actions within a cba package
38     │
39     ├── Scripts                                     Contains scripts
40     │   ├── python                                  Python scripts
41     │   └── kotlin                                  Kotlin scripts
42     │
43     ├── TOSCA-Metadata
44     │   └── TOSCA.meta                              Meta-data of overall package
45     │
46     └── Templates                                   Contains combination of mapping and template
47
48 To process a CBA for any service we need to enrich it first. This will gather all the node- type, data-type,
49 artifact-type, data-dictionary definitions provided in the blueprint.json.
50
51
52 Architecture
53 ------------
54 |image1|
55
56 Data Flow
57 ---------
58 |image2|
59
60
61 Installation
62 ------------
63
64 Building client html and js files
65 .................................
66
67    * FROM alpine:3.8 as builder
68    * RUN apk add --no-cache npm
69    * WORKDIR /opt/cds-ui/client/
70    * COPY client/package.json /opt/cds-ui/client/
71    * RUN npm install
72    * COPY client /opt/cds-ui/client/
73    * RUN npm run build
74
75 Building and creating server
76 ............................
77
78    * FROM alpine:3.8
79    * WORKDIR /opt/cds-ui/
80    * RUN apk add --no-cache npm
81    * COPY server/package.json /opt/cds-ui/
82    * RUN npm install
83    * COPY server /opt/cds-ui/
84    * COPY --from=builder /opt/cds-ui/server/public /opt/cds-ui/public
85    * RUN npm run build
86    * EXPOSE 3000
87    * CMD [ "npm", "start" ]
88
89 Development
90 -----------
91
92 Pre-requiste
93 ............
94    * Visual Studio code editor
95    * Git bash
96    * Node.js & npm
97    * loopback 4 cl
98
99 Steps
100 .....
101    To compile CDS code:
102
103    1. Make sure your local Maven settings file ($HOME/.m2/settings.xml)
104       contains references to the ONAP repositories and OpenDaylight
105       repositories.
106    2. git clone https://(LFID)@gerrit.onap.org/r/a/ccsdk/cds
107    3. cd cds ; mvn clean install ; cd ..
108    4. Open the cds-ui/client code for development
109
110 Functional Decomposition
111 ------------------------
112 |image3|
113
114 .. |image1| image:: media/CDS_Architecture.jpg
115    :width: 500pt
116
117 .. |image2| image:: media/CDS_Data_Flow.jpg
118    :width: 500pt
119
120 .. |image3| image:: media/Functional_Decomposition.jpg
121    :width: 500pt
122