Skip to content

Commit

Permalink
chore: move s3 cache around
Browse files Browse the repository at this point in the history
  • Loading branch information
strophy committed Jul 27, 2023
1 parent 7f37951 commit 3a5f0ea
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

apt-get update -y
apt-get install -y apt-transport-https ca-certificates curl gnupg lsb-release
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
apt-get update -y
apt-get install -y docker-ce docker-ce-cli containerd.io
usermod -aG ubuntu docker
echo -e "---\n\nversion: 0.1\nlog:\n level: info\n fields:\n service: registry\nstorage:\n cache:\n blobdescriptor: inmemory\n filesystem:\n rootdirectory: /var/lib/registry\nhttp:\n addr: :5000\n headers:\n X-Content-Type-Options: [nosniff]\nproxy:\n remoteurl: https://registry-1.docker.io" > /home/ubuntu/config.yml
mkdir /home/ubuntu/registry
docker run -d -p 5000:5000 --restart=always --name=through-cache -v /home/ubuntu/config.yml:/etc/docker/registry/config.yml -v /home/ubuntu/registry:/var/lib/registry registry:2
11 changes: 0 additions & 11 deletions modules/runners/cache.tf

This file was deleted.

12 changes: 12 additions & 0 deletions modules/runners/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -208,3 +208,15 @@ resource "aws_security_group" "runner_sg" {
},
)
}

module "s3_cache" {
count = var.create_cache_bucket ? 1 : 0

source = "./s3_cache"

config = {
prefix = var.prefix
tags = local.tags
arn_runner_instance_role = aws_iam_role.runner.arn
}
}
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
variable "config" {
type = object({
prefix = string
tags = map(string)
prefix = string
tags = map(string)
arn_runner_instance_role = string
})
}
File renamed without changes.

0 comments on commit 3a5f0ea

Please sign in to comment.