summaryrefslogtreecommitdiffstats
path: root/kubernetes/dcae/cdap/docker/00-provisioning.sh
blob: 98b67c4476f271b1100472d12a67883098dcd43e (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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
#!/bin/bash
set -x

export DEBIAN_FRONTEND=noninteractive

##############################################################
################### File provisioning ########################
##############################################################

cd /tmp


## Adding configuration file: mount_config
cat > /tmp/dcae-mount.conf << EOF_CONFIG
osType: ubuntu
volumes:
  ephemeral:
    uuid: ephemeral
    size: 80
    filesystems:
      /opt/tools:
        size: 80
        type: ext4
        mount_opts: ''
  data:
    uuid: cinder
    size: 75
    filesystems:
      /opt/data:
        size: 75
        type: ext4
        mount_opts: ''
EOF_CONFIG


## Adding configuration file: ecomp-nexus
cat > /tmp/ecomp-nexus.crt << EOF_CONFIG
-----BEGIN CERTIFICATE-----
MIIFRTCCBC2gAwIBAgIQM/5eM8D0jY3yHTSyN5iO9zANBgkqhkiG9w0BAQsFADCB
kDELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY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ET1JTQURvbWFpblZhbGlkYXRpb25TZWN1cmVTZXJ2ZXJDQS5jcmwwgYUG
CCsGAQUFBwEBBHkwdzBPBggrBgEFBQcwAoZDaHR0cDovL2NydC5jb21vZG9jYS5j
b20vQ09NT0RPUlNBRG9tYWluVmFsaWRhdGlvblNlY3VyZVNlcnZlckNBLmNydDAk
BggrBgEFBQcwAYYYaHR0cDovL29jc3AuY29tb2RvY2EuY29tMB8GA1UdEQQYMBaC
Cioub25hcC5vcmeCCG9uYXAub3JnMA0GCSqGSIb3DQEBCwUAA4IBAQAd5mu22sts
at/bdRlIOz3dbqGwIFOo8XajlAs6ApMpyx/xetcgIKipzvGp9Wc1X8lDZl4boCH6
KQ1//4tpksYj8RsZSZeac8vQLKggWO107sBa33yFg6Y1Dk2DdgOKZ+lNbvB1iMwK
hSGtV3HYx1jLyQRoeYby4R7+kTI1lHAiOgT+vn5C9Z3TxqfgWuBf24CFp/95gki6
vRysJh9Jf7A8JrrMGykC94Tpo6OiUehtQ+f65xtetvwsfNHVp3hsLzR5KwIMDARI
IgXKyROodILsOXfR9qdA9klcXUSi6qvKF8wAopNuot4Ltyz8chiFKISjxqVrKnY2
M7En/HyX0s1I
-----END CERTIFICATE-----
EOF_CONFIG


## Adding configuration file: vm-cdap-cluster-cdap.properties
cat > /tmp/vm-cdap-cluster-cdap.properties << EOF_CONFIG
cluster.endpoint= foobar
cluster.user= foobar
cluster.password= foobar
EOF_CONFIG


## Adding configuration file: vm-cdap-cluster-console.properties
cat > /tmp/vm-cdap-cluster-console.properties << EOF_CONFIG
localhost.endpoint=http://localhost:1999
localhost.user=console
localhost.password=NTJhYWU1NzAwMzc3OTk1
EOF_CONFIG


## Adding configuration file: vm-cdap-cluster-gui.properties
cat > /tmp/vm-cdap-cluster-gui.properties << EOF_CONFIG
EOF_CONFIG


## Adding configuration file: vm-cdap-cluster-log4j.properties
cat > /tmp/vm-cdap-cluster-log4j.properties << EOF_CONFIG
#log4j.debug=0
log4j.rootLogger=warn, file
log4j.logger.org.openecomp.ncomp=info, file
log4j.additivity.org.openecomp.ncomp=false

#log4j.logger.org.apache.http.headers=debug, file
#log4j.logger.org.apache.http.wire=debug, file
## uploaded logger
log4j.logger.org.openecomp.ncomp.sirius.manager.uploaded=info, uploaded
log4j.additivity.org.openecomp.ncomp.sirius.manager.uploaded=false
## request logging
log4j.logger.org.openecomp.ncomp.sirius.manager.ManagementServer.requests=info, requests
log4j.additivity.org.openecomp.ncomp.sirius.manager.ManagementServer.requests=false
## openstack polling
log4j.logger.org.openecomp.ncomp.openstack.OpenStackUtil.polling=info, polling
log4j.additivity.org.openecomp.ncomp.openstack.OpenStackUtil.polling=false
log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File=logs/manager.log
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d %5p [%t] %m %C:%L%n
log4j.appender.file.MaxFileSize=50MB
log4j.appender.file.MaxBackupIndex=5

log4j.appender.uploaded=org.apache.log4j.RollingFileAppender
log4j.appender.uploaded.File=logs/manager-uploaded.log
log4j.appender.uploaded.layout=org.apache.log4j.PatternLayout
log4j.appender.uploaded.layout.ConversionPattern=%d %5p [%t] %m %C:%L%n
log4j.appender.uploaded.MaxFileSize=50MB
log4j.appender.uploaded.MaxBackupIndex=5

log4j.appender.requests=org.apache.log4j.RollingFileAppender
log4j.appender.requests.File=logs/manager-requests.log
log4j.appender.requests.layout=org.apache.log4j.PatternLayout
log4j.appender.requests.layout.ConversionPattern=%d %5p [%t] %m %C:%L%n
log4j.appender.requests.MaxFileSize=50MB
log4j.appender.requests.MaxBackupIndex=5
log4j.appender.polling=org.apache.log4j.RollingFileAppender
log4j.appender.polling.File=logs/manager-polling.log
log4j.appender.polling.layout=org.apache.log4j.PatternLayout
log4j.appender.polling.layout.ConversionPattern=%d %5p [%t] %m %C:%L%n
log4j.appender.polling.MaxFileSize=50MB
log4j.appender.polling.MaxBackupIndex=5

### ECOMP Logging
log4j.logger.org.openecomp.audit=info, audit
log4j.additivity.org.openecomp.audit=false
log4j.logger.org.openecomp.metrics=info, metrics
log4j.additivity.org.openecomp.metrics=false
log4j.logger.org.openecomp.error=info, error
log4j.additivity.org.openecomp.error=false
log4j.logger.com.att.eelf.debug=info, debug
log4j.additivity.org.openecomp.debug=false
log4j.appender.audit=org.apache.log4j.RollingFileAppender
log4j.appender.audit.File=logs/audit.log
log4j.appender.audit.layout=org.apache.log4j.PatternLayout
log4j.appender.audit.layout.ConversionPattern=%d{MM/dd-HH:mm:ss.SSS}|%X{RequestId}|%X{ServiceInstanceId}|%t|%X{ServiceName}|%X{InstanceUUID}|%5p|%X{AlertSeverity}|%X{ServerIPAddress}|%X{ServerFQDN}|%X{RemoteHost}|%X{Timer}|%m%n
log4j.appender.audit.MaxFileSize=50MB
log4j.appender.audit.MaxBackupIndex=5
log4j.appender.metrics=org.apache.log4j.RollingFileAppender
log4j.appender.metrics.File=logs/metrics.log
log4j.appender.metrics.layout=org.apache.log4j.PatternLayout
log4j.appender.metrics.layout.ConversionPattern=%d{MM/dd-HH:mm:ss.SSS}|%X{RequestId}|%X{ServiceInstanceId}|%t|%X{ServiceName}|%X{InstanceUUID}|%p|%X{AlertSeverity}|%X{ServerIPAddress}|%X{ServerFQDN}|%X{RemoteHost}|%X{Timer}|%m%n
log4j.appender.metrics.MaxFileSize=50MB
log4j.appender.metrics.MaxBackupIndex=5
log4j.appender.error=org.apache.log4j.RollingFileAppender
log4j.appender.error.File=logs/error.log
log4j.appender.error.layout=org.apache.log4j.PatternLayout
log4j.appender.error.layout.ConversionPattern=%d{MM/dd-HH:mm:ss.SSS}|%X{RequestId}|%X{ServiceInstanceId}|%t|%X{ServiceName}|%X{InstanceUUID}|%p|%X{AlertSeverity}|%X{ServerIPAddress}|%X{ServerFQDN}|%X{RemoteHost}|%X{Timer}|%m%n
log4j.appender.error.MaxFileSize=50MB
log4j.appender.error.MaxBackupIndex=5
log4j.appender.debug=org.apache.log4j.RollingFileAppender
log4j.appender.debug.File=logs/debug.log
log4j.appender.debug.layout=org.apache.log4j.PatternLayout
log4j.appender.debug.layout.ConversionPattern=%d{MM/dd-HH:mm:ss.SSS}|%X{RequestId}|%X{ServiceInstanceId}|%t|%X{ServiceName}|%X{InstanceUUID}|%p|%X{AlertSeverity}|%X{ServerIPAddress}|%X{ServerFQDN}|%X{RemoteHost}|%X{Timer}|%m%n
log4j.appender.debug.MaxFileSize=50MB
log4j.appender.debug.MaxBackupIndex=5
EOF_CONFIG


## Adding configuration file: vm-cdap-cluster-manager.properties
cat > /tmp/vm-cdap-cluster-manager.properties << EOF_CONFIG
server.dir = data/resources
metrics.dir = data/metrics
properties.dir = data/properties
server.port = 1999
server.user.console = NTJhYWU1NzAwMzc3OTk1
server.user.gui = MDlhZWVjZWEwMmFiOTJi
server.user.client = YmE2OGE1N2U5NzRmMDg1
EOF_CONFIG


## Adding configuration file: vm-cdap-cluster-runtime.properties
cat > /tmp/vm-cdap-cluster-runtime.properties << EOF_CONFIG
factory.vm=org.openecomp.dcae.controller.service.servers.vm.DcaeVmFactory

## Adding configuration file: monitoring-agent-gui.properties
cat > /tmp/monitoring-agent-gui.properties << EOF_CONFIG
EOF_CONFIG


cat > /tmp/certificate.pkcs12.b64code << EOF_CERT
EOF_CERT


##############################################################
################## Config Provisioning #######################
##############################################################

mkdir -p ~/.ssh
touch ~/.ssh/authorized_keys
echo ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDBn8Ctt5hJGkTQaffuSeINeABV4viBIM4TcP14kaLiWR1LkyNY+TaUnjxODobtZa4YW1lxFtoMCfZt2A5W9ZZPM+shZr4BOj+wU+xIrzn7ezN/CQjH7c4Wh0mWteuPnJrtdpyGQ/qBI2T+xo5G/Tl++SPUvvN2D4H8vl0miEgVPR47/P7Ba6kl7Bmrf9m0VDPdS69Qr2AhgBq5Qi/fTeGZA4sfKDHHRJxkQIXYmS8R5FISRpBD7ta2NTHapRz9dC6Cw8UttEFiWFUBjN6lwF9LUOkj9MiqiTQaElKKQzMIHr0AhlgIkwBLKAJoDrGQD9GKPwKCdW3OmnODMPxJjXc3 > ~/.ssh/authorized_keys

cp /tmp/ecomp-nexus.crt /usr/local/share/ca-certificates/ ; update-ca-certificates

wget https://nexus.onap.org/content/repositories/staging/org/openecomp/dcae/controller/dcae-controller-core-utils/1.1.0/dcae-controller-core-utils-1.1.0-runtime.zip -P /opt/app/dcae-controller-core-utils

cd /opt/app/dcae-controller-core-utils
unzip -o dcae-controller-core-utils*.zip

chown -R dcae:dcae /opt/app/dcae-controller-core-utils

/opt/app/dcae-controller-core-utils/bin/fs-init.py

wget https://nexus.onap.org/content/repositories/staging/org/openecomp/dcae/controller/dcae-controller-service-cdap-cluster-manager/1.1.0/dcae-controller-service-cdap-cluster-manager-1.1.0-runtime.zip -P /opt/app/dcae-controller-service-cdap-cluster-manager

cd /opt/app/dcae-controller-service-cdap-cluster-manager
unzip -o dcae-controller-service-cdap-cluster-manager*.zip

chown -R dcae:dcae /opt/app/dcae-controller-service-cdap-cluster-manager

wget https://nexus.onap.org/content/repositories/staging/org/openecomp/dcae/controller/dcae-controller-service-dmaap-drsub/1.1.0/dcae-controller-service-dmaap-drsub-1.1.0.pom -P /opt/app/dcae-controller-service-dmaap-drsub

chown -R dcae:dcae /opt/app/dcae-controller-service-dmaap-drsub

curl -s -k -f -o /tmp/dcae-apod-cdap-small-hadoop_1.1.0.deb https://nexus.onap.org/content/sites/raw/org.openecomp.dcae.apod.cdap/deb-releases/dcae-apod-cdap-small-hadoop_1.1.0.deb

curl -s -k -f -o /tmp/dcae-apod-analytics-tca_1.1.0.deb https://nexus.onap.org/content/sites/raw/org.openecomp.dcae.apod.analytics/deb-releases/dcae-apod-analytics-tca_1.1.0.deb

curl -s -k -f -o /tmp/HelloWorld-3.5.1.jar http://repo1.maven.org/maven2/co/cask/cdap/HelloWorld/3.5.1/HelloWorld-3.5.1.jar
mkdir -p /opt/app/cask-hello-world/lib
mv /tmp/HelloWorld-3.5.1.jar /opt/app/cask-hello-world/lib

find /opt -type f -exec sed -i 's/sudo//g' {} \;

apt-key adv --keyserver-options --keyserver keyserver.ubuntu.com --recv 07513CAD
wget -qO - http://repository.cask.co/ubuntu/precise/amd64/cdap/3.5/pubkey.gpg | apt-key add -

wget https://nexus.onap.org/content/repositories/staging/org/openecomp/dcae/controller/dcae-controller-service-dmaap-drsub-manager/1.1.0/dcae-controller-service-dmaap-drsub-manager-1.1.0-runtime.zip -P /opt/app/dcae-controller-service-dmaap-drsub-manager

cd /opt/app/dcae-controller-service-dmaap-drsub-manager
unzip -o dcae-controller-service-dmaap-drsub-manager-1.1.0-runtime.zip

chown -R dcae:dcae /opt/app/dcae-controller-service-dmaap-drsub-manager

mkdir /home/dcae/.ssh
chmod og-rwx /home/dcae/.ssh
chown -R dcae:dcae /home/dcae/.ssh
touch /home/dcae/.ssh/authorized_keys
chmod og-rwx /home/dcae/.ssh/authorized_keys
chown -R dcae:dcae /home/dcae/.ssh/authorized_keys
echo ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDBn8Ctt5hJGkTQaffuSeINeABV4viBIM4TcP14kaLiWR1LkyNY+TaUnjxODobtZa4YW1lxFtoMCfZt2A5W9ZZPM+shZr4BOj+wU+xIrzn7ezN/CQjH7c4Wh0mWteuPnJrtdpyGQ/qBI2T+xo5G/Tl++SPUvvN2D4H8vl0miEgVPR47/P7Ba6kl7Bmrf9m0VDPdS69Qr2AhgBq5Qi/fTeGZA4sfKDHHRJxkQIXYmS8R5FISRpBD7ta2NTHapRz9dC6Cw8UttEFiWFUBjN6lwF9LUOkj9MiqiTQaElKKQzMIHr0AhlgIkwBLKAJoDrGQD9GKPwKCdW3OmnODMPxJjXc3 >> /home/dcae/.ssh/authorized_keys

#bash /opt/app/dcae-cdap-small-hadoop/install.sh