-
Notifications
You must be signed in to change notification settings - Fork 29
/
start_deploy.sh.sample
174 lines (134 loc) · 5.19 KB
/
start_deploy.sh.sample
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
#!/bin/bash
#
# Copyright (c) 2009-2020. Authors: see NOTICE file.
#
# 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.
#
docker create --name memcached \
--restart=unless-stopped \
cytomine/memcached:v1.2.0 > /dev/null
docker cp $PWD/configs/memcached/memcached.conf memcached:/etc/memcached.conf
docker start memcached
docker create --name rabbitmq \
-p 5672:5672 -p 15672:15672 \
-e RABBITMQ_PASS=$RABBITMQ_PASS \
--restart=unless-stopped \
cytomine/rabbitmq:v1.2.0 > /dev/null
docker start rabbitmq
docker volume create --name postgis_data > /dev/null
# create database docker
docker run -d -m 8g --name postgresql -v postgis_data:/var/lib/postgresql \
--restart=unless-stopped \
cytomine/postgis:v2.1.0 > /dev/null
docker volume create --name mongodb_data > /dev/null
# create mongodb docker
docker run -d --name mongodb -v mongodb_data:/data/db \
--restart=unless-stopped \
cytomine/mongodb:v1.1.2 > /dev/null
if [ ! -e $PWD/configs/software_router/keys/ssh_key ]
then
echo "ssh keys for software_router must exists !"
echo "generate them and put them in the $PWD/configs/software_router/keys folder "
exit 1
fi
docker volume create --name slurm_data > /dev/null
# create slurm docker
docker create --name slurm \
--privileged \
-h cytomine-slurm \
-v slurm_data:/var/lib/mysql \
-v singularity_images:/data/softwares/images \
-v /etc/localtime:/etc/localtime \
--restart=unless-stopped \
cytomine/slurm:v1.2.0 > /dev/null
docker cp $PWD/configs/software_router/keys/ssh_key.pub slurm:/home/cytomine/.ssh/authorized_keys
docker cp $PWD/hosts/slurm/addHosts.sh slurm:/tmp/addHosts.sh
docker start slurm
docker exec -it slurm chown cytomine:cytomine /home/cytomine/.ssh/authorized_keys
docker exec -it slurm chmod 600 /home/cytomine/.ssh/authorized_keys
docker create --name iipOff \
--link memcached:memcached \
-v $IMS_STORAGE_PATH:$IMS_STORAGE_PATH \
--privileged -e NB_IIP_PROCESS=$NB_IIP_PROCESS \
--restart=unless-stopped \
cytomine/iipofficial:v1.3.0 > /dev/null
docker cp $PWD/configs/iipOff/nginx.conf.sample iipOff:/tmp/nginx.conf.sample
docker start iipOff
docker create --name iipCyto \
--link memcached:memcached \
-v $IMS_STORAGE_PATH:$IMS_STORAGE_PATH \
--privileged -e NB_IIP_PROCESS=$NB_IIP_PROCESS \
--restart=unless-stopped \
cytomine/iipcyto:v1.2.3 > /dev/null
docker cp $PWD/configs/iipCyto/nginx.conf.sample iipCyto:/tmp/nginx.conf.sample
docker start iipCyto
docker create --name bioformat \
-v $IMS_STORAGE_PATH:$IMS_STORAGE_PATH \
-e BIOFORMAT_PORT=$BIOFORMAT_PORT \
--restart=unless-stopped \
cytomine/bioformat:v1.2.0 > /dev/null
docker start bioformat
docker create --name ims \
--link bioformat:bioformat \
-e IMS_STORAGE_PATH=$IMS_STORAGE_PATH \
-v $IMS_STORAGE_PATH:$IMS_STORAGE_PATH \
-v $IMS_BUFFER_PATH:/tmp/uploaded \
--restart=unless-stopped \
cytomine/ims:v2.0.0 > /dev/null
docker cp $PWD/configs/ims/ims-config.groovy ims:/usr/share/tomcat9/.grails/ims-config.groovy
docker cp $PWD/hosts/ims/addHosts.sh ims:/tmp/addHosts.sh
docker start ims
docker create --name core \
--link postgresql:postgresql \
--link mongodb:mongodb \
--link rabbitmq:rabbitmq \
-v /etc/localtime:/etc/localtime \
-v $UPLOADED_SOFTWARES_PATH:/data/softwares/code \
--restart=unless-stopped \
cytomine/core:v3.2.3 > /dev/null
docker cp $PWD/configs/core/cytomineconfig.groovy core:/usr/share/tomcat9/.grails/cytomineconfig.groovy
docker cp $PWD/hosts/core/addHosts.sh core:/tmp/addHosts.sh
docker cp $PWD/configs/core/server.xml core:/usr/local/tomcat/conf/server.xml
docker start core
docker create --name web_UI \
-v /etc/localtime:/etc/localtime \
--restart=unless-stopped \
cytomine/web_ui:v1.4.0 > /dev/null
docker cp "${PWD}/configs/web_ui/configuration.json" web_UI:/app/configuration.json
docker cp "${PWD}/configs/web_ui/nginx.conf" web_UI:/etc/nginx/nginx.conf
docker start web_UI
docker create --name nginx \
--link ims:ims \
--link iipCyto:iipCyto \
--link core:core \
--link iipOff:iipOff \
--link web_UI:web_UI \
-v $IMS_BUFFER_PATH:/tmp/uploaded \
-p 80:80 \
--restart=unless-stopped \
cytomine/nginx:v1.4.0 > /dev/null
docker cp $PWD/configs/nginx/nginx.conf nginx:/usr/local/nginx/conf/nginx.conf
docker start nginx
docker create --name software_router \
-v singularity_images:/data/softwares/images \
-v /var/run/docker.sock:/var/run/docker.sock \
--privileged \
--link rabbitmq:rabbitmq \
--link slurm:slurm \
--restart=unless-stopped \
cytomine/software_router:v2.1.1 > /dev/null
docker cp $PWD/hosts/software_router/addHosts.sh software_router:/tmp/addHosts.sh
docker cp $PWD/configs/software_router/config.groovy software_router:/software_router/config.groovy
docker cp $PWD/configs/software_router/keys/ssh_key software_router:/root/.ssh/id_rsa
docker start software_router
docker exec -it software_router chmod 600 /root/.ssh/id_rsa