aboutsummaryrefslogtreecommitdiffstats
path: root/open-o/openo_docker.sh
blob: 7cd6eb6af4d7da42d8a12f03d2a9fd3ef48252d0 (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
#!/bin/bash -ex
##############################################################################
# Copyright (c) 2016-2017 HUAWEI TECHNOLOGIES CO.,LTD and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
function docker_pull()
{
    until docker pull openoint/common-services-auth:$OPENO_VERSION
    do
        echo "Try again"
    done
    until docker pull openoint/common-services-drivermanager:$OPENO_VERSION
    do
        echo "Try again"
    done
    until docker pull openoint/common-services-extsys:$OPENO_VERSION
    do
        echo "Try again"
    done
    until docker pull openoint/common-services-msb:$OPENO_VERSION
    do
        echo "Try again"
    done
    until docker pull openoint/common-services-protocolstack:$OPENO_VERSION
    do
        echo "Try again"
    done
    until docker pull openoint/common-services-wso2ext:$OPENO_VERSION
    do
        echo "Try again"
    done
    until docker pull openoint/common-tosca-catalog:$OPENO_VERSION
    do
        echo "Try again"
    done
    until docker pull openoint/common-tosca-inventory:$OPENO_VERSION
    do
        echo "Try again"
    done
    until docker pull openoint/common-tosca-modeldesigner:$OPENO_VERSION
    do
        echo "Try again"
    done
    until docker pull openoint/gso-service-gateway:$OPENO_VERSION
    do
        echo "Try again"
    done
    until docker pull openoint/gso-service-manager:$OPENO_VERSION
    do
        echo "Try again"
    done
    until docker pull openoint/nfvo-dac:$OPENO_VERSION
    do
        echo "Try again"
    done
    until docker pull openoint/nfvo-driver-sdnc-zte:$OPENO_VERSION
    do
        echo "Try again"
    done
    until docker pull openoint/nfvo-driver-vim:$OPENO_VERSION
    do
        echo "Try again"
    done
    until docker pull openoint/nfvo-driver-vnfm-huawei:$OPENO_VERSION
    do
        echo "Try again"
    done
    until docker pull openoint/nfvo-driver-vnfm-juju
    do
        echo "Try again"
    done
    until docker pull openoint/nfvo-driver-vnfm-zte:$OPENO_VERSION
    do
        echo "Try again"
    done
    until docker pull openoint/nfvo-lcm:$OPENO_VERSION
    do
        echo "Try again"
    done
    until docker pull openoint/nfvo-resmanagement:$OPENO_VERSION
    do
        echo "Try again"
    done
    until docker pull openoint/nfvo-umc:$OPENO_VERSION
    do
        echo "Try again"
    done
    until docker pull openoint/gso-gui-portal:$OPENO_VERSION
    do
        echo "Try again"
    done
    until docker pull openoint/common-tosca-aria:$OPENO_VERSION
    do
        echo "Try again"
    done
    if [[ $ENABLE_SDNO == true ]]; then
        until docker pull openoint/sdno-driver-ct-te:$OPENO_VERSION
        do
            echo "Try again"
        done
        until docker pull openoint/sdno-driver-huawei-l3vpn:$OPENO_VERSION
        do
            echo "Try again"
        done
        until docker pull openoint/sdno-driver-huawei-openstack:$OPENO_VERSION
        do
            echo "Try again"
        done
        until docker pull openoint/sdno-driver-huawei-overlay:$OPENO_VERSION
        do
            echo "Try again"
        done
        until docker pull openoint/sdno-driver-huawei-servicechain:$OPENO_VERSION
        do
            echo "Try again"
        done
        until docker pull openoint/sdno-driver-zte-sptn:$OPENO_VERSION
        do
            echo "Try again"
        done
        until docker pull openoint/sdno-service-brs:$OPENO_VERSION
        do
            echo "Try again"
        done
        until docker pull openoint/sdno-service-ipsec:$OPENO_VERSION
        do
            echo "Try again"
        done
        until docker pull openoint/sdno-service-l2vpn:$OPENO_VERSION
        do
            echo "Try again"
        done
        until docker pull openoint/sdno-service-l3vpn:$OPENO_VERSION
        do
            echo "Try again"
        done
        until docker pull openoint/sdno-service-mss:$OPENO_VERSION
        do
            echo "Try again"
        done
        until docker pull openoint/sdno-service-nslcm:$OPENO_VERSION
        do
            echo "Try again"
        done
        until docker pull openoint/sdno-service-overlayvpn:$OPENO_VERSION
        do
            echo "Try again"
        done
        until docker pull openoint/sdno-service-servicechain:$OPENO_VERSION
        do
            echo "Try again"
        done
        until docker pull openoint/sdno-service-vpc:$OPENO_VERSION
        do
            echo "Try again"
        done
        until docker pull openoint/sdno-service-vxlan:$OPENO_VERSION
        do
            echo "Try again"
        done
        until docker pull openoint/sdno-monitoring:$OPENO_VERSION
        do
            echo "Try again"
        done
        until docker pull openoint/sdno-vsitemgr:$OPENO_VERSION
        do
            echo "Try again"
        done
    fi
}

function docker_run()
{
    OPENO_VERSION=${OPENO_VERSION:-"1.0.0"}
    msb_ip=$OPENO_IP:$COMMON_SERVICES_MSB_PORT

    docker run -d --name common-services-msb -p $OPENO_IP:$COMMON_SERVICES_MSB_PORT:80 openoint/common-services-msb:$OPENO_VERSION
    docker run -d -e MSB_ADDR=$msb_ip --add-host controller:127.0.0.1 --name common-services-auth openoint/common-services-auth:$OPENO_VERSION
    docker run -d -e MSB_ADDR=$msb_ip --name common-services-drivermanager openoint/common-services-drivermanager:$OPENO_VERSION
    docker run -d -e MSB_ADDR=$msb_ip --name common-services-extsys openoint/common-services-extsys:$OPENO_VERSION
    docker run -d -e MSB_ADDR=$msb_ip --name common-services-protocolstack openoint/common-services-protocolstack:$OPENO_VERSION
    docker run -d -e MSB_ADDR=$msb_ip --name common-services-wso2ext openoint/common-services-wso2ext:$OPENO_VERSION
    docker run -d -e MSB_ADDR=$msb_ip --name common-tosca-catalog openoint/common-tosca-catalog:$OPENO_VERSION
    tosca_inventory_id=$(docker run -d -e MSB_ADDR=$msb_ip --name common-tosca-inventory openoint/common-tosca-inventory:$OPENO_VERSION)
    tosca_inventory_ip=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' $tosca_inventory_id)
    docker run -d -e MSB_ADDR=$msb_ip --name common-tosca-modeldesigner openoint/common-tosca-modeldesigner:$OPENO_VERSION
    docker run -d -e MSB_ADDR=$msb_ip --name gso-service-gateway openoint/gso-service-gateway:$OPENO_VERSION
    docker run -d -e MSB_ADDR=$msb_ip -e MYSQL_ADDR=$tosca_inventory_ip:3306 --name gso-service-manager openoint/gso-service-manager:$OPENO_VERSION
    docker run -d -e MSB_ADDR=$msb_ip --name nfvo-dac openoint/nfvo-dac:$OPENO_VERSION
    docker run -d -e MSB_ADDR=$msb_ip --name nfvo-driver-sdnc-zte openoint/nfvo-driver-sdnc-zte:$OPENO_VERSION
    docker run -d -e MSB_ADDR=$msb_ip --name nfvo-driver-vim openoint/nfvo-driver-vim:$OPENO_VERSION
    docker run -d -e MSB_ADDR=$msb_ip --name nfvo-driver-vnfm-huawei openoint/nfvo-driver-vnfm-huawei:$OPENO_VERSION
    docker run -d -e MSB_ADDR=$msb_ip --name nfvo-driver-vnfm-juju -p $OPENO_IP:$NFVO_DRIVER_VNFM_JUJU_PORT:8483 -p $OPENO_IP:$NFVO_DRIVER_VNFM_JUJU_MYSQL_PORT:3306 openoint/nfvo-driver-vnfm-juju
    docker run -d -e MSB_ADDR=$msb_ip --name nfvo-driver-vnfm-zte openoint/nfvo-driver-vnfm-zte:$OPENO_VERSION
    docker run -d -e MSB_ADDR=$msb_ip -e MYSQL_ADDR=$tosca_inventory_ip:3306 --name nfvo-lcm -p $OPENO_IP:8403:8403 openoint/nfvo-lcm:$OPENO_VERSION
    docker run -d -e MSB_ADDR=$msb_ip --name nfvo-resmanagement openoint/nfvo-resmanagement:$OPENO_VERSION
    docker run -d -e MSB_ADDR=$msb_ip --name nfvo-umc openoint/nfvo-umc:$OPENO_VERSION
    docker run -d -e MSB_ADDR=$msb_ip --name common-tosca-aria -p $OPENO_IP:$COMMON_TOSCA_ARIA_PORT:8204 openoint/common-tosca-aria:$OPENO_VERSION
    docker run -d -e MSB_ADDR=$msb_ip --name gso-gui-portal openoint/gso-gui-portal:$OPENO_VERSION

    if [[ $ENABLE_SDNO == true ]]; then
        docker run -d -e MSB_ADDR=$msb_ip --name sdno-driver-huawei-l3vpn openoint/sdno-driver-huawei-l3vpn:$OPENO_VERSION
        docker run -d -e MSB_ADDR=$msb_ip --name sdno-driver-huawei-openstack openoint/sdno-driver-huawei-openstack:$OPENO_VERSION
        docker run -d -e MSB_ADDR=$msb_ip --name sdno-driver-huawei-overlay openoint/sdno-driver-huawei-overlay:$OPENO_VERSION
        docker run -d -e MSB_ADDR=$msb_ip --name sdno-driver-huawei-servicechain openoint/sdno-driver-huawei-servicechain:$OPENO_VERSION
        docker run -d -e MSB_ADDR=$msb_ip --name sdno-driver-zte-sptn openoint/sdno-driver-zte-sptn:$OPENO_VERSION
        docker run -d -e MSB_ADDR=$msb_ip --name sdno-service-brs openoint/sdno-service-brs:$OPENO_VERSION
        docker run -d -e MSB_ADDR=$msb_ip --name sdno-service-ipsec openoint/sdno-service-ipsec:$OPENO_VERSION
        docker run -d -e MSB_ADDR=$msb_ip --name sdno-service-l2vpn openoint/sdno-service-l2vpn:$OPENO_VERSION
        docker run -d -e MSB_ADDR=$msb_ip --name sdno-service-l3vpn openoint/sdno-service-l3vpn:$OPENO_VERSION
        docker run -d -e MSB_ADDR=$msb_ip --name sdno-service-mss openoint/sdno-service-mss:$OPENO_VERSION
        docker run -d -e MSB_ADDR=$msb_ip -e MYSQL_ADDR=$tosca_inventory_ip:3306 --name sdno-service-nslcm openoint/sdno-service-nslcm:$OPENO_VERSION
        docker run -d -e MSB_ADDR=$msb_ip --name sdno-service-overlayvpn openoint/sdno-service-overlayvpn:$OPENO_VERSION
        docker run -d -e MSB_ADDR=$msb_ip --name sdno-service-servicechain openoint/sdno-service-servicechain:$OPENO_VERSION
        docker run -d -e MSB_ADDR=$msb_ip --name sdno-service-vpc openoint/sdno-service-vpc:$OPENO_VERSION
        docker run -d -e MSB_ADDR=$msb_ip --name sdno-service-vxlan openoint/sdno-service-vxlan:$OPENO_VERSION
        docker run -d -e MSB_ADDR=$msb_ip --name sdno-driver-ct-te openoint/sdno-driver-ct-te:$OPENO_VERSION
        docker run -d -e MSB_ADDR=$msb_ip --name sdno-monitoring openoint/sdno-monitoring:$OPENO_VERSION
        docker run -d -e MSB_ADDR=$msb_ip --name sdno-vsitemgr openoint/sdno-vsitemgr:$OPENO_VERSION
    fi
}

function clean() {
    docker ps -a | grep openoint | awk '{print $1}' | xargs docker rm -f || true
}


function launch_openo() {
    log_info "launch_openo enter"

    docker_pull
    clean
    docker_run

    echo -e "\n\033[32mOpen-O launch success\033[0m\n"
}