Skip to content

Commit

Permalink
Do not override variables from the script itself
Browse files Browse the repository at this point in the history
  • Loading branch information
denis-yuen committed Mar 29, 2017
1 parent 6644a93 commit 5b6f255
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion container-admin/Dockerfile_provisioner.template
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ ADD init_provisioner.sh .
RUN git clone https://github.com/Consonance/container-host-bag.git /container-host-bag
# we need the branch that is compatible with Ansible 2
#RUN (cd /container-host-bag && git checkout develop_2)
RUN (cd /container-host-bag && git checkout {{ CONTAINER_HOST_BAG_VERSION }})
RUN (cd /container-host-bag && git checkout {{ CONSONANCE_HOST_BAG_VERSION }})

RUN chmod u+x init_provisioner.sh
# TODO: make sure you create these from the .template files and customize them
Expand Down
3 changes: 3 additions & 0 deletions container-admin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ Install [docker-compose](https://docs.docker.com/compose/install/) on a Ubuntu 1

**NOTE:** We currently test on AWS. We recommend working through the [EC2 tutorial](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts.html) if you have not already.

Consonance uses cwltool and schema-salad on provisioned worker nodes to launch and run CWL.
Version numbers currently live in the Ansible playbook used to deploy workers.

## Usage

Before you run the `install_bootstrap` script, you will want to create a SSH key used to secure communication with the
Expand Down
10 changes: 5 additions & 5 deletions container-admin/install_bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ CONSONANCE_LAUNCHER_VERSION=feature/dockstore_1_2
# version of consonance jar files used
CONSONANCE_BINARY_VERSION=2.0.0-alpha.13
# version of container host bag (an ansible script) used to setup workers
CONTAINER_HOST_BAG_VERSION=2.0.0-alpha.2
CONSONANCE_HOST_BAG_VERSION=2.0.0-alpha.2

cat <<MSG
CONSONANCE INSTALLATION BOOTSTRAPPER
Expand Down Expand Up @@ -161,9 +161,9 @@ while [[ "${run_consonance_launcher^^}" != 'Y' && "${run_consonance_launcher^^}
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...
#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)
source <(jq -r "to_entries|map(\"\(.key)=\(.value|tostring)\")|.[]" consonance_launcher_config/compose.config | grep -v "CONSONANCE")
fi

user_cloud_env=''
Expand Down Expand Up @@ -220,7 +220,7 @@ while [[ "${run_consonance_launcher^^}" != 'Y' && "${run_consonance_launcher^^}
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 AWS instance type (e.g. c4.2xlarge)?" "$AWS_INSTANCE_TYPE" "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
Expand Down Expand Up @@ -382,7 +382,7 @@ while [[ "${run_consonance_launcher^^}" != 'Y' && "${run_consonance_launcher^^}
"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}",
"CONTAINER_HOST_BAG_VERSION":"${CONTAINER_HOST_BAG_VERSION}",
"CONSONANCE_HOST_BAG_VERSION":"${CONSONANCE_HOST_BAG_VERSION}",
"AWS_ACCESS_KEY_ID":"${user_aws_key}",
"AWS_SECRET_ACCESS_KEY":"${user_aws_secret_key}",
"AWS_MAX_SPOT_PRICE":"${aws_max_spot_price}",
Expand Down

0 comments on commit 5b6f255

Please sign in to comment.