Skip to content

Commit

Permalink
Fix the AWS deployment examples
Browse files Browse the repository at this point in the history
  • Loading branch information
allada committed Jul 23, 2023
1 parent 8ac4824 commit 17bfbf6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
11 changes: 6 additions & 5 deletions deployment-examples/terraform/ami.tf
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ resource "aws_instance" "build_turbo_cache_instance" {
cd ../../
rm -rf $SELF_DIR/.terraform-turbo-cache-builder
mkdir -p $SELF_DIR/.terraform-turbo-cache-builder
find . ! -ipath '*/target*' -and ! -ipath '*/.*' -and ! -ipath './bazel-*' -type f -print0 | tar cvf $SELF_DIR/.terraform-turbo-cache-builder/file.tar.gz --null -T -
find . ! -ipath '*/target*' -and ! \( -ipath '*/.*' -and ! -name '.rustfmt.toml' -and ! -name '.bazelrc' \) -and ! -ipath './bazel-*' -type f -print0 | tar cvf $SELF_DIR/.terraform-turbo-cache-builder/file.tar.gz --null -T -
EOT
}

Expand All @@ -84,8 +84,8 @@ resource "aws_instance" "build_turbo_cache_instance" {
`# When the instance first starts up AWS may have not finished add the certs to the` &&
`# apt servers, so we sleep for a few seconds` &&
sleep 5 &&
sudo apt update &&
sudo apt install -y jq &&
sudo DEBIAN_FRONTEND=noninteractive apt-get update &&
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y jq libssl-dev &&
sudo mv ~/create_filesystem.sh /root/create_filesystem.sh &&
sudo chmod +x /root/create_filesystem.sh &&
sudo /root/create_filesystem.sh /mnt/data &&
Expand Down Expand Up @@ -113,9 +113,10 @@ resource "aws_instance" "build_turbo_cache_instance" {
mkdir -p /tmp/turbo-cache &&
cd /tmp/turbo-cache &&
tar xvf /tmp/file.tar.gz &&
sudo apt install -y docker.io awscli &&
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y docker.io awscli &&
cd /tmp/turbo-cache &&
sudo docker build -t turbo-cache-runner -f ./deployment-examples/docker-compose/Dockerfile . &&
. /etc/lsb-release &&
sudo docker build --build-arg OS_VERSION=$DISTRIB_RELEASE -t turbo-cache-runner -f ./deployment-examples/docker-compose/Dockerfile . &&
container_id=$(sudo docker create turbo-cache-runner) &&
`# Copy the compiled binary out of the container` &&
sudo docker cp $container_id:/usr/local/bin/turbo-cache /usr/local/bin/turbo-cache &&
Expand Down
2 changes: 1 addition & 1 deletion deployment-examples/terraform/scripts/create_filesystem.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ fi
MOUNT_LOCATION="$1"
shift

DEVICES=( $(lsblk --fs --json | jq -r '.blockdevices[] | select(.children == null and .fstype == null) | .name') )
DEVICES=( $(lsblk --fs --json | jq -r '.blockdevices[] | select(.children == null and .fstype == null and .mountpoints[0] == null) | .name') )
DEVICES_FULLNAME=()
for DEVICE in "${DEVICES[@]}"; do
DEVICES_FULLNAME+=("/dev/$DEVICE")
Expand Down
4 changes: 2 additions & 2 deletions deployment-examples/terraform/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@

variable "build_base_ami_arm" {
description = "Base AMI for building Turbo Cache for ARM"
default = "ami-075200050e2c8899b"
default = "ami-0c79a55dda52434da"
}

variable "build_base_ami_x86" {
description = "Base AMI for building Turbo Cache for x86"
default = "ami-0ddf424f81ddb0720"
default = "ami-03f65b8614a860c29"
}

variable "build_arm_instance_type" {
Expand Down

0 comments on commit 17bfbf6

Please sign in to comment.