-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tes 290 include helpers scripts #20
Conversation
Weren't those scripts meant to be baked in the AMI? |
moved files Edited comments edited start graphdb edited ebs_volume.sh Fix variables and IF statement
7cac120
to
59a7ad1
Compare
yes, they should be. @cristiantolev there's another PR in the packer repository containing these scripts Ontotext-AD/packer-aws-graphdb#11 - are they the same? This repository should contain only the user data script ( |
Yes, those scripts exist in the packer-aws-graphdb repo, and they are the same as those here. I will remove them from this repo. |
|
||
# Register the instance in Route 53, using the volume id for the sub-domain | ||
source /opt/helper-scripts/register_route53.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of sourcing these scripts we should pass arguments to them, see the packer PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
chown -R graphdb:graphdb $disk_mount_point | ||
# Search for an available EBS volume to attach to the instance. If no volume is found - create new one, attach, format and mount the volume. | ||
#source /opt/helper-scripts/ebs_volume.sh | ||
./opt/helper-scripts/ebs_volume.sh --name ${nam e} --ebs_volume_type ${ebs_volume_type} --ebs_volume_throughput ${ebs_volume_throughput} --ebs_kms_key_arn ${ebs_kms_key_arn} --ebs_volume_size ${ebs_volume_size} --ebs_volume_iops ${ebs_volume_iops} --device_name ${device_name} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
${nam e}
> ${name}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@@ -16,126 +16,41 @@ instance_id=$( curl -Ss -H "X-aws-ec2-metadata-token: $imds_token" 169.254.169.2 | |||
availability_zone=$( curl -Ss -H "X-aws-ec2-metadata-token: $imds_token" 169.254.169.254/latest/meta-data/placement/availability-zone ) | |||
volume_id="" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think volume_id=""
is used anywhere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
chown -R graphdb:graphdb $disk_mount_point | ||
# Search for an available EBS volume to attach to the instance. If no volume is found - create new one, attach, format and mount the volume. | ||
#source /opt/helper-scripts/ebs_volume.sh | ||
./opt/helper-scripts/ebs_volume.sh --name ${nam e} --ebs_volume_type ${ebs_volume_type} --ebs_volume_throughput ${ebs_volume_throughput} --ebs_kms_key_arn ${ebs_kms_key_arn} --ebs_volume_size ${ebs_volume_size} --ebs_volume_iops ${ebs_volume_iops} --device_name ${device_name} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make each property go on a new line e.g.,
./opt/helper-scripts/ebs_volume.sh --name ${name} \
--ebs_volume_type ${ebs_volume_type} \
....... \
....... \
.......
Would be easier to read.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
subdomain="$( echo -n "$volume_id" | sed 's/^vol-//' )" | ||
node_dns="$subdomain.${zone_dns_name}" | ||
# Register the instance in Route 53, using the volume id for the sub-domain. Capturing the node_dns variable to be used in the rest of the script. | ||
node_dns=$(./opt/helper-scripts/register_route53.sh \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At the end of this script there's this:
echo "Instance registered in Route 53 with DNS name:"
echo "$node_dns"
so, you'll have a lot more than just the DNS name.
Since, you have the zone name and the volume id, you can construct the FQDN. Otherwise, the script should echo just the FQDN.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
user data script will broken down to individual parts - this will not be needed for now. |
Description
The steps of creating a volume, attaching the instance to route 53, and creating a cron job for backup are moved into sub-scripts in order to simplify the main start_graphdb.sh script. Also, there is a fix related to the issue: IO volumes cannot be created due to the default value for throughput.
Related Issues
https://ontotext.atlassian.net/browse/TES-290
https://ontotext.atlassian.net/browse/TES-212
https://ontotext.atlassian.net/browse/TES-270
Changes
Added three new files: create_backup.sh, ebs_volume.sh, and register_route53.
Added an IF statement to check the volume type.
Screenshots (if applicable)
Checklist