From ebd1b927aab3805bbf8a237ead48e1e308a5b4cc Mon Sep 17 00:00:00 2001 From: troymc Date: Tue, 17 May 2016 09:29:49 +0200 Subject: [PATCH] No default AWS deployment config file --- deploy-cluster-aws/awsdeploy.sh | 13 ++++++++----- ...efault_deploy_conf.py => example_deploy_conf.py} | 6 +++--- docs/source/deploy-on-aws.md | 6 ++---- 3 files changed, 13 insertions(+), 12 deletions(-) rename deploy-cluster-aws/{default_deploy_conf.py => example_deploy_conf.py} (93%) diff --git a/deploy-cluster-aws/awsdeploy.sh b/deploy-cluster-aws/awsdeploy.sh index b40fa467..695c71ff 100755 --- a/deploy-cluster-aws/awsdeploy.sh +++ b/deploy-cluster-aws/awsdeploy.sh @@ -4,17 +4,20 @@ # if any command has a non-zero exit status set -e -# Check the (optional) command-line argument +# Check for the first command-line argument # (the name of the AWS deployment config file) if [ -z "$1" ]; then # no first argument was provided - DEPLOY_CONF_FILE=default_deploy_conf.py -else - DEPLOY_CONF_FILE=$1 + echo "awsdeploy: missing file operand" + echo "Usage: awsdeploy DEPLOY_CONF_FILE" + echo "Deploy BigchainDB on AWS using the specified AWS deployment configuration file" + exit 1 fi +DEPLOY_CONF_FILE=$1 + # Check to make sure DEPLOY_CONF_FILE exists -if [ ! -f $DEPLOY_CONF_FILE ]; then +if [ ! -f "$DEPLOY_CONF_FILE" ]; then echo "AWS deployment configuration file not found: "$DEPLOY_CONF_FILE exit 1 fi diff --git a/deploy-cluster-aws/default_deploy_conf.py b/deploy-cluster-aws/example_deploy_conf.py similarity index 93% rename from deploy-cluster-aws/default_deploy_conf.py rename to deploy-cluster-aws/example_deploy_conf.py index f80fcae2..994e14b5 100644 --- a/deploy-cluster-aws/default_deploy_conf.py +++ b/deploy-cluster-aws/example_deploy_conf.py @@ -1,14 +1,14 @@ # AWS deployment config file # To use in a Bash shell script: -# source default_deploy_conf.py +# source example_deploy_conf.py # # $EXAMPLEVAR now has a value # To use in a Python script: -# from default_deploy_conf import * +# from example_deploy_conf import * # or # import importlib -# cf = importlib.import_module('default_deploy_conf') +# cf = importlib.import_module('example_deploy_conf') # # cf.EXAMPLEVAR now has a value # DON'T PUT SPACES AROUND THE = diff --git a/docs/source/deploy-on-aws.md b/docs/source/deploy-on-aws.md index db3d8b44..fb0442a3 100644 --- a/docs/source/deploy-on-aws.md +++ b/docs/source/deploy-on-aws.md @@ -145,7 +145,7 @@ You can look inside those files if you're curious. For example, the default keyr ### Step 2 -Step 2 is to make an AWS deployment configuration file, if necessary. There's a default AWS configuration file named `default_deploy_conf.py`. It has many comments explaining each setting. The default AWS deployment settings are (or should be): +Step 2 is to make an AWS deployment configuration file, if necessary. There's an example AWS configuration file named `example_deploy_conf.py`. It has many comments explaining each setting. The settings in that file are (or should be): ```text NUM_NODES=3 BRANCH="master" @@ -155,7 +155,7 @@ IMAGE_ID="ami-accff2b1" INSTANCE_TYPE="m3.2xlarge" ``` -If you're happy with those settings, then you can skip to the next step. Otherwise, you could make a copy of `default_deploy_conf.py` (e.g. `cp default_deploy_conf.py my_deploy_conf.py`) and then edit the new file using a text editor. +If you're happy with those settings, then you can skip to the next step. Otherwise, you could make a copy of `example_deploy_conf.py` (e.g. `cp example_deploy_conf.py my_deploy_conf.py`) and then edit the copy using a text editor. If you want your nodes to have a predictable set of pre-generated keypairs, then you should 1) set `USE_KEYPAIRS_FILE=True` in the AWS deployment configuration file, and 2) provide a `keypairs.py` file containing enough keypairs for all of your nodes. You can generate a `keypairs.py` file using the `write_keypairs_file.py` script. For example: ```text @@ -182,8 +182,6 @@ fab start_bigchaindb `awsdeploy.sh` is a Bash script which calls some Python and Fabric scripts. If you're curious what it does, [the source code](https://github.com/bigchaindb/bigchaindb/blob/master/deploy-cluster-aws/awsdeploy.sh) has many explanatory comments. -If you don't specify the name of your AWS deployment configuration file (e.g. `my_deploy_conf.py` above), then `default_deploy_conf.py` will be used by default. - It should take a few minutes for the deployment to finish. If you run into problems, see the section on **Known Deployment Issues** below. The EC2 Console has a section where you can see all the instances you have running on EC2. You can `ssh` into a running instance using a command like: