Skip to content
This repository was archived by the owner on Aug 16, 2021. It is now read-only.

Region param added to nancy run #93

Merged
merged 9 commits into from
Aug 24, 2018
Merged

Region param added to nancy run #93

merged 9 commits into from
Aug 24, 2018

Conversation

dmius
Copy link
Collaborator

@dmius dmius commented Aug 21, 2018

No description provided.

@dmius dmius requested a review from NikolayS August 21, 2018 19:56
nancy_run.sh Outdated
fi
if [[ -z ${AWS_EC2_TYPE+x} ]]; then
err "ERROR: AWS EC2 Instance type not given."
exit 1
fi
if [[ -z ${AWS_REGION+x} ]]; then
err "ERROR: AWS EC2 region not given."
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

по умолчанию не будем что-то использовать?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Наш us-east-1 прописать как дефолтный?

nancy_run.sh Outdated
@@ -575,6 +582,10 @@ elif [[ "$RUN_ON" == "localhost" ]]; then
err "ERROR: option '--aws-ebs-volume-size' must be used with '--run on aws'."
exit 1
fi
if [[ ! -z ${AWS_REGION+x} ]]; then
err "ERROR: option '--aws-region' must be used with '--run on aws'."
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--run on, пропущен -

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Это правил

nancy_run.sh Outdated
@@ -821,26 +832,26 @@ elif [[ "$RUN_ON" == "aws" ]]; then
msg "Increased price: $price"
EC2_PRICE=$price
if [ -z $zone ]; then
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[[

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if [[ -z ${zone+x} ]]; then

?

nancy_run.sh Outdated
fi

create_ec2_docker_machine $DOCKER_MACHINE $AWS_EC2_TYPE $EC2_PRICE \
60 $AWS_KEYPAIR_NAME $AWS_SSH_KEY_PATH $zone;
60 $AWS_KEYPAIR_NAME $AWS_SSH_KEY_PATH $AWS_REGION $zone;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

напомни, что тут 60 означает?
это точно то, что нам надо?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Это время жизни, теперь задается параметром в #92

nancy_run.sh Outdated
@@ -896,10 +907,10 @@ elif [[ "$RUN_ON" == "aws" ]]; then
# Create new volume and attach them for non i3 instances if needed
if [ ! -z ${AWS_EBS_VOLUME_SIZE+x} ]; then
msg "Create and attach a new EBS volume (size: $AWS_EBS_VOLUME_SIZE GB)"
VOLUME_ID=$(aws ec2 create-volume --size $AWS_EBS_VOLUME_SIZE --region us-east-1 --availability-zone us-east-1a --volume-type gp2 | jq -r .VolumeId)
VOLUME_ID=$(aws --region=$AWS_REGION ec2 create-volume --size $AWS_EBS_VOLUME_SIZE --availability-zone us-east-1a --volume-type gp2 | jq -r .VolumeId)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

а zone никак не передаём?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

и как --availability-zone us-east-1a сочетается с $AWS_REGION, если оно ($AWS_REGION) не us-east-1?

Copy link
Collaborator

@NikolayS NikolayS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Выглядит в целом отлично, спасибо за код стайл причёсывание, но см комменты — есть некоторые открытые вопросы про регионы/AZ

nancy_run.sh Outdated
exit 1
fi
if [[ "$AWS_BLOCK_DURATION" != "0" ]]; then
err "ERROR: option '--aws-block-duration' must be used with '--run on aws'."
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--run-on

@dmius dmius merged commit 397c31f into master Aug 24, 2018
@dmius dmius deleted the dmius-region-param branch August 24, 2018 07:31
NikolayS pushed a commit that referenced this pull request Sep 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants