Repository navigation
Expand file tree
/
Copy pathinstall_bootstrap
More file actions
462 lines (391 loc) · 23.6 KB
/
Copy pathinstall_bootstrap
File metadata and controls
462 lines (391 loc) · 23.6 KB
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
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
#! /bin/bash
# Created by Solomon Shorser
# Hacked by Denis Yuen
# Hacked by Brian O'Connor <briandoconnor@gmail.com>
set -e
# When changing these versions, you will probably need to delete all files in the working directory
# except for the consonance_launcher_config directory in order to get a clean new copy of
# the Docker compose templates
# version of consonance code used for this script
CONSONANCE_LAUNCHER_VERSION=feature/dockstore_1_2
# version of consonance jar files used
CONSONANCE_BINARY_VERSION=2.0.0-alpha.15
# version of container host bag (an ansible script) used to setup workers
CONSONANCE_HOST_BAG_VERSION=2.0.0-alpha.2
# version of Dockstore CLI installed in client container
CONSONANCE_DOCKSTORE_VERSION=1.1.5
cat <<MSG
CONSONANCE INSTALLATION BOOTSTRAPPER
-----------------------------------------------------------------------------
This tool will setup a "launcher" host which has all of the infrastructure we
use to run Consonance. This launcher host can then launch one or more worker
VMs to run generic tools and workflows from Dockstore (http://dockstore.org).
This system requires the following:
* Docker support in your Linux distribution (Ubuntu 16.04 is officially supported by the Consonance Launcher).
* AWS credentials, if you are using Amazon AWS.
Note: this system currently is configured per cloud, per worker type. A single
launcher supporting multiple clouds and multiple worker types is not supported.
You can, however, run multiple launchers to achieve the dersired result.
Note: by default we detect the IP address of the host using AWS instance metadata.
This has not been tested with alternative clouds but AWS instance metadata should be available
in OpenStack https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html
For more information see:
* the main GitHub page: https://github.com/Consonance/consonance
* the project wiki: https://github.com/Consonance/consonance/wiki
* the Bootstrapper docs: https://github.com/Consonance/consonance/tree/develop/container-admin
MSG
# Ask the user a question and save the answer.
# They MUST give an answer, they cannot leave their answer blank. In the future, that could be parameterized...
# $1 - the question string
# $2 - the previous value
# $3 - the name of the value
# $4 - reference to the user's answer.
function ask_question()
{
question_str=$1
prev_val=$2
val_name=$3
answer=''
while [[ -z ${answer// /} ]] ; do
if [[ -n $prev_val ]] ; then
read -ep "${question_str} Previous value: "$'\n' -i "$prev_val" answer
else
read -ep "$question_str"$'\n' answer
fi
if [[ -z ${answer// /} ]] ; then
echo "$val_name name cannot be blank."
fi
done
# Set the user's value in the reference. See here: http://stackoverflow.com/a/14852461/192801 to get an idea of how this works.
eval "${!4}=\"$answer\""
}
user_consonance_version=latest
#FYI: The weird "^^" is to make the user input into uppercase so that if they enter "y" the installer will still run.
install_consonance_launcher=''
while [[ "${install_consonance_launcher^^}" != 'Y' && "${install_consonance_launcher^^}" != 'N' ]] ; do
echo "DO YOU WISH TO CONTINUE [Y/N]:"
read install_consonance_launcher
if [ "${install_consonance_launcher^^}" = 'Y' ] ; then
user_install_docker=''
set +e
DOCKER_PATH="$(which docker)"
set -e
if [ -z "$DOCKER_PATH" ] ; then
user_install_docker='Y'
else
while [[ "${user_install_docker^^}" != 'Y' && "${user_install_docker^^}" != 'N' ]] ; do
echo "It looks like docker may already be installed. Would you like to run this step anyway, which may attempt to upgrade docker? [Y/N]"
read user_install_docker
done
fi
echo "Installing various apt packages"
# need to install regardless
set +e
sudo apt-get install wget curl ruby-mustache=1.0.2-1 jq git --yes &> install_wget_curl.log
install_wget_result=$?
set -e
if [ $install_wget_result -ne 0 ] ; then
echo "It looks like there may have been a problem installing or updated wget and curl:"
cat install_wget_curl.log
exit 1
fi
if [ "${user_install_docker^^}" = 'Y' ] ; then
# Remove eXecute permission from /etc/grub.d/30_os-prober because sometimes the docker installer will hang when this hangs. This has happened in OpenStack
# and could happen elsewhere.
if [ -f /etc/grub.d/30_os-prober ] ; then
sudo chmod a-x /etc/grub.d/30_os-prober
fi
echo "Installing docker..."
set +e
curl -sSL https://get.docker.com/ | sh &> install_docker.log
install_docker_result=$?
set -e
if [ $install_docker_result -ne 0 ] ; then
echo "It looks like there may have been a problem installing docker:"
cat install_wget_curl.log
exit 1
fi
set +e
sudo wget https://github.com/docker/compose/releases/download/1.8.1/run.sh -O /usr/local/bin/docker-compose && sudo chmod +x /usr/local/bin/docker-compose &> install_compose.log
install_compose_result=$?
set -e
if [ $install_compose_result -ne 0 ] ; then
echo "It looks like there may have been a problem installing docker compose:"
cat install_compose.log
exit 1
fi
echo "Done installing docker!"
DOCKER_PATH="$(which docker)"
else
echo "Skipping docker installation..."
fi
if [ -z "$DOCKER_PATH" ] ; then
echo "You need to install docker before pulling docker images. Please ensure that docker is properly installed and then re-run this script with the command \"bash install_bootstrap\""
exit 1
fi
elif [ "${install_consonance_launcher^^}" = 'N' ] ; then
echo "You are exiting the installer now, but you can always run it again when you are ready."
exit 0
fi
done
run_consonance_launcher=''
while [[ "${run_consonance_launcher^^}" != 'Y' && "${run_consonance_launcher^^}" != 'N' ]] ; do
echo "Would you like to run the consonance_launcher now? [Y/N]"
read run_consonance_launcher
# If the user would like to run consonance_launcher, then we have to get some config settings from them OR read them from an existing file
if [ "${run_consonance_launcher^^}" = 'Y' ] ; then
#Read the config file if it exists and then show previous values (but do not override variables in this script)
if [ -f consonance_launcher_config/compose.config ] ; then
source <(jq -r "to_entries|map(\"\(.key)=\(.value|tostring)\")|.[]" consonance_launcher_config/compose.config | grep -v "CONSONANCE")
fi
user_cloud_env='AWS'
# OpenStack support seems to be broken as of 2017 and OpenStack Mitaka
# while [[ -z "${user_cloud_env// /}" ]] ; do
# if [ ! -z $CLOUD_ENV ] ; then
# read -ep $'What cloud environment are you working in? Allowed values are "AWS", "OpenStack", "Azure". Previous value: \n' -i "$CLOUD_ENV" user_cloud_env
# else
# read -ep $'What cloud environment are you working in? Allowed values are "AWS", "OpenStack", "Azure". \n' user_cloud_env
# fi
# if [[ -z "${user_cloud_env// /}" || ( ${user_cloud_env} != 'AWS' && ${user_cloud_env} != 'OpenStack' && ${user_cloud_env} != 'Azure' ) ]] ; then
# echo 'Cloud environment must be one of: "AWS", "OpenStack", "Azure".'
# user_cloud_env=''
# fi
# done
user_pem_path=''
while [[ ! -f $user_pem_path || ! -e $user_pem_path || -z "${user_pem_path// /}" ]] ; do
if [ ! -z $PEM_PATH ] ; then
read -ep $'What is the path to the pem key file you will use to authenticate in this environment? Previous value: \n' -i "$PEM_PATH" user_pem_path
user_pem_path="${user_pem_path/#\~/$HOME}"
else
read -ep $'What is the path to the pem key file you will use to authenticate in this environment?\n' user_pem_path
user_pem_path="${user_pem_path/#\~/$HOME}"
fi
if [[ ! -f $user_pem_path || ! -e $user_pem_path ]] ; then
echo "The path you pass for the key file must be valid. Please ensure that \"$user_pem_path\" is a valid path."
fi
done
user_key_name='user_key_name'
ask_question "What is the name of this key?" "$KEY_NAME" "Key name" $user_key_name
if [ $user_cloud_env == 'AWS' ] ; then
############################
# AWS questions
############################
user_aws_key='user_aws_key'
ask_question "What is your AWS Key?" "$AWS_ACCESS_KEY_ID" "AWS Key name" $user_aws_key
user_aws_secret_key='user_aws_secret_key'
ask_question "What is your AWS Secret Key?" "$AWS_SECRET_ACCESS_KEY" "AWS Secret Key name" $user_aws_secret_key
user_sec_grp='user_sec_grp'
ask_question "What is your Security Group?" "$SECURITY_GROUP" "Security Group" $user_sec_grp
aws_max_spot_price='aws_max_spot_price'
ask_question "What is your AWS max spot price?" "$AWS_MAX_SPOT_PRICE" "Max spot price" $aws_max_spot_price
aws_region='aws_region'
ask_question "What is your AWS region (e.g. us-east-1 for Virginia)?" "$AWS_REGION" "AWS region" $aws_region
aws_zone='aws_zone'
ask_question "What is your AWS zone within the selected region (e.g. us-east-1c for the us-east-1 region)?" "$AWS_ZONE" "AWS zone" $aws_zone
aws_instance_type='aws_instance_type'
ask_question "What is your default AWS instance type (e.g. c4.2xlarge)?" "$AWS_INSTANCE_TYPE" "AWS instance type" $aws_instance_type
aws_ami_image='aws_ami_image'
ask_question "What is your AWS image (e.g. AMI such as ami-6edd3078 for Ubuntu, we recommend the Ubuntu 16.04 base image that is appropriate for the instance type you just selected)?" "$AWS_AMI_IMAGE" "AWS AMI image" $aws_ami_image
elif [ $user_cloud_env == 'Azure' ] ; then
############################
# AZURE QUESTIONS
############################
user_azure_subscription_id='user_azure_subscription_id'
ask_question "What is your Azure subscription?" "$AZURE_SUBSCRIPTION" "Azure subscription" $user_azure_subscription_id
user_azure_storage_account_name='user_azure_storage_account_name'
ask_question "What is your Azure storage account name?" "$AZURE_STORAGE_ACCOUNT" "Azure storage account name" $user_azure_storage_account_name
user_azure_storage_account_key='user_azure_storage_account_key'
ask_question "What is your Azure storage account key?" "$AZURE_STORAGE_ACCOUNT_KEY" "Azure storage account key" $user_azure_storage_account_key
user_azure_AD_user='user_azure_AD_user'
ask_question "What is your Azure Active Directory user name?" "$AZURE_AD_USER" "Azure Active Directory user name" $user_azure_AD_user
user_azure_AD_passwd='user_azure_AD_passwd'
ask_question "What is your Azure Active Directory password?" "$AZURE_AD_PASSWD" "Azure Active Directory user name" $user_azure_AD_passwd
user_azure_AD_tenant='user_azure_AD_tenant'
ask_question "What is your Azure Active Directory tenant?" "$AZURE_AD_TENANT" "Azure Active Directory tenant" $user_azure_AD_tenant
user_azure_AD_client='user_azure_AD_client'
ask_question "What is your Azure Active Directory client?" "$AZURE_AD_CLIENT" "Azure Active Directory client" $user_azure_AD_client
user_azure_virtual_network='user_azure_virtual_network'
ask_question "What is the name of the Virtual Network for this fleet?" "$AZURE_VIRTUAL_NETWORK" "Azure Virtual Network Name" $user_azure_virtual_network
user_azure_location='user_azure_location'
ask_question "What Location do you want to use for this fleet?" "$AZURE_LOCATION" "Location" $user_azure_location
# TODO: Get public and private Azure IP addresses, or ask the user to provide them since it seems rather difficult to get them from the Azure API directly.
elif [ $user_cloud_env == 'OpenStack' ] ; then
############################
# OpenStack questions
############################
user_os_username='user_os_username'
ask_question "What is your OpenStack username (formatted as <tenant>:<username>)?" "$OS_USERNAME" "OpenStack username" $user_os_username
user_os_password='user_os_password'
ask_question "What is your OpenStack password?" "$OS_PASSWORD" "OpenStack password" $user_os_password
user_os_endpoint='user_os_endpoint'
ask_question "What is your OpenStack endpoint?" "$OS_ENDPOINT" "OpenStack endpoint" $user_os_endpoint
user_os_region='user_os_region'
ask_question "What is your OpenStack region?" "$OS_REGION" "OpenStack region" $user_os_region
user_sec_grp='user_sec_grp'
ask_question "What is your Security Group?" "$SECURITY_GROUP" "Security Group" $user_sec_grp
user_os_network_id='user_os_network_id'
ask_question "What is your OpenStack network ID?" "$OS_NETWORK_ID" "Network ID" $user_os_network_id
user_os_zone=''
if [ ! -z $OS_ZONE ] ; then
read -ep $'What is your OpenStack zone? Previous value: \n' -i $OS_REGION user_os_zone
else
read -ep $'What is your OpenStack zone?\n' user_os_zone
fi
else
# Just in case some other value somehow gets in to $user_cloud_env
echo "Unrecognized cloud environment: $user_cloud_env, exiting..."
exit 1
fi
# echo "What version of the consonance_launcher do you wish to run (default will be \"latest\")?"
# read user_consonance_version
# They already pulled "latest", earlier in this script, so just stick with that. Future versions could ask this question, if necessary...
user_consonance_version="latest"
user_fleet_name=''
if [ $user_cloud_env == 'Azure' ] ; then
# In Azure, the fleet name also gets used for the storage account name which may only contain lowercase letters, numbers, and dashes.
if [ ! -z "$FLEET_NAME" ] ; then
read -ep $'What would you like to name your fleet? Azure fleet names may only contain lowercase letter, numbers, and dashes. If you do not specify a name, a name will be generated randomly for you. Previous value: \n' -i "$FLEET_NAME" user_fleet_name
else
read -ep $'What would you like to name your fleet? Azure fleet names may only contain lowercase letter, numbers, and dashes. If you do not specify a name, a name will be generated randomly for you.\n' user_fleet_name
fi
user_fleet_name=${user_fleet_name,,}
user_fleet_name=${user_fleet_name//[^[:alnum:]]/}
# If the user didn't specify a fleet name we need to do it HERE because the start_launcher_container.sh script may generate fleet names
# that are not Azure-friendly.
if [ -z $user_fleet_name ] ; then
user_fleet_name=$(cat /dev/urandom | tr -dc 'a-z0-9-' | fold -w 10 | head -n 1)
fi
echo "Your Azure fleet name: $user_fleet_name"
else
if [ ! -z "$FLEET_NAME" ] ; then
read -ep $'What would you like to name your fleet? If you do not specify a name, a name will be generated randomly for you. Previous value: \n' -i "$FLEET_NAME" user_fleet_name
else
read -ep $'What would you like to name your fleet? If you do not specify a name, a name will be generated randomly for you.\n' user_fleet_name
fi
fi
# Build a flag for fleet names to get passed to the next script...
FLEET_NAME_STR=''
if [ ! -z "$user_fleet_name" ] ; then
# remove quotes from the fleet names, could have come from quoted previous fleet name in config
user_fleet_name=${user_fleet_name//\"/}
# replace space with underscore so we can pass to the next script without having to surround in quotes because that
# causes problems for other systems.
user_fleet_name=${user_fleet_name// /_}
FLEET_NAME_STR=" -f $user_fleet_name "
fi
user_fleet_size='user_fleet_size'
# Loop until the user gives a valid integer.
while [[ -n ${user_fleet_size//[0-9]/} ]] ; do
user_fleet_size='user_fleet_size'
ask_question "What is the maximum number of worker VMs you want to run in your fleet?" "$FLEET_SIZE" "Maximum fleet size" $user_fleet_size
if [[ -n ${user_fleet_size//[0-9]/} ]] ; then
echo "Only positive integers are allowed."
fi
done
user_fleet_batch_size='user_fleet_batch_size'
# Loop until the user gives a valid integer.
while [[ -n ${user_fleet_batch_size//[0-9]/} ]] ; do
user_fleet_batch_size='user_fleet_batch_size'
ask_question "What is the maximum number of worker VMs you want to launch at a time?" "$FLEET_BATCH_SIZE" "Maximum fleet batch size" $user_fleet_batch_size
if [[ -n ${user_fleet_batch_size//[0-9]/} ]] ; then
echo "Only positive integers are allowed."
fi
done
# now wget the start_launcher_container script and call it with the values from above:
#$(wget -q -O start_launcher_container.sh https://github.com/ICGC-TCGA-PanCancer/consonance_launcher/releases/download/$PANCANCER_LAUNCHER_VERSION/start_launcher_container.sh)
# starter_script_url="https://github.com/ICGC-TCGA-PanCancer/consonance_launcher/releases/download/$PANCANCER_LAUNCHER_VERSION/start_launcher_container.sh"
# set +e
# wget -O start_launcher_container.sh $starter_script_url 2>get_start_launcher_container.err
# get_starter_script_result=$?
# set -e
# if [ $get_starter_script_result -ne 0 ] ; then
# echo "There seems to have been a problem downloading the startup script from: $starter_script_url"
# echo "Error is:"
# cat ./get_start_launcher_container.err
# fi
# chmod u+x start_launcher_container.sh
# CMD_STR="bash start_launcher_container.sh -p $user_pem_path -i $user_consonance_version -e ${user_cloud_env^^} $FLEET_NAME_STR"
# Now write a config for this file.
[[ -f consonance_launcher_config/compose.config ]] || mkdir -p consonance_launcher_config
# Note: You can't have ANY blank lines in .consonance/consonance.config because the python library that will eventually process it does not like blank lines and will fail.
# we need to override the ethernet device on some systems
echo "Installing various apt packages"
cat > consonance_launcher_config/compose.config <<CONFIG
{
"LAUNCHER_IP_ADDRESS":"`curl http://169.254.169.254/latest/meta-data/local-ipv4`",
"PUBLIC_LAUNCHER_IP_ADDRESS":"`curl http://169.254.169.254/latest/meta-data/public-ipv4`",
"CONSONANCE_BINARY_VERSION":"${CONSONANCE_BINARY_VERSION}",
"CONSONANCE_HOST_BAG_VERSION":"${CONSONANCE_HOST_BAG_VERSION}",
"CONSONANCE_DOCKSTORE_VERSION":"${CONSONANCE_DOCKSTORE_VERSION}",
"AWS_ACCESS_KEY_ID":"${user_aws_key}",
"AWS_SECRET_ACCESS_KEY":"${user_aws_secret_key}",
"AWS_MAX_SPOT_PRICE":"${aws_max_spot_price}",
"FLEET_BATCH_SIZE":"${user_fleet_batch_size}",
"AWS_REGION":"${aws_region}",
"AWS_ZONE":"${aws_zone}",
"AWS_AMI_IMAGE":"${aws_ami_image}",
"AWS_INSTANCE_TYPE":"${aws_instance_type}",
"PEM_PATH":"${user_pem_path}",
"KEY_NAME":"${user_key_name}",
"FLEET_NAME":"${user_fleet_name}",
"FLEET_SIZE":"${user_fleet_size}",
"WORKFLOW_LISTING_URL":"${workflow_listing_url}",
"CLOUD_ENV":"${user_cloud_env}",
"SECURITY_GROUP":"${user_sec_grp}",
"AZURE_SUBSCRIPTION":"${user_azure_subscription_id}",
"AZURE_STORAGE_ACCOUNT":"${user_azure_storage_account_name}",
"AZURE_STORAGE_ACCOUNT_KEY":"${user_azure_storage_account_key}",
"AZURE_AD_USER":"${user_azure_AD_user}",
"AZURE_AD_PASSWD":"${user_azure_AD_passwd}",
"AZURE_AD_TENANT":"${user_azure_AD_tenant}",
"AZURE_AD_CLIENT":"${user_azure_AD_client}",
"AZURE_VIRTUAL_NETWORK":"${user_azure_virtual_network}",
"AZURE_LOCATION":"${user_azure_location}",
"OS_USERNAME":"${user_os_username}",
"OS_PASSWORD":"${user_os_password}",
"OS_ENDPOINT":"${user_os_endpoint}",
"OS_NETWORK_ID":"${user_os_network_id}",
"OS_REGION":"${user_os_region}",
"OS_ZONE":"${user_os_zone}"
}
CONFIG
[[ -d "consonance_launcher_config" ]] || mkdir "consonance_launcher_config"
# cp ~/.consonance/compose.config consonance_launcher_config/compose.config
# template out stuff, grab template files for convenience if not running in a git repo
# note there should really be a better way of grabbing a directory, see https://github.com/dear-github/dear-github/issues/95
wget --no-clobber https://raw.githubusercontent.com/Consonance/consonance/${CONSONANCE_LAUNCHER_VERSION}/container-admin/Dockerfile_client.template
wget --no-clobber https://raw.githubusercontent.com/Consonance/consonance/${CONSONANCE_LAUNCHER_VERSION}/container-admin/Dockerfile_coordinator.template
wget --no-clobber https://raw.githubusercontent.com/Consonance/consonance/${CONSONANCE_LAUNCHER_VERSION}/container-admin/Dockerfile_provisioner.template
wget --no-clobber https://raw.githubusercontent.com/Consonance/consonance/${CONSONANCE_LAUNCHER_VERSION}/container-admin/Dockerfile_webservice.template
wget --no-clobber https://raw.githubusercontent.com/Consonance/consonance/${CONSONANCE_LAUNCHER_VERSION}/container-admin/aws.config.template
wget --no-clobber https://raw.githubusercontent.com/Consonance/consonance/${CONSONANCE_LAUNCHER_VERSION}/container-admin/bag_params.json.template
wget --no-clobber https://raw.githubusercontent.com/Consonance/consonance/${CONSONANCE_LAUNCHER_VERSION}/container-admin/config.template
wget --no-clobber https://raw.githubusercontent.com/Consonance/consonance/${CONSONANCE_LAUNCHER_VERSION}/container-admin/docker-compose.yml
wget --no-clobber https://raw.githubusercontent.com/Consonance/consonance/${CONSONANCE_LAUNCHER_VERSION}/container-admin/example_tags.json
wget --no-clobber https://raw.githubusercontent.com/Consonance/consonance/${CONSONANCE_LAUNCHER_VERSION}/container-admin/init_client.sh
wget --no-clobber https://raw.githubusercontent.com/Consonance/consonance/${CONSONANCE_LAUNCHER_VERSION}/container-admin/init_coordinator.sh
wget --no-clobber https://raw.githubusercontent.com/Consonance/consonance/${CONSONANCE_LAUNCHER_VERSION}/container-admin/init_provisioner.sh
wget --no-clobber https://raw.githubusercontent.com/Consonance/consonance/${CONSONANCE_LAUNCHER_VERSION}/container-admin/init_webservice.sh
wget --no-clobber https://raw.githubusercontent.com/Consonance/consonance/${CONSONANCE_LAUNCHER_VERSION}/container-admin/key.pem.template
wget --no-clobber https://raw.githubusercontent.com/Consonance/consonance/${CONSONANCE_LAUNCHER_VERSION}/container-admin/ssh.py
wget --no-clobber https://raw.githubusercontent.com/Consonance/consonance/${CONSONANCE_LAUNCHER_VERSION}/container-admin/web.yml.template
wget --no-clobber https://raw.githubusercontent.com/Consonance/consonance/${CONSONANCE_LAUNCHER_VERSION}/container-admin/youxia_config.template
mustache consonance_launcher_config/compose.config Dockerfile_client.template > Dockerfile_client
mustache consonance_launcher_config/compose.config Dockerfile_coordinator.template > Dockerfile_coordinator
mustache consonance_launcher_config/compose.config Dockerfile_provisioner.template > Dockerfile_provisioner
mustache consonance_launcher_config/compose.config Dockerfile_webservice.template > Dockerfile_webservice
mustache consonance_launcher_config/compose.config aws.config.template > aws.config
mustache consonance_launcher_config/compose.config bag_params.json.template > bag_params.json
mustache consonance_launcher_config/compose.config config.template > config
mustache consonance_launcher_config/compose.config youxia_config.template > youxia_config
mustache consonance_launcher_config/compose.config web.yml.template > web.yml
cat ${user_pem_path} > key.pem
sudo docker-compose build
sudo docker-compose run client
elif [ "${run_consonance_launcher^^}" = 'N' ] ; then
echo "You can run this script at another time to run the consonance launcher"
exit 0
fi
done
echo "Exiting now."
set +e