Skip to content
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

Update AMI resolution rules to ensure an available AMI. #28

Merged
merged 1 commit into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mill/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ data "aws_ami" "docker_ami" {

filter {
name = "name"
values = ["aws-elasticbeanstalk-amzn-2018.03.0.x86_64-docker-hvm-*"]
values = ["amzn2-ami-kernel-5.*-hvm-2.0.*.1-x86_64-gp2"]
}

filter {
Expand Down
11 changes: 9 additions & 2 deletions mill/resources/cloud-init.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ apt_reboot_if_required: True

# Install additional packages on first boot
packages:
- docker

# run commands
# runcmd contains a list of either lists or a string
Expand All @@ -65,7 +66,9 @@ runcmd:
- curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
- unzip awscliv2.zip
- ./aws/install

- systemctl start docker
- systemctl enable docker

# set the locale
locale: en_US.UTF-8

Expand All @@ -85,6 +88,8 @@ Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="user-script"

#!/bin/bash


millHome=/root/mill-home
mkdir -p $millHome

Expand All @@ -93,6 +98,8 @@ aws s3 cp --recursive s3://${mill_s3_config_location} $millHome/

instanceId=`ls /var/lib/cloud/instances`

docker run -d -it -v /sys/fs/cgroup/:/sys/fs/cgroup:ro --cap-add SYS_ADMIN -e HOST_NAME="${instance_prefix}-${node_type}-$instanceId" -e LOG_LEVEL="${log_level}" -e DOMAIN=${domain} -e NODE_TYPE="${node_type}" -e MAX_WORKER_THREADS="${max_worker_threads}" -e AWS_REGION="${aws_region}" -v $millHome:/mill-home -v /efs:/efs --name=duracloud-mill ${mill_docker_container}:${mill_version};
docker rm -f duracloud-mill && echo "duracloud-mill removed" || echo "duracloud-mill does not exist, ignoring."

docker run -d --rm -it -v /sys/fs/cgroup/:/sys/fs/cgroup:ro --cap-add SYS_ADMIN -e HOST_NAME="${instance_prefix}-${node_type}-$instanceId" -e LOG_LEVEL="${log_level}" -e DOMAIN=${domain} -e NODE_TYPE="${node_type}" -e MAX_WORKER_THREADS="${max_worker_threads}" -e AWS_REGION="${aws_region}" -v $millHome:/mill-home -v /efs:/efs --name=duracloud-mill ${mill_docker_container}:${mill_version};

--===============2205584129673038508==--
Loading