aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
blob: 562187e344fbfa905dd2b0e042aa1ef6e74a462b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
Repository DCAE Analytics Framework Platform
---------------------------------------------

Maven GroupId:
--------------
com.att.ecomp.dcae.analytics

Maven Parent ArtifactId:
----------------
dcae-analytics

Maven Children Artifacts:
------------------------
1. dcae-analytics-test: Common test code for all DCAE Analytics Modules
2. dcae-analytics-model: Contains models (e.g. Common Event Format) which are common to DCAE Analytics
3. dcae-analytics-common: Contains Components common to all DCAE Analytics Modules - contains high level abstractions
4. dcae-analytics-dmaap: DMaaP(Data Movement as a Platform) MR (Message Router)API using AAF(Authentication and Authorization Framework)
5. dcae-analytics-tca: DCAE Analytics TCA (THRESHOLD CROSSING ALERT) Core
6. dcae-analytics-cdap-common: Common code for all cdap modules
7. dcae-analytics-cdap-tca: CDAP Flowlet implementation for TCA
8. dcae-analytics-cdap-plugins: CDAP Plugins
9. dcae-analytics-cdap-it: Cucumber and CDAP Pipeline integration tests

Deployment in Wind River Lab:
-----------------------------
# create namespace
curl -X PUT http://<cdapMasterHost>:11015/v3/namespaces/cdap_tca_hi_lo

# load artifact
curl -X POST --data-binary @/c/usr/tmp/dcae-analytics-cdap-tca-2.0.0-SNAPSHOT.jar http://<cdapMasterHost>:11015/v3/namespaces/cdap_tca_hi_lo/artifacts/dcae-analytics-cdap-tca

# create app
curl -X PUT -d @/c/usr/docs/ONAP/tca_app_config.json http://<cdapMasterHost>:11015/v3/namespaces/cdap_tca_hi_lo/apps/dcae-tca

# load preferences
curl -X PUT -d @/c/usr/docs/ONAP/tca_app_preferences.json http://<cdapMasterHost>:11015/v3/namespaces/cdap_tca_hi_lo/apps/dcae-tca/preferences

# start program
curl -X POST http://<cdapMasterHost>:11015/v3/namespaces/cdap_tca_hi_lo/apps/dcae-tca/workers/TCADMaaPMRPublisherWorker/start
curl -X POST http://<cdapMasterHost>:11015/v3/namespaces/cdap_tca_hi_lo/apps/dcae-tca/workers/TCADMaaPMRSubscriberWorker/start
curl -X POST http://<cdapMasterHost>:11015/v3/namespaces/cdap_tca_hi_lo/apps/dcae-tca/flows/TCAVESCollectorFlow/start

# check status
curl http://<cdapMasterHost>:11015/v3/namespaces/cdap_tca_hi_lo/apps/dcae-tca/workers/TCADMaaPMRPublisherWorker/status
curl http://<cdapMasterHost>:11015/v3/namespaces/cdap_tca_hi_lo/apps/dcae-tca/workers/TCADMaaPMRSubscriberWorker/status
curl http://<cdapMasterHost>:11015/v3/namespaces/cdap_tca_hi_lo/apps/dcae-tca/flows/TCAVESCollectorFlow/status

# Delete namespace (and all its content)
# curl -X DELETE http://<cdapMasterHost>:11015/v3/unrecoverable/namespaces/cdap_tca_hi_lo

# Delete artifact
# curl -X DELETE http://<cdapMasterHost>:11015/v3/namespaces/cdap_tca_hi_lo/artifacts/dcae-analytics-cdap-tca/versions/2.0.0.SNAPSHOT
String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
{{/*
# Copyright © 2020 Samsung Electronics
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#       http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
*/}}


{{/*
  For internal use only!

  Return true value if robot via ingress test is enabled

  The template takes two arguments:
     - .parent: environment (.)
     - .key: robot test component name
*/}}

{{- define "robot.ingress.svchost._isen" -}}
  {{- $key := .key -}}
  {{- $master := .parent.Values.config.useIngressHost -}}
  {{- if hasKey $master "enabled" -}}
    {{- if (index $master "enabled") -}}
      {{- if hasKey $master $key -}}
        {{- $en_parent := (index $master $key) -}}
        {{- if hasKey $en_parent "enabled" -}}
          {{- default "" (index $en_parent "enabled") -}}
        {{- else -}}
          {{- "" -}}
        {{- end -}}
      {{- else -}}
        {{- "" -}}
      {{- end -}}
  {{- else -}}
    {{- "" -}}
  {{- end -}}
 {{- else -}}
   {{- "" -}}
 {{- end -}}
{{- end -}}

{{/*
  For internal use only!

  Return ingress alternative hotname if present

  The template takes two arguments:
     - .parent: environment (.)
     - .key: robot test component name
*/}}

{{- define "robot.ingress.svchost._inghost" -}}
  {{- $key := .key -}}
  {{- $master := .parent.Values.config.useIngressHost -}}
  {{- if hasKey $master $key -}}
    {{- $h_parent := (index $master $key) -}}
    {{- if hasKey $h_parent "hostname" -}}
      {{- default "" (index $h_parent "hostname") -}}
    {{- else -}}
      {{- "" -}}
    {{- end -}}
  {{- else -}}
    {{- "" -}}
  {{- end -}}
{{- end -}}

{{/*
  For internal use only!

  Return robot target port depending on the robot test configuration
  or default value if config is not available

  The template takes two arguments:
     - .parent: environment (.)
     - .key: robot test component name
*/}}
{{- define "robot.ingress.svchost._port" -}}
  {{- $key := .key -}}
  {{- $master := .parent.Values.config.useIngressHost -}}
  {{- if hasKey $master $key -}}
    {{- $https_parent := (index $master $key) -}}
    {{- if hasKey $https_parent "https" -}}
      {{- $ishttps := (index $https_parent "https") -}}
      {{- ternary 443 80 $ishttps -}}
    {{- else -}}
      {{- 80 -}}
    {{- end -}}
  {{- else -}}
    {{- 80 -}}
  {{- end -}}
{{- end -}}

{{/*
  Return the hostname for tested compoment by robot
  if the ingress is enabled it return cluster ingress
  controller hostname. If the ingress controller in robot
  test is disabled it returns the internal cluster hostname

  The template takes two arguments:
     - .root: root environment (.)
     - .hostname: basename of host

  Return string target hostname for robot test on particular component
*/}}
{{- define "robot.ingress.svchost" -}}
  {{- $hostname := required "service hostname" .hostname -}}
  {{- $tplhname := $hostname | replace "-" "_" -}}
  {{- $ingress_enabled := include "robot.ingress.svchost._isen" (dict "parent" .root "key" $tplhname) -}}
  {{- if $ingress_enabled -}}
    {{- if .root.Values.global.ingress -}}
    {{- if .root.Values.global.ingress.virtualhost -}}
      {{- $domain := .root.Values.global.ingress.virtualhost.baseurl -}}
      {{- $ihostname := default $hostname (include "robot.ingress.svchost._inghost" (dict "parent" .root "key" $tplhname)) -}}
      {{- printf "%s.%s" $ihostname $domain -}}
    {{- end -}}
    {{- end -}}
  {{- else -}}
    {{- $domain := include "common.namespace" .root -}}
    {{- printf "%s.%s" $hostname $domain -}}
  {{- end -}}
{{- end -}}


{{/*
  Return the target port for the robot testing purpose
  if the ingress is enabled it return cluster ingress
  controller port. If the target port doesn't exists
  it return default port

  The template takes three arguments:
     - .root: root environment (.)
     - .hostname: basename of host
     - .port Default target port

  Return target port for tested components
*/}}
{{- define "robot.ingress.port" -}}
  {{- $hostname := required "service hostname" .hostname -}}
  {{- $port := required "service port" .port -}}
  {{- $tplhname := $hostname | replace "-" "_" -}}
  {{- $ingress_enabled := include "robot.ingress.svchost._isen" (dict "parent" .root "key" $tplhname) -}}
  {{- if $ingress_enabled -}}
    {{- include "robot.ingress.svchost._port" (dict "parent" .root "key" $tplhname) -}}
  {{- else -}}
    {{- printf "%d" $port -}}
  {{- end -}}
{{- end -}}